diff --git a/api/debug.go b/api/debug.go index 3f96fd97..1aa95a48 100644 --- a/api/debug.go +++ b/api/debug.go @@ -240,6 +240,7 @@ func (d *DebugAPI) TraceCall( from, to, tx.Data(), + tx.SetCodeAuthorizations(), tx.Value(), tx.Gas(), opts..., diff --git a/go.mod b/go.mod index 5ded44a2..f72d5523 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/holiman/uint256 v1.3.2 github.com/onflow/atree v0.11.0 github.com/onflow/cadence v1.8.3 - github.com/onflow/flow-go v0.44.0-experimental-cadence-v1.8.3.0.20251111112227-097f521427a5 + github.com/onflow/flow-go v0.44.0 github.com/onflow/flow-go-sdk v1.9.2 github.com/prometheus/client_golang v1.20.5 github.com/rs/cors v1.8.0 diff --git a/go.sum b/go.sum index 988ceb0d..073492db 100644 --- a/go.sum +++ b/go.sum @@ -571,8 +571,8 @@ github.com/onflow/flow-ft/lib/go/contracts v1.0.1 h1:Ts5ob+CoCY2EjEd0W6vdLJ7hLL3 github.com/onflow/flow-ft/lib/go/contracts v1.0.1/go.mod h1:PwsL8fC81cjnUnTfmyL/HOIyHnyaw/JA474Wfj2tl6A= github.com/onflow/flow-ft/lib/go/templates v1.0.1 h1:FDYKAiGowABtoMNusLuRCILIZDtVqJ/5tYI4VkF5zfM= github.com/onflow/flow-ft/lib/go/templates v1.0.1/go.mod h1:uQ8XFqmMK2jxyBSVrmyuwdWjTEb+6zGjRYotfDJ5pAE= -github.com/onflow/flow-go v0.44.0-experimental-cadence-v1.8.3.0.20251111112227-097f521427a5 h1:L09sNOfqIHAWD90psYCl6+sJYdx9RFDCt5IlYmgrSSY= -github.com/onflow/flow-go v0.44.0-experimental-cadence-v1.8.3.0.20251111112227-097f521427a5/go.mod h1:4A34mlMMd7usjw7e0r4VrltFpZRjhYkV+T+iecTbzO0= +github.com/onflow/flow-go v0.44.0 h1:I1P0t0+wUokyB4RHRLMGWy9QMf4jWg6EFcttKNtU0Rw= +github.com/onflow/flow-go v0.44.0/go.mod h1:4A34mlMMd7usjw7e0r4VrltFpZRjhYkV+T+iecTbzO0= github.com/onflow/flow-go-sdk v1.9.2 h1:kMw3qShgLNIASHGMgoY+faTBQ+1MnzsNLAH+oxy9eiY= github.com/onflow/flow-go-sdk v1.9.2/go.mod h1:qVuzMGXNJBMktKnIDKLjV0/k21P2XD39dOfMW+X5Bsc= github.com/onflow/flow-nft/lib/go/contracts v1.3.0 h1:DmNop+O0EMyicZvhgdWboFG57xz5t9Qp81FKlfKyqJc= diff --git a/services/requester/requester.go b/services/requester/requester.go index 328f710e..55c3440c 100644 --- a/services/requester/requester.go +++ b/services/requester/requester.go @@ -571,6 +571,7 @@ func (e *EVM) dryRunTx( from, to, tx.Data(), + tx.SetCodeAuthorizations(), tx.Value(), tx.Gas(), opts..., diff --git a/tests/go.mod b/tests/go.mod index 92f62a8a..ca63a0e5 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -7,9 +7,9 @@ require ( github.com/goccy/go-json v0.10.4 github.com/onflow/cadence v1.8.3 github.com/onflow/crypto v0.25.3 - github.com/onflow/flow-emulator v1.12.1-0.20251112150210-ab3ddcde0cdc + github.com/onflow/flow-emulator v1.13.1-0.20251120165439-67cc8cd69668 github.com/onflow/flow-evm-gateway v0.0.0-20240201154855-4d4d3d3f19c7 - github.com/onflow/flow-go v0.44.0-experimental-cadence-v1.8.3.0.20251111112227-097f521427a5 + github.com/onflow/flow-go v0.44.0 github.com/onflow/flow-go-sdk v1.9.2 github.com/rs/zerolog v1.34.0 github.com/stretchr/testify v1.11.1 diff --git a/tests/go.sum b/tests/go.sum index a7941e83..0442293c 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -812,16 +812,16 @@ github.com/onflow/flow-core-contracts/lib/go/contracts v1.9.2 h1:mkd1NSv74+OnCHw github.com/onflow/flow-core-contracts/lib/go/contracts v1.9.2/go.mod h1:jBDqVep0ICzhXky56YlyO4aiV2Jl/5r7wnqUPpvi7zE= github.com/onflow/flow-core-contracts/lib/go/templates v1.9.2 h1:semxeVLwC6xFG1G/7egUmaf7F1C8eBnc7NxNTVfBHTs= github.com/onflow/flow-core-contracts/lib/go/templates v1.9.2/go.mod h1:twSVyUt3rNrgzAmxtBX+1Gw64QlPemy17cyvnXYy1Ug= -github.com/onflow/flow-emulator v1.12.1-0.20251112150210-ab3ddcde0cdc h1:nNjfjEurFv00RqTanfjpGGCZdPkHyrLzH8UunLwUkbI= -github.com/onflow/flow-emulator v1.12.1-0.20251112150210-ab3ddcde0cdc/go.mod h1:clmz8n+gWjzcZwNBpElNY/W/SG7U628WGo6/x/9BhvI= +github.com/onflow/flow-emulator v1.13.1-0.20251120165439-67cc8cd69668 h1:040Xf/99mXVDfsuPxIoaiMTFlxW7fkMJ0gq3y8Hktlk= +github.com/onflow/flow-emulator v1.13.1-0.20251120165439-67cc8cd69668/go.mod h1:+MBvYoRM65uyW1+qLA324l4SB6FD3UTfFU/9caBm3W0= github.com/onflow/flow-evm-bridge v0.1.0 h1:7X2osvo4NnQgHj8aERUmbYtv9FateX8liotoLnPL9nM= github.com/onflow/flow-evm-bridge v0.1.0/go.mod h1:5UYwsnu6WcBNrwitGFxphCl5yq7fbWYGYuiCSTVF6pk= github.com/onflow/flow-ft/lib/go/contracts v1.0.1 h1:Ts5ob+CoCY2EjEd0W6vdLJ7hLL3SsEftzXG2JlmSe24= github.com/onflow/flow-ft/lib/go/contracts v1.0.1/go.mod h1:PwsL8fC81cjnUnTfmyL/HOIyHnyaw/JA474Wfj2tl6A= github.com/onflow/flow-ft/lib/go/templates v1.0.1 h1:FDYKAiGowABtoMNusLuRCILIZDtVqJ/5tYI4VkF5zfM= github.com/onflow/flow-ft/lib/go/templates v1.0.1/go.mod h1:uQ8XFqmMK2jxyBSVrmyuwdWjTEb+6zGjRYotfDJ5pAE= -github.com/onflow/flow-go v0.44.0-experimental-cadence-v1.8.3.0.20251111112227-097f521427a5 h1:L09sNOfqIHAWD90psYCl6+sJYdx9RFDCt5IlYmgrSSY= -github.com/onflow/flow-go v0.44.0-experimental-cadence-v1.8.3.0.20251111112227-097f521427a5/go.mod h1:4A34mlMMd7usjw7e0r4VrltFpZRjhYkV+T+iecTbzO0= +github.com/onflow/flow-go v0.44.0 h1:I1P0t0+wUokyB4RHRLMGWy9QMf4jWg6EFcttKNtU0Rw= +github.com/onflow/flow-go v0.44.0/go.mod h1:4A34mlMMd7usjw7e0r4VrltFpZRjhYkV+T+iecTbzO0= github.com/onflow/flow-go-sdk v1.9.2 h1:kMw3qShgLNIASHGMgoY+faTBQ+1MnzsNLAH+oxy9eiY= github.com/onflow/flow-go-sdk v1.9.2/go.mod h1:qVuzMGXNJBMktKnIDKLjV0/k21P2XD39dOfMW+X5Bsc= github.com/onflow/flow-nft/lib/go/contracts v1.3.0 h1:DmNop+O0EMyicZvhgdWboFG57xz5t9Qp81FKlfKyqJc= diff --git a/tests/web3js/eth_eip_7702_sending_transactions_test.js b/tests/web3js/eth_eip_7702_sending_transactions_test.js index 2d9e5b78..902a2dfd 100644 --- a/tests/web3js/eth_eip_7702_sending_transactions_test.js +++ b/tests/web3js/eth_eip_7702_sending_transactions_test.js @@ -3,6 +3,9 @@ const { encodeFunctionData } = require('viem') const { privateKeyToAccount } = require('viem/accounts') const { relay, walletClient, publicClient } = require('./viem/config') const { abi, bytecode } = require('./viem/contract') +const conf = require('./config') +const helpers = require('./helpers') +const web3 = conf.web3 // eoa is 0xfe847d8bebe46799FCE83eB52f38Ef4b907996A6 const eoa = privateKeyToAccount('0x3a0901a19a40f2041727fe1a973137ad917fc925ce716983e1376e927658b12e') @@ -46,6 +49,33 @@ it('should send transactions with relay account', async () => { contractAddress, }) + let txArgs = { + from: relay.address, + to: eoa.address, + data: encodeFunctionData({ + abi, + functionName: 'initialize', + }), + authorizationList: [ + { + address: authorization.address, + chainId: web3.utils.numberToHex(authorization.chainId), + nonce: web3.utils.numberToHex(authorization.nonce), + r: authorization.r, + s: authorization.s, + yParity: web3.utils.numberToHex(authorization.yParity) + } + ] + } + + let response = await helpers.callRPCMethod( + 'eth_estimateGas', + [txArgs, 'latest'] + ) + assert.equal(response.status, 200) + assert.isDefined(response.body) + assert.equal(web3.utils.hexToNumber(response.body.result), 63779n) + // 2. Designate the Contract on the EOA, and invoke the `initialize` function. let hash = await walletClient.sendTransaction({ authorizationList: [authorization], // 3. Pass the Authorization as a parameter. @@ -54,6 +84,7 @@ it('should send transactions with relay account', async () => { functionName: 'initialize', }), to: eoa.address, + gas: web3.utils.hexToNumber(response.body.result) }) await new Promise((res) => setTimeout(() => res(), 1500)) @@ -108,6 +139,33 @@ it('should send self-executing transactions', async () => { executor: 'self', }) + let txArgs = { + from: relay.address, + to: relay.address, + data: encodeFunctionData({ + abi, + functionName: 'initialize', + }), + authorizationList: [ + { + address: authorization.address, + chainId: web3.utils.numberToHex(authorization.chainId), + nonce: web3.utils.numberToHex(authorization.nonce), + r: authorization.r, + s: authorization.s, + yParity: web3.utils.numberToHex(authorization.yParity) + } + ] + } + + let response = await helpers.callRPCMethod( + 'eth_estimateGas', + [txArgs, 'latest'] + ) + assert.equal(response.status, 200) + assert.isDefined(response.body) + assert.equal(web3.utils.hexToNumber(response.body.result), 63779n) + // 2. Designate the Contract on the EOA, and invoke the `initialize` function. let hash = await walletClient.sendTransaction({ authorizationList: [authorization], // 3. Pass the Authorization as a parameter. @@ -115,7 +173,8 @@ it('should send self-executing transactions', async () => { abi, functionName: 'initialize', }), - to: walletClient.account.address, + to: relay.address, + gas: web3.utils.hexToNumber(response.body.result), }) await new Promise((res) => setTimeout(() => res(), 1500)) @@ -150,7 +209,7 @@ it('should send self-executing transactions', async () => { abi, functionName: 'ping', }), - to: walletClient.account.address, + to: relay.address, }) await new Promise((res) => setTimeout(() => res(), 1500)) diff --git a/tests/web3js/eth_pectra_upgrade_test.js b/tests/web3js/eth_pectra_upgrade_test.js index c34850eb..cd1258de 100644 --- a/tests/web3js/eth_pectra_upgrade_test.js +++ b/tests/web3js/eth_pectra_upgrade_test.js @@ -57,6 +57,7 @@ it('should not perform contract writes with relay account before Pectra', async address: eoa.address, authorizationList: [authorization], // 3. Pass the Authorization as a parameter. functionName: 'initialize', + gas: 63779n }) } catch (e) { errMsg = e.details