Skip to content

TVM-aware test helpers#69

Open
km631 wants to merge 2 commits into
masterfrom
feat/tvm-test-helpers
Open

TVM-aware test helpers#69
km631 wants to merge 2 commits into
masterfrom
feat/tvm-test-helpers

Conversation

@km631
Copy link
Copy Markdown
Collaborator

@km631 km631 commented May 29, 2026

Part 2 of 3 splitting #64. Stacked on #68 (feat/tvm-compile-pipeline) — review/merge after #68.

What

TVM-aware test helpers.

  • account default balance bounded to TVM's Long.MAX_VALUE sun range (5 * WeiPerEther; the upstream 10000 ETH equivalent overflows TVM's 1-wei-==-1-sun account balance).
  • txpool batchInBlock made dual-mode — EVM path (evm_setAutomine) when an explicit provider is passed (anvil-backed tests), TVM path (tre_blockTime/tre_mine) otherwise. (The EVM path is currently exercised only by the TrieProof test, which is skipped in part 3; kept as forward-looking groundwork.)
  • Add PackedUserOperation / UserOperationRequest EIP-712 types and an erc4337 helper (UserOperation builder, ERC4337Helper, smart-account wrappers) as groundwork for account-abstraction tests (no in-tree test consumes them yet).

Excluded vs the original branch

  • governance.js — the functional sequential-delegate() change is already on master; the only net difference was comment wording, so it is dropped to avoid churn.

🤖 Generated with Claude Code

Copy link
Copy Markdown
Collaborator

@luiz-lvj luiz-lvj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imo we should remove erc4337 additions for now, we might add them back later when/if we have an strategy for Account Abstraction on Tron.

Comment thread test/helpers/eip712-types.js Outdated
Comment on lines +35 to +57
PackedUserOperation: {
sender: 'address',
nonce: 'uint256',
initCode: 'bytes',
callData: 'bytes',
accountGasLimits: 'bytes32',
preVerificationGas: 'uint256',
gasFees: 'bytes32',
paymasterAndData: 'bytes',
},
UserOperationRequest: {
sender: 'address',
nonce: 'uint256',
initCode: 'bytes',
callData: 'bytes',
accountGasLimits: 'bytes32',
preVerificationGas: 'uint256',
gasFees: 'bytes32',
paymasterVerificationGasLimit: 'uint256',
paymasterPostOpGasLimit: 'uint256',
validAfter: 'uint48',
validUntil: 'uint48',
},
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should drop this for now as we removed ERC4337 from the repo. They might be reintroduced when Tron implements ERC7702 and as well.

Suggested change
PackedUserOperation: {
sender: 'address',
nonce: 'uint256',
initCode: 'bytes',
callData: 'bytes',
accountGasLimits: 'bytes32',
preVerificationGas: 'uint256',
gasFees: 'bytes32',
paymasterAndData: 'bytes',
},
UserOperationRequest: {
sender: 'address',
nonce: 'uint256',
initCode: 'bytes',
callData: 'bytes',
accountGasLimits: 'bytes32',
preVerificationGas: 'uint256',
gasFees: 'bytes32',
paymasterVerificationGasLimit: 'uint256',
paymasterPostOpGasLimit: 'uint256',
validAfter: 'uint48',
validUntil: 'uint48',
},

Comment thread test/helpers/erc4337.js Outdated
const delegate = await accountFactory.deploy(...extraArgs);
const instance = await params.eip7702signer.getAddress().then(address => accountFactory.attach(address));
const authorization = await params.eip7702signer.authorize({ address: delegate.target });
return new EIP7702SmartAccount(instance, authorization, env);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EIP 7702 is not live on Tron, so we dropped the contracts. Imo we should remove this file erc4337.js for now.

Comment thread test/helpers/erc4337.js Outdated
Comment on lines +131 to +132
entrypoint: params.entrypoint ?? predeploy.entrypoint.v09,
senderCreator: params.senderCreator ?? predeploy.senderCreator.v09,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The entrypoint is not deployed on Tron, so let's skip this for now.

@km631
Copy link
Copy Markdown
Collaborator Author

km631 commented May 30, 2026

Addressed: removed test/helpers/erc4337.js and the PackedUserOperation/UserOperationRequest EIP-712 types in af46156. The PR now contains only the account balance bound and the dual-mode txpool helper. Stacked PR #70 was rebased onto the update.

km631 and others added 2 commits May 30, 2026 11:05
Bound the account default balance to TVM's Long.MAX_VALUE sun range, make
txpool batchInBlock dual-mode (EVM evm_setAutomine path when a provider is
passed, TVM tre_blockTime/tre_mine path otherwise), and add the
PackedUserOperation/UserOperationRequest EIP-712 types plus an erc4337
helper as groundwork for account-abstraction tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Remove the speculative erc4337.js helper and the PackedUserOperation/
UserOperationRequest EIP-712 types. Account abstraction (ERC-4337/7702) is
not live on Tron and the contracts were removed from the repo; this can be
reintroduced alongside an AA strategy. Leaves the account balance bound and
the dual-mode txpool helper.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@km631 km631 force-pushed the feat/tvm-test-helpers branch from af46156 to adfb2fc Compare May 30, 2026 08:05
@km631 km631 changed the base branch from feat/tvm-compile-pipeline to master May 30, 2026 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants