Skip to content

Commit

Permalink
Merge pull request #73 from Agoric/pc/agd-gas-flags
Browse files Browse the repository at this point in the history
feat: include gas flags in agd.tx
  • Loading branch information
turadg authored Mar 8, 2024
2 parents 87a1651 + 4f5a5f6 commit ef32c1d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
5 changes: 4 additions & 1 deletion packages/synthetic-chain/src/lib/agd-lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ export const makeAgd = ({
});
const rw = freeze({
/**
* TODO: gas
* @param {string[]} txArgs
* @param {{ chainId: string, from: string, yes?: boolean }} opts
*/
tx: async (
txArgs: string[],
Expand All @@ -95,6 +96,8 @@ export const makeAgd = ({
...[`--from`, from],
'tx',
...['--broadcast-mode', 'block'],
...['--gas', 'auto'],
...['--gas-adjustment', '1.3'],
...txArgs,
...yesArg,
...outJson,
Expand Down
9 changes: 8 additions & 1 deletion packages/synthetic-chain/src/lib/cliHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ export const agd = {
return JSON.parse(data);
},
tx: async (...params) => {
const newParams = ['tx', '-bblock', ...params, '-o json'];
const newParams = [
'tx',
'-bblock',
'--gas auto',
'--gas-adjustment 1.3',
...params,
'-o json',
];
const data = await executeCommand(BINARY, newParams, { shell: true });
return JSON.parse(data);
},
Expand Down
3 changes: 0 additions & 3 deletions packages/synthetic-chain/src/lib/commonUpgradeHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ export const installBundle = async (addr, bundlePath) => {
'--from',
addr,
'--keyring-backend=test',
'--gas=auto',
'--chain-id',
CHAINID,
'-bblock',
Expand All @@ -301,8 +300,6 @@ export const submitProposal = async (
'--from',
VALIDATORADDR,
'--keyring-backend=test',
'--gas=auto',
'--gas-adjustment=1.2',
'--chain-id',
CHAINID,
'-bblock',
Expand Down
3 changes: 1 addition & 2 deletions packages/synthetic-chain/src/lib/core-eval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export const passCoreEvalProposal = async (

const bundleRd = path.join(dir, fileName);
const result = await agd.tx(
['swingset', 'install-bundle', `@${bundleRd}`, '--gas', 'auto'],
['swingset', 'install-bundle', `@${bundleRd}`],
{ from, chainId, yes: true },
);
console.log(txAbbr(result));
Expand Down Expand Up @@ -224,7 +224,6 @@ export const passCoreEvalProposal = async (
'swingset-core-eval',
...evalPaths,
...flags({ ...info, deposit }),
...flags({ gas: 'auto', 'gas-adjustment': '1.2' }),
],
{ from, chainId, yes: true },
);
Expand Down

0 comments on commit ef32c1d

Please sign in to comment.