Skip to content

Commit 9c69f5e

Browse files
committed
WIP
1 parent 742085b commit 9c69f5e

13 files changed

Lines changed: 81 additions & 53 deletions

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ require (
1313
github.com/holiman/uint256 v1.3.2
1414
github.com/onflow/atree v0.10.0
1515
github.com/onflow/cadence v1.7.0-preview.1
16-
github.com/onflow/flow-go v0.42.3-util-fix.0.20250819165158-ea886bab7c19
16+
github.com/onflow/flow-go v0.42.3-util-fix.0.20250905072050-dc2d576024e9
1717
github.com/onflow/flow-go-sdk v1.7.0
1818
github.com/prometheus/client_golang v1.20.5
1919
github.com/rs/cors v1.8.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,8 +573,8 @@ github.com/onflow/flow-ft/lib/go/contracts v1.0.1 h1:Ts5ob+CoCY2EjEd0W6vdLJ7hLL3
573573
github.com/onflow/flow-ft/lib/go/contracts v1.0.1/go.mod h1:PwsL8fC81cjnUnTfmyL/HOIyHnyaw/JA474Wfj2tl6A=
574574
github.com/onflow/flow-ft/lib/go/templates v1.0.1 h1:FDYKAiGowABtoMNusLuRCILIZDtVqJ/5tYI4VkF5zfM=
575575
github.com/onflow/flow-ft/lib/go/templates v1.0.1/go.mod h1:uQ8XFqmMK2jxyBSVrmyuwdWjTEb+6zGjRYotfDJ5pAE=
576-
github.com/onflow/flow-go v0.42.3-util-fix.0.20250819165158-ea886bab7c19 h1:LeUxtxxvdZ+JHNokfpo/GjEtjDeuSfcQhnMvGR0Y8Io=
577-
github.com/onflow/flow-go v0.42.3-util-fix.0.20250819165158-ea886bab7c19/go.mod h1:9j2eaUpjVt9RAt0Th5ewyoWmNMBfVmaG2FGykUvW/sw=
576+
github.com/onflow/flow-go v0.42.3-util-fix.0.20250905072050-dc2d576024e9 h1:rWsQ6Oh/gbZpUfIHg2THircETCOgUeAdbe6oY5xZMXE=
577+
github.com/onflow/flow-go v0.42.3-util-fix.0.20250905072050-dc2d576024e9/go.mod h1:9j2eaUpjVt9RAt0Th5ewyoWmNMBfVmaG2FGykUvW/sw=
578578
github.com/onflow/flow-go-sdk v1.7.0 h1:kSw94LZ+0ppt5ELqzixk7jjzkcrOR0Lh4mOgyu+KTOI=
579579
github.com/onflow/flow-go-sdk v1.7.0/go.mod h1:a5JyRWg1mT6MoixnjTl/E/6AO95u/r2BBy7U/CycvUM=
580580
github.com/onflow/flow-nft/lib/go/contracts v1.2.4 h1:gWJgSSgIGo0qWOqr90+khQ69VoYF9vNlqzF+Yh6YYy4=

tests/fixtures/storage.byte

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

tests/fixtures/storage.sol

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ contract Storage {
1111
error MyCustomError(uint value, string message);
1212

1313
uint256 number;
14+
address deployer;
1415

1516
constructor() payable {
1617
number = 1337;
18+
deployer = 0xea02F564664A477286B93712829180be4764fAe2;
1719
}
1820

1921
function store(uint256 num) public {
@@ -34,6 +36,10 @@ contract Storage {
3436
return number;
3537
}
3638

39+
function getDeployer() public view returns (address){
40+
return deployer;
41+
}
42+
3743
function sum(int A, int B) public returns (int) {
3844
int s = A+B;
3945
emit Calculated(msg.sender, A, B, s);

tests/fixtures/storageABI.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,19 @@
162162
"stateMutability": "nonpayable",
163163
"type": "function"
164164
},
165+
{
166+
"inputs": [],
167+
"name": "getDeployer",
168+
"outputs": [
169+
{
170+
"internalType": "address",
171+
"name": "",
172+
"type": "address"
173+
}
174+
],
175+
"stateMutability": "view",
176+
"type": "function"
177+
},
165178
{
166179
"inputs": [],
167180
"name": "random",

tests/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require (
1111
github.com/onflow/crypto v0.25.3
1212
github.com/onflow/flow-emulator v1.7.0-preview.2
1313
github.com/onflow/flow-evm-gateway v0.0.0-20240201154855-4d4d3d3f19c7
14-
github.com/onflow/flow-go v0.42.3-util-fix.0.20250819165158-ea886bab7c19
14+
github.com/onflow/flow-go v0.42.3-util-fix.0.20250905072050-dc2d576024e9
1515
github.com/onflow/flow-go-sdk v1.7.0
1616
github.com/rs/zerolog v1.33.0
1717
github.com/stretchr/testify v1.10.0

tests/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -829,8 +829,8 @@ github.com/onflow/flow-ft/lib/go/contracts v1.0.1 h1:Ts5ob+CoCY2EjEd0W6vdLJ7hLL3
829829
github.com/onflow/flow-ft/lib/go/contracts v1.0.1/go.mod h1:PwsL8fC81cjnUnTfmyL/HOIyHnyaw/JA474Wfj2tl6A=
830830
github.com/onflow/flow-ft/lib/go/templates v1.0.1 h1:FDYKAiGowABtoMNusLuRCILIZDtVqJ/5tYI4VkF5zfM=
831831
github.com/onflow/flow-ft/lib/go/templates v1.0.1/go.mod h1:uQ8XFqmMK2jxyBSVrmyuwdWjTEb+6zGjRYotfDJ5pAE=
832-
github.com/onflow/flow-go v0.42.3-util-fix.0.20250819165158-ea886bab7c19 h1:LeUxtxxvdZ+JHNokfpo/GjEtjDeuSfcQhnMvGR0Y8Io=
833-
github.com/onflow/flow-go v0.42.3-util-fix.0.20250819165158-ea886bab7c19/go.mod h1:9j2eaUpjVt9RAt0Th5ewyoWmNMBfVmaG2FGykUvW/sw=
832+
github.com/onflow/flow-go v0.42.3-util-fix.0.20250905072050-dc2d576024e9 h1:rWsQ6Oh/gbZpUfIHg2THircETCOgUeAdbe6oY5xZMXE=
833+
github.com/onflow/flow-go v0.42.3-util-fix.0.20250905072050-dc2d576024e9/go.mod h1:9j2eaUpjVt9RAt0Th5ewyoWmNMBfVmaG2FGykUvW/sw=
834834
github.com/onflow/flow-go-sdk v1.7.0 h1:kSw94LZ+0ppt5ELqzixk7jjzkcrOR0Lh4mOgyu+KTOI=
835835
github.com/onflow/flow-go-sdk v1.7.0/go.mod h1:a5JyRWg1mT6MoixnjTl/E/6AO95u/r2BBy7U/CycvUM=
836836
github.com/onflow/flow-nft/lib/go/contracts v1.2.4 h1:gWJgSSgIGo0qWOqr90+khQ69VoYF9vNlqzF+Yh6YYy4=

tests/web3js/build_evm_state_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ it('should handle a large number of EVM interactions', async () => {
172172
assert.equal(code, '0x')
173173

174174
code = await web3.eth.getCode(contractAddress, latest)
175-
assert.lengthOf(code, 9806)
175+
assert.lengthOf(code, 9968)
176176

177177
// Add calls to verify correctness of eth_call on historical heights
178178
let callRetrieve = deployed.contract.methods.retrieve().encodeABI()

tests/web3js/debug_traces_test.js

Lines changed: 34 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ it('should retrieve transaction traces', async () => {
2828

2929
// Assert proper response for `structLog`
3030
let txTrace = response.body.result
31-
assert.equal(txTrace.gas, 1130512)
31+
assert.equal(txTrace.gas, 1171555)
3232
assert.equal(txTrace.failed, false)
33-
assert.lengthOf(txTrace.returnValue, 9806n)
33+
assert.lengthOf(txTrace.returnValue, 9968n)
3434
assert.deepEqual(
3535
txTrace.structLogs[0],
3636
{
3737
pc: 0,
3838
op: 'PUSH1',
39-
gas: 1013648,
39+
gas: 1052352,
4040
gasCost: 3,
4141
depth: 1,
4242
stack: []
@@ -60,11 +60,11 @@ it('should retrieve transaction traces', async () => {
6060
// Assert proper response for `callTracer`
6161
txTrace = response.body.result
6262
assert.equal(txTrace.from, '0xfacf71692421039876a5bb4f10ef7a439d8ef61e')
63-
assert.equal(txTrace.gas, '0x1167ac')
64-
assert.equal(txTrace.gasUsed, '0x114010')
63+
assert.equal(txTrace.gas, '0x120944')
64+
assert.equal(txTrace.gasUsed, '0x11e063')
6565
assert.equal(txTrace.to, '0x99a64c993965f8d69f985b5171bc20065cc32fab')
66-
assert.lengthOf(txTrace.input, 9856n)
67-
assert.lengthOf(txTrace.output, 9806n)
66+
assert.lengthOf(txTrace.input, 10186n)
67+
assert.lengthOf(txTrace.output, 9968n)
6868
assert.isUndefined(txTrace.logs)
6969
assert.equal(txTrace.value, '0x0')
7070
assert.equal(txTrace.type, 'CREATE')
@@ -82,14 +82,22 @@ it('should retrieve transaction traces', async () => {
8282
assert.deepEqual(
8383
txTrace,
8484
{
85-
PUSH1: 2,
85+
PUSH1: 3,
8686
MSTORE: 1,
87-
PUSH2: 3,
88-
PUSH0: 3,
89-
DUP2: 1,
90-
SWAP1: 1,
91-
SSTORE: 1,
92-
POP: 1,
87+
PUSH2: 4,
88+
PUSH0: 4,
89+
DUP2: 3,
90+
SWAP1: 3,
91+
SSTORE: 2,
92+
POP: 2,
93+
PUSH20: 3,
94+
EXP: 1,
95+
SLOAD: 1,
96+
MUL: 2,
97+
NOT: 1,
98+
AND: 2,
99+
DUP4: 1,
100+
OR: 1,
93101
DUP1: 1,
94102
CODECOPY: 1,
95103
RETURN: 1
@@ -149,15 +157,15 @@ it('should retrieve transaction traces', async () => {
149157
)
150158
assert.deepEqual(
151159
txTrace.pre['0xfacf71692421039876a5bb4f10ef7a439d8ef61e'],
152-
{ balance: '0x456391823ad876a0', nonce: 1 }
160+
{ balance: '0x456391823a7a85fe', nonce: 1 }
153161
)
154162
assert.deepEqual(
155163
txTrace.post['0x0000000000000000000000030000000000000000'],
156164
{ balance: '0x4098ea' }
157165
)
158166
assert.deepEqual(
159167
txTrace.post['0xfacf71692421039876a5bb4f10ef7a439d8ef61e'],
160-
{ balance: '0x456391823a97ddb6', nonce: 2 }
168+
{ balance: '0x456391823a39ed14', nonce: 2 }
161169
)
162170

163171
response = await helpers.callRPCMethod(
@@ -402,8 +410,8 @@ it('should retrieve transaction traces', async () => {
402410
txTrace,
403411
{
404412
from: conf.eoa.address.toLowerCase(),
405-
gas: '0xb56b',
406-
gasUsed: '0x6147',
413+
gas: '0xb56a',
414+
gasUsed: '0x6146',
407415
to: contractAddress.toLowerCase(),
408416
input: '0xc550f90f',
409417
output: '0x0000000000000000000000000000000000000000000000000000000000000006',
@@ -526,7 +534,7 @@ it('should retrieve call traces', async () => {
526534
let callTrace = response.body.result
527535
assert.equal(callTrace.from, '0xfacf71692421039876a5bb4f10ef7a439d8ef61e')
528536
assert.equal(callTrace.gas, '0x75ab')
529-
assert.equal(callTrace.gasUsed, '0x5be0')
537+
assert.equal(callTrace.gasUsed, '0x5bdf')
530538
assert.equal(callTrace.to, '0x99a64c993965f8d69f985b5171bc20065cc32fab')
531539
assert.equal(callTrace.input, '0x2e64cec1')
532540
assert.equal(
@@ -561,7 +569,7 @@ it('should retrieve call traces', async () => {
561569
},
562570
pre: {
563571
'0xfacf71692421039876a5bb4f10ef7a439d8ef61e': {
564-
balance: '0x456391823a5ede1c',
572+
balance: '0x456391823a00ee10',
565573
nonce: 3
566574
}
567575
}
@@ -646,15 +654,15 @@ it('should retrieve call traces', async () => {
646654
PUSH1: 7,
647655
MSTORE: 2,
648656
CALLVALUE: 1,
649-
DUP1: 6,
657+
DUP1: 5,
650658
ISZERO: 1,
651659
PUSH2: 13,
652660
JUMPI: 5,
653661
JUMPDEST: 12,
654662
POP: 9,
655663
CALLDATASIZE: 1,
656664
LT: 1,
657-
PUSH0: 5,
665+
PUSH0: 6,
658666
CALLDATALOAD: 1,
659667
SHR: 1,
660668
PUSH4: 3,
@@ -699,7 +707,7 @@ it('should retrieve call traces', async () => {
699707
callTrace = response.body.result
700708
assert.equal(callTrace.from, '0xfacf71692421039876a5bb4f10ef7a439d8ef61e')
701709
assert.equal(callTrace.gas, '0x75ab')
702-
assert.equal(callTrace.gasUsed, '0x5be0')
710+
assert.equal(callTrace.gasUsed, '0x5bdf')
703711
assert.equal(callTrace.to, '0x99a64c993965f8d69f985b5171bc20065cc32fab')
704712
assert.equal(callTrace.input, '0x2e64cec1')
705713
assert.equal(
@@ -780,14 +788,14 @@ it('should retrieve call traces', async () => {
780788
{
781789
from: conf.eoa.address.toLowerCase(),
782790
gas: '0xcdd4',
783-
gasUsed: '0xb3ed',
791+
gasUsed: '0xb3ec',
784792
to: contractAddress.toLowerCase(),
785793
input: '0xc550f90f',
786794
output: '0x0000000000000000000000000000000000000000000000000000000000000007',
787795
calls: [
788796
{
789797
from: contractAddress.toLowerCase(),
790-
gas: '0x6d44',
798+
gas: '0x6d45',
791799
gasUsed: '0x52a8',
792800
to: '0x0000000000000000000000010000000000000001',
793801
input: '0x53e87d66',
@@ -827,7 +835,7 @@ it('should retrieve call traces', async () => {
827835
updateTrace = response.body.result
828836
assert.equal(updateTrace.from, '0xfacf71692421039876a5bb4f10ef7a439d8ef61e')
829837
assert.equal(updateTrace.gas, '0x95ab')
830-
assert.equal(updateTrace.gasUsed, '0x6094')
838+
assert.equal(updateTrace.gasUsed, '0x60a8')
831839
assert.equal(updateTrace.to, '0x99a64c993965f8d69f985b5171bc20065cc32fab')
832840
assert.equal(
833841
updateTrace.input,

tests/web3js/eth_deploy_contract_and_interact_test.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ it('deploy contract and interact', async () => {
1818
assert.equal(rcp.contractAddress, contractAddress)
1919
assert.equal(rcp.status, conf.successStatus)
2020
assert.isUndefined(rcp.to)
21-
assert.equal(rcp.gasUsed, 1130512n)
21+
assert.equal(rcp.gasUsed, 1171555n)
2222
assert.equal(rcp.gasUsed, rcp.cumulativeGasUsed)
2323

2424
// check if latest block contains the deploy results
@@ -233,27 +233,28 @@ it('deploy contract and interact', async () => {
233233
},
234234
'latest'
235235
)
236-
assert.equal(gasEstimate, 25052n)
236+
assert.equal(gasEstimate, 25072n)
237237

238238
// check that `eth_call` can handle state overrides
239239
let stateOverrides = {
240240
[contractAddress]: {
241-
stateDiff: {
241+
state: {
242242
'0x0000000000000000000000000000000000000000000000000000000000000000': '0x00000000000000000000000000000000000000000000000000000000000003e8'
243243
}
244244
}
245245
}
246+
let callGetDeployer = deployed.contract.methods.getDeployer().encodeABI()
246247
let response = await helpers.callRPCMethod(
247248
'eth_call',
248-
[{ to: contractAddress, data: callRetrieve }, 'latest', stateOverrides]
249+
[{ to: contractAddress, data: callGetDeployer }, 'latest', stateOverrides]
249250
)
250251
assert.equal(response.status, 200)
251252
assert.isDefined(response.body)
252253

253254
result = response.body.result
254255
assert.equal(
255256
result,
256-
'0x00000000000000000000000000000000000000000000000000000000000003e8'
257+
'0x0000000000000000000000000000000000000000000000000000000000000000'
257258
)
258259

259260
// check that `eth_estimateGas` can handle state overrides

0 commit comments

Comments
 (0)