You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2da6945
Browse filesBrowse the repository at this point in the historyBrowse files
feat: add --gas override flag to deploy and write (#402)
On Bradbury, `genlayer write` used the exact eth_estimateGas result as
the outer EVM gas limit, and the transaction reverted twice before
GenVM was ever reached; identical calldata succeeded when replayed
with a larger explicit gas limit. The CLI exposed no way to override
gas estimation for either deploy or write.
Adds `--gas <gasLimit>` to both commands, threaded through to
genlayer-js's writeContract/deployContract `gas` option (see
genlayer-js PR #205, which this depends on — this PR's tests use a
mocked genlayer-js client so they don't need that change merged
first, but the flag has no runtime effect against genlayer-js
versions that don't understand the `gas` field yet).
Added a `parseGasLimit` helper next to the existing `parseValidUntil`
in fees.ts, reusing the same `parseBigNumberishOption` validation
(non-negative integer, decimal or 0x-hex) plus a positive-value check
specific to gas (zero isn't a meaningful gas limit).
Tests: 9 new cases across tests/actions/{write,deploy}.test.ts (valid
override passed through as bigint, omitted when not provided, invalid
value rejected before the SDK call, zero rejected) and
tests/commands/{write,deploy}.test.ts (CLI flag parsing reaches the
action). Full suite: 585 passed (52 files), no regressions. TypeScript:
0 new errors in any file I touched (`npx tsc --noEmit` shows
pre-existing, unrelated errors in staking/vesting/keychain code from
genlayer-cli's source being ahead of its published genlayer-js
dependency — none in write.ts, deploy.ts, fees.ts, or
commands/index.ts).
0 commit comments