Skip to content

Commit

Permalink
Remove trailing commas in JS files (prettier configuration)
Browse files Browse the repository at this point in the history
  • Loading branch information
szg251 committed Sep 19, 2023
1 parent daad2ae commit 275b138
Show file tree
Hide file tree
Showing 34 changed files with 136 additions and 139 deletions.
2 changes: 1 addition & 1 deletion examples/AlwaysMints.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {
const path = require("path");
script = fs.readFileSync(
path.resolve(__dirname, "../../fixtures/scripts/always-mints.plutus"),
"utf8",
"utf8"
);
}
exports.alwaysMints = script;
2 changes: 1 addition & 1 deletion examples/AlwaysSucceeds.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {
const path = require("path");
script = fs.readFileSync(
path.resolve(__dirname, "../../fixtures/scripts/always-succeeds.plutus"),
"utf8",
"utf8"
);
}

Expand Down
2 changes: 1 addition & 1 deletion examples/ECDSA.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {
const path = require("path");
script = fs.readFileSync(
path.resolve(__dirname, "../../fixtures/scripts/validate-ecdsa.plutus"),
"utf8",
"utf8"
);
}
exports.validateECDSA = script;
2 changes: 1 addition & 1 deletion examples/ExUnits.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {
const path = require("path");
script = fs.readFileSync(
path.resolve(__dirname, "../../fixtures/scripts/exunits.plutus"),
"utf8",
"utf8"
);
}

Expand Down
2 changes: 1 addition & 1 deletion examples/IncludeDatum.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {
const path = require("path");
script = fs.readFileSync(
path.resolve(__dirname, "../../fixtures/scripts/include-datum.plutus"),
"utf8",
"utf8"
);
}

Expand Down
2 changes: 1 addition & 1 deletion examples/Lose7Ada.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {
const path = require("path");
script = fs.readFileSync(
path.resolve(__dirname, "../../fixtures/scripts/always-fails.plutus"),
"utf8",
"utf8"
);
}

Expand Down
2 changes: 1 addition & 1 deletion examples/MintsMultipleTokens.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {
const readScript = name =>
fs.readFileSync(
path.resolve(__dirname, `../../fixtures/scripts/${name}.plutus`),
"utf8",
"utf8"
);
redeemerInt1 = readScript("redeemer1");
redeemerInt2 = readScript("redeemer2");
Expand Down
2 changes: 1 addition & 1 deletion examples/MultipleRedeemers.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {
const readScript = name =>
fs.readFileSync(
path.resolve(__dirname, `../../fixtures/scripts/${name}.plutus`),
"utf8",
"utf8"
);
vredeemerInt1 = readScript("redeemer1-validator");
vredeemerInt2 = readScript("redeemer2-validator");
Expand Down
2 changes: 1 addition & 1 deletion examples/OneShotMinting.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {
const path = require("path");
script = fs.readFileSync(
path.resolve(__dirname, "../../fixtures/scripts/one-shot-minting.plutus"),
"utf8",
"utf8"
);
}

Expand Down
4 changes: 2 additions & 2 deletions examples/OtherTypeTextEnvelope.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {
script = fs.readFileSync(
path.resolve(
__dirname,
"../../fixtures/scripts/other-type-text-envelope.plutus",
"../../fixtures/scripts/other-type-text-envelope.plutus"
),
"utf8",
"utf8"
);
}
exports.otherTypeTextEnvelope = script;
4 changes: 2 additions & 2 deletions examples/PlutusV2/InlineDatum.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {
script = fs.readFileSync(
path.resolve(
__dirname,
"../../fixtures/scripts/check-datum-is-inline.plutus",
"../../fixtures/scripts/check-datum-is-inline.plutus"
),
"utf8",
"utf8"
);
}

Expand Down
4 changes: 2 additions & 2 deletions examples/PlutusV2/OneShotMinting.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {
script = fs.readFileSync(
path.resolve(
__dirname,
"../../fixtures/scripts/one-shot-minting-v2.plutus",
"../../fixtures/scripts/one-shot-minting-v2.plutus"
),
"utf8",
"utf8"
);
}

Expand Down
2 changes: 1 addition & 1 deletion examples/PlutusV2/Scripts/AlwaysMints.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {
const path = require("path");
script = fs.readFileSync(
path.resolve(__dirname, "../../fixtures/scripts/always-mints-v2.plutus"),
"utf8",
"utf8"
);
}
exports.alwaysMintsV2 = script;
2 changes: 1 addition & 1 deletion examples/PlutusV2/Scripts/AlwaysSucceeds.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {
const path = require("path");
script = fs.readFileSync(
path.resolve(__dirname, "../../fixtures/scripts/always-succeeds-v2.plutus"),
"utf8",
"utf8"
);
}

Expand Down
2 changes: 1 addition & 1 deletion examples/Schnorr.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if (typeof BROWSER_RUNTIME != "undefined" && BROWSER_RUNTIME) {
const path = require("path");
script = fs.readFileSync(
path.resolve(__dirname, "../../fixtures/scripts/validate-schnorr.plutus"),
"utf8",
"utf8"
);
}

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"webpack-dev-server": "4.7.4"
},
"prettier": {
"arrowParens": "avoid"
"arrowParens": "avoid",
"trailingComma": "none"
}
}
2 changes: 1 addition & 1 deletion src/Internal/ApplyArgs.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ exports.apply_params_to_script = left => right => args => script => {
try {
appliedScript = apply_args.apply_params_to_script_no_panic(
argsBytes,
scriptBytes,
scriptBytes
);
} catch (e) {
return left("Error applying argument to script: ".concat(e.toString()));
Expand Down
36 changes: 18 additions & 18 deletions src/Internal/Deserialization/Transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ exports._txBodyUpdate = maybeGetter("update");
exports._txBodyAuxiliaryDataHash = maybeGetter("auxiliary_data_hash");
// validity_start_interval(): number | void;
exports._txBodyValidityStartInterval = maybeGetter(
"validity_start_interval_bignum",
"validity_start_interval_bignum"
);
// multiassets(): Mint | void;
exports._txBodyMultiAssets = maybeGetter("multiassets");
Expand Down Expand Up @@ -98,7 +98,7 @@ exports._unpackWithdrawals = containerhelper =>

exports._unpackUpdate = containerhelper => update => {
const pppus = containerhelper.unpackKeyIndexed(
update.proposed_protocol_parameter_updates(),
update.proposed_protocol_parameter_updates()
);
return { epoch: update.epoch(), paramUpdates: pppus };
};
Expand All @@ -111,41 +111,41 @@ exports._convertCert = certConvHelper => cert => {
switch (cert.kind()) {
case lib.CertificateKind.StakeRegistration:
return certConvHelper.stakeRegistration(
cert.as_stake_registration().stake_credential(),
cert.as_stake_registration().stake_credential()
);
case lib.CertificateKind.StakeDeregistration:
return certConvHelper.stakeDeregistration(
cert.as_stake_deregistration().stake_credential(),
cert.as_stake_deregistration().stake_credential()
);
case lib.CertificateKind.StakeDelegation:
return certConvHelper.stakeDelegation(
cert.as_stake_delegation().stake_credential(),
cert.as_stake_delegation().stake_credential()
)(cert.as_stake_delegation().pool_keyhash());
case lib.CertificateKind.PoolRegistration:
return certConvHelper.poolRegistration(
cert.as_pool_registration().pool_params(),
cert.as_pool_registration().pool_params()
);
case lib.CertificateKind.PoolRetirement:
return certConvHelper.poolRetirement(
cert.as_pool_retirement().pool_keyhash(),
cert.as_pool_retirement().pool_keyhash()
)(cert.as_pool_retirement().epoch());
case lib.CertificateKind.GenesisKeyDelegation:
return certConvHelper.genesisKeyDelegation(
cert.as_genesis_key_delegation().genesishash(),
cert.as_genesis_key_delegation().genesishash()
)(cert.as_genesis_key_delegation().genesis_delegate_hash())(
cert.as_genesis_key_delegation().vrf_keyhash(),
cert.as_genesis_key_delegation().vrf_keyhash()
);
case lib.CertificateKind.MoveInstantaneousRewardsCert:
const mirCert = cert.as_move_instantaneous_rewards_cert();
const mir = mirCert.move_instantaneous_reward();
switch (mir.kind()) {
case lib.MIRKind.ToOtherPot:
return certConvHelper.moveInstantaneousRewardsToOtherPotCert(
mir.pot(),
mir.pot()
)(mir.as_to_other_pot());
case lib.MIRKind.ToStakeCredentials:
return certConvHelper.moveInstantaneousRewardsToStakeCreds(mir.pot())(
mir.as_to_stake_creds(),
mir.as_to_stake_creds()
);
default:
throw (
Expand Down Expand Up @@ -182,7 +182,7 @@ exports._unpackProtocolParamUpdate = maybe => ppu => {
maxBlockExUnits: optional(ppu.max_block_ex_units()),
maxValueSize: optional(ppu.max_value_size()),
collateralPercentage: optional(ppu.collateral_percentage()),
maxCollateralInputs: optional(ppu.max_collateral_inputs()),
maxCollateralInputs: optional(ppu.max_collateral_inputs())
};
};

Expand Down Expand Up @@ -230,26 +230,26 @@ exports._convertMetadatum = metadataCtors => cslMetadatum => {
exports._unpackExUnits = exunits => {
return {
mem: exunits.mem(),
steps: exunits.steps(),
steps: exunits.steps()
};
};

exports._unpackUnitInterval = ui => {
return {
numerator: ui.numerator(),
denominator: ui.denominator(),
denominator: ui.denominator()
};
};

exports._unpackProtocolVersion = cslPV => ({
major: cslPV.major(),
minor: cslPV.minor(),
minor: cslPV.minor()
});

exports._unpackExUnitsPrices = cslEup => {
return {
memPrice: cslEup.mem_price(),
stepPrice: cslEup.step_price(),
stepPrice: cslEup.step_price()
};
};

Expand Down Expand Up @@ -288,14 +288,14 @@ exports.convertSingleHostAddr_ = maybe => cont => singleHostAddr => {
const ipv6 = singleHostAddr.ipv6();

return cont(port ? maybe.just(port) : maybe.nothing)(
ipv4 ? maybe.just(ipv4) : maybe.nothing,
ipv4 ? maybe.just(ipv4) : maybe.nothing
)(ipv6 ? maybe.just(ipv6) : maybe.nothing);
};

exports.convertSingleHostName_ = maybe => cont => singleHostName => {
const port = singleHostName.port();
return cont(port ? maybe.just(port) : maybe.nothing)(
singleHostName.dns_name().record(),
singleHostName.dns_name().record()
);
};

Expand Down
2 changes: 1 addition & 1 deletion src/Internal/FfiHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ exports._containerHelper = r => ({
res.insert(key, value);
});
return res;
},
}
});
2 changes: 1 addition & 1 deletion src/Internal/JsWebSocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ exports._mkWebSocket = logger => url => () => {
ws = new ReconnectingWebSocket.default(url);
} else {
ws = new ReconnectingWebSocket(url, [], {
WebSocket: NoPerMessageDeflateWebSocket,
WebSocket: NoPerMessageDeflateWebSocket
});
}
ws.finalizers = [];
Expand Down
2 changes: 1 addition & 1 deletion src/Internal/Plutip/PortCheck.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ exports._isPortAvailable = port => () =>
port +
", error: " +
err.code +
")",
")"
);
}
})
Expand Down
Loading

0 comments on commit 275b138

Please sign in to comment.