Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ require (
github.com/goccy/go-json v0.10.2
github.com/hashicorp/go-multierror v1.1.1
github.com/onflow/atree v0.9.0
github.com/onflow/cadence v1.3.1
github.com/onflow/flow-go v0.38.1-0.20250218174738-2181389f9f7d
github.com/onflow/flow-go-sdk v1.3.1
github.com/onflow/cadence v1.3.3
github.com/onflow/flow-go v0.39.3-unsafe-cdp.0.0.20250310185932-da0779039232
github.com/onflow/flow-go-sdk v1.3.3
github.com/onflow/go-ethereum v1.14.7
github.com/prometheus/client_golang v1.20.5
github.com/rs/cors v1.8.0
Expand Down Expand Up @@ -141,13 +141,13 @@ require (
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/onflow/crypto v0.25.2 // indirect
github.com/onflow/flow-core-contracts/lib/go/contracts v1.5.1-preview // indirect
github.com/onflow/flow-core-contracts/lib/go/templates v1.5.1-preview // indirect
github.com/onflow/flow-core-contracts/lib/go/contracts v1.6.0 // indirect
github.com/onflow/flow-core-contracts/lib/go/templates v1.6.0 // indirect
github.com/onflow/flow-ft/lib/go/contracts v1.0.1 // indirect
github.com/onflow/flow-ft/lib/go/templates v1.0.1 // indirect
github.com/onflow/flow-nft/lib/go/contracts v1.2.3 // indirect
github.com/onflow/flow-nft/lib/go/templates v1.2.1 // indirect
github.com/onflow/flow/protobuf/go/flow v0.4.9 // indirect
github.com/onflow/flow/protobuf/go/flow v0.4.10 // indirect
github.com/onflow/sdks v0.6.0-preview.1 // indirect
github.com/onsi/ginkgo v1.16.4 // indirect
github.com/onsi/gomega v1.18.1 // indirect
Expand Down
27 changes: 12 additions & 15 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -353,10 +353,7 @@ github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWS
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 h1:Iju5GlWwrvL6UBg4zJJt3btmonfrMlCDdsejg4CZE7c=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0 h1:pRhl55Yx1eC7BZ1N+BBWwnKaMyD8uC+34TLdndZMAKk=
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0/go.mod h1:XKMd7iuf/RGPSMJ/U4HP0zS2Z9Fh8Ps9a+6X26m/tmI=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjwqUPTYmYuemVOx+Ys=
Expand Down Expand Up @@ -569,28 +566,28 @@ github.com/onflow/atree v0.9.0 h1:M+Z/UPwzv0/Yy7ChI5T1ZIHD3YN1cs/hxGEs/HWhzaY=
github.com/onflow/atree v0.9.0/go.mod h1:FT6udJF9Q7VQTu3wknDhFX+VV4D44ZGdqtTAE5iztck=
github.com/onflow/bridged-usdc/lib/go/contracts v1.0.0 h1:ofdfKH8KgY6qVFnlngTontds/IBERANeWl0PBPCtPOA=
github.com/onflow/bridged-usdc/lib/go/contracts v1.0.0/go.mod h1:K4/oaEhhnSuJ9q6fpq1w9WEWRGtkNskhmoyH8t+X9Mk=
github.com/onflow/cadence v1.3.1 h1:bs9TFHQy8HHbwTtCtg5cLdyndWhmwq55RSwID1cb220=
github.com/onflow/cadence v1.3.1/go.mod h1:6/47FljVAdl3/31tShI8JOJW0sXYZHK1PwXkE+yk0qA=
github.com/onflow/cadence v1.3.3 h1:h9uyhqfiiBahk0P7JHQ1XR5b42wOGRIn+fNRd3JppYs=
github.com/onflow/cadence v1.3.3/go.mod h1:6/47FljVAdl3/31tShI8JOJW0sXYZHK1PwXkE+yk0qA=
github.com/onflow/crypto v0.25.2 h1:GjHunqVt+vPcdqhxxhAXiMIF3YiLX7gTuTR5O+VG2ns=
github.com/onflow/crypto v0.25.2/go.mod h1:fY7eLqUdMKV8EGOw301unP8h7PvLVy8/6gVR++/g0BY=
github.com/onflow/flow-core-contracts/lib/go/contracts v1.5.1-preview h1:W+QkNQcIbhtR+zXVROKq0bdDEnvzUfUrQrCmegmwzvc=
github.com/onflow/flow-core-contracts/lib/go/contracts v1.5.1-preview/go.mod h1:LyCICUK6sK1jtEyb+3GuRw5tYfHT1uxACLwLTLxw/0I=
github.com/onflow/flow-core-contracts/lib/go/templates v1.5.1-preview h1:C0PraQFfwpav4nJAf/RPE9BJyYD6lUMvt+cJyiMDeis=
github.com/onflow/flow-core-contracts/lib/go/templates v1.5.1-preview/go.mod h1:pN768Al/wLRlf3bwugv9TyxniqJxMu4sxnX9eQJam64=
github.com/onflow/flow-core-contracts/lib/go/contracts v1.6.0 h1:zbJaqR3bHicNz68YFJ/6gieUkxnMYz8dKxQrUUCc+/M=
github.com/onflow/flow-core-contracts/lib/go/contracts v1.6.0/go.mod h1:ufT77Epq1gfXAHQQk13WcAHWEv+Aarecn5PMnljWJ1A=
github.com/onflow/flow-core-contracts/lib/go/templates v1.6.0 h1:hVlyGbZ+gkeX0mTxTC4D65HulJCUbbVFgOvVWdMfRI8=
github.com/onflow/flow-core-contracts/lib/go/templates v1.6.0/go.mod h1:pN768Al/wLRlf3bwugv9TyxniqJxMu4sxnX9eQJam64=
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.38.1-0.20250218174738-2181389f9f7d h1:XRefc4rcBjGDEqsj3OB6XjSjSeYwMtysl7jmaLYpg+s=
github.com/onflow/flow-go v0.38.1-0.20250218174738-2181389f9f7d/go.mod h1:VS7MlNHZeDrGm9/jkuMCSvAQTLFXpzQD0BIMB8/QYB8=
github.com/onflow/flow-go-sdk v1.3.1 h1:2YdTL/R1/DjMYYmyKgArTeQ93GKvLlfCeCpMVH7b8q4=
github.com/onflow/flow-go-sdk v1.3.1/go.mod h1:0rMuCLShdX9F4pLBCPhlMGCFu8gu9SfiXT/Lc9qAi24=
github.com/onflow/flow-go v0.39.3-unsafe-cdp.0.0.20250310185932-da0779039232 h1:+IB58xC+XNdi1O06eDwbfpWS+TTKYXAusoicl3xP1Tw=
github.com/onflow/flow-go v0.39.3-unsafe-cdp.0.0.20250310185932-da0779039232/go.mod h1:2803MDj6lkXyz+N4EmfeMEyH+bOT3SGfb6h6jAqis68=
github.com/onflow/flow-go-sdk v1.3.3 h1:wj7llql3wesQYBePh3lEFI+jk3Df1sa13bRsL139JDo=
github.com/onflow/flow-go-sdk v1.3.3/go.mod h1:tSLvYIac9DlmUEqKHSHbVRyv4mSB0va4AuiV3XB9ENc=
github.com/onflow/flow-nft/lib/go/contracts v1.2.3 h1:4ju20g1xgDKWBT63rOj5f/Sa4Lc+naCSWT4p31x9yQk=
github.com/onflow/flow-nft/lib/go/contracts v1.2.3/go.mod h1:eZ9VMMNfCq0ho6kV25xJn1kXeCfxnkhj3MwF3ed08gY=
github.com/onflow/flow-nft/lib/go/templates v1.2.1 h1:SAALMZPDw9Eb9p5kSLnmnFxjyig1MLiT4JUlLp0/bSE=
github.com/onflow/flow-nft/lib/go/templates v1.2.1/go.mod h1:W6hOWU0xltPqNpv9gQX8Pj8Jtf0OmRxc1XX2V0kzJaI=
github.com/onflow/flow/protobuf/go/flow v0.4.9 h1:UfsWWqj6VQbEHvaw8kSGvIawCpEfz3gOGZfcdugNxVE=
github.com/onflow/flow/protobuf/go/flow v0.4.9/go.mod h1:NA2pX2nw8zuaxfKphhKsk00kWLwfd+tv8mS23YXO4Sk=
github.com/onflow/flow/protobuf/go/flow v0.4.10 h1:CGEO3n96XZQd/k5HtkZyb90ouem9G+8fNcKyt8s2fvs=
github.com/onflow/flow/protobuf/go/flow v0.4.10/go.mod h1:NA2pX2nw8zuaxfKphhKsk00kWLwfd+tv8mS23YXO4Sk=
github.com/onflow/go-ethereum v1.14.7 h1:gg3awYqI02e3AypRdpJKEvNTJ6kz/OhAqRti0h54Wlc=
github.com/onflow/go-ethereum v1.14.7/go.mod h1:zV14QLrXyYu5ucvcwHUA0r6UaqveqbXaehAVQJlSW+I=
github.com/onflow/nft-storefront/lib/go/contracts v1.0.0 h1:sxyWLqGm/p4EKT6DUlQESDG1ZNMN9GjPCm1gTq7NGfc=
Expand Down
109 changes: 109 additions & 0 deletions tests/e2e_web3js_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,115 @@ func TestWeb3_E2E(t *testing.T) {
})
})

t.Run("test EVM.dryCall & COA.dryCall", func(t *testing.T) {
runWeb3TestWithSetup(t, "evm_dry_call_test", func(emu emulator.Emulator) {
contractCode, err := hex.DecodeString(storageByteCode)
require.NoError(t, err)
storageContract := testutils.TestContract{
ByteCode: contractCode,
ABI: storageABI,
}

// create test account for contract deployment and contract calls
nonce := uint64(0)
accountKey, err := crypto.HexToECDSA("f6d5333177711e562cabf1f311916196ee6ffc2a07966d9d4628094073bd5442")
require.NoError(t, err)

// contract deployment transaction
deployPayload, _, err := evmSign(big.NewInt(0), 1_250_000, accountKey, nonce, nil, contractCode)
require.NoError(t, err)
nonce += 1

// contract call transaction (store)
contractAddress := common.HexToAddress("99a64c993965f8d69f985b5171bc20065cc32fab")
callData := storageContract.MakeCallData(t, "storeWithLog", big.NewInt(42))
callPayload, _, err := evmSign(big.NewInt(0), 55_000, accountKey, nonce, &contractAddress, callData)
require.NoError(t, err)
nonce += 1
payloads := [][]byte{deployPayload, callPayload}

const batchSize = 2
encodedTxs := make([]cadence.Value, batchSize)
for i := range encodedTxs {
tx, err := cadence.NewString(hex.EncodeToString(payloads[i]))
require.NoError(t, err)

encodedTxs[i] = tx
}

res, err := flowSendTransaction(
emu,
`transaction(encodedTxs: [String]) {
prepare(signer: auth(Storage) &Account) {
var txs: [[UInt8]] = []
for enc in encodedTxs {
txs.append(enc.decodeHex())
}

let txResults = EVM.batchRun(
txs: txs,
coinbase: EVM.EVMAddress(bytes: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19])
)
for txResult in txResults {
assert(
txResult.status == EVM.Status.successful,
message: txResult.errorCode.toString()
)
}

var callResult = EVM.dryCall(
from: EVM.addressFromString("0xFACF71692421039876a5BB4F10EF7A439D8ef61E"),
to: EVM.addressFromString("0x99a64c993965f8d69f985b5171bc20065cc32fab"),
data: EVM.encodeABIWithSignature("storeWithLog(uint256)", [UInt256(1453)]),
gasLimit: 30000,
value: EVM.Balance(attoflow: 0)
)
assert(callResult.status == EVM.Status.successful)

callResult = EVM.dryCall(
from: EVM.addressFromString("0xFACF71692421039876a5BB4F10EF7A439D8ef61E"),
to: EVM.addressFromString("0x99a64c993965f8d69f985b5171bc20065cc32fab"),
data: EVM.encodeABIWithSignature("retrieve()", []),
gasLimit: 30000,
value: EVM.Balance(attoflow: 0)
)
assert(callResult.status == EVM.Status.successful)
var returnData = EVM.decodeABI(types: [Type<UInt256>()], data: callResult.data)
// assert that the above EVM.dryCall with storeWithLog(1453), had no
// effect on the contract's state.
assert(returnData[0] as! UInt256 == 42)

let coa <- EVM.createCadenceOwnedAccount()
callResult = coa.dryCall(
to: EVM.addressFromString("0x99a64c993965f8d69f985b5171bc20065cc32fab"),
data: EVM.encodeABIWithSignature("storeWithLog(uint256)", [UInt256(1515)]),
gasLimit: 30000,
value: EVM.Balance(attoflow: 0)
)
assert(callResult.status == EVM.Status.successful)

callResult = coa.dryCall(
to: EVM.addressFromString("0x99a64c993965f8d69f985b5171bc20065cc32fab"),
data: EVM.encodeABIWithSignature("retrieve()", []),
gasLimit: 30000,
value: EVM.Balance(attoflow: 0)
)
assert(callResult.status == EVM.Status.successful)
returnData = EVM.decodeABI(types: [Type<UInt256>()], data: callResult.data)
// assert that the above coa.dryCall with storeWithLog(1515), had no
// effect on the contract's state.
assert(returnData[0] as! UInt256 == 42)

destroy <- coa
}
}`,
cadence.NewArray(encodedTxs),
)
require.NoError(t, err)
require.NoError(t, res.Error)
})
})

t.Run("streaming of entities and subscription", func(t *testing.T) {
runWeb3Test(t, "eth_streaming_test")
})
Expand Down
14 changes: 7 additions & 7 deletions tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ go 1.23

require (
github.com/goccy/go-json v0.10.2
github.com/onflow/cadence v1.3.1
github.com/onflow/cadence v1.3.3
github.com/onflow/crypto v0.25.2
github.com/onflow/flow-emulator v1.2.1-0.20250219181005-4205d790a414
github.com/onflow/flow-emulator v1.2.1-0.20250314224016-04620ca53b38
github.com/onflow/flow-evm-gateway v0.0.0-20240201154855-4d4d3d3f19c7
github.com/onflow/flow-go v0.38.1-0.20250218174738-2181389f9f7d
github.com/onflow/flow-go-sdk v1.3.1
github.com/onflow/flow-go v0.39.3-unsafe-cdp.0.0.20250310185932-da0779039232
github.com/onflow/flow-go-sdk v1.3.3
github.com/onflow/go-ethereum v1.14.7
github.com/rs/zerolog v1.33.0
github.com/stretchr/testify v1.10.0
Expand Down Expand Up @@ -151,13 +151,13 @@ require (
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/onflow/atree v0.9.0 // indirect
github.com/onflow/bridged-usdc/lib/go/contracts v1.0.0 // indirect
github.com/onflow/flow-core-contracts/lib/go/contracts v1.5.1-preview // indirect
github.com/onflow/flow-core-contracts/lib/go/templates v1.5.1-preview // indirect
github.com/onflow/flow-core-contracts/lib/go/contracts v1.6.0 // indirect
github.com/onflow/flow-core-contracts/lib/go/templates v1.6.0 // indirect
github.com/onflow/flow-ft/lib/go/contracts v1.0.1 // indirect
github.com/onflow/flow-ft/lib/go/templates v1.0.1 // indirect
github.com/onflow/flow-nft/lib/go/contracts v1.2.3 // indirect
github.com/onflow/flow-nft/lib/go/templates v1.2.1 // indirect
github.com/onflow/flow/protobuf/go/flow v0.4.9 // indirect
github.com/onflow/flow/protobuf/go/flow v0.4.10 // indirect
github.com/onflow/nft-storefront/lib/go/contracts v1.0.0 // indirect
github.com/onflow/sdks v0.6.0-preview.1 // indirect
github.com/onflow/wal v1.0.2 // indirect
Expand Down
28 changes: 14 additions & 14 deletions tests/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -790,30 +790,30 @@ github.com/onflow/atree v0.9.0 h1:M+Z/UPwzv0/Yy7ChI5T1ZIHD3YN1cs/hxGEs/HWhzaY=
github.com/onflow/atree v0.9.0/go.mod h1:FT6udJF9Q7VQTu3wknDhFX+VV4D44ZGdqtTAE5iztck=
github.com/onflow/bridged-usdc/lib/go/contracts v1.0.0 h1:ofdfKH8KgY6qVFnlngTontds/IBERANeWl0PBPCtPOA=
github.com/onflow/bridged-usdc/lib/go/contracts v1.0.0/go.mod h1:K4/oaEhhnSuJ9q6fpq1w9WEWRGtkNskhmoyH8t+X9Mk=
github.com/onflow/cadence v1.3.1 h1:bs9TFHQy8HHbwTtCtg5cLdyndWhmwq55RSwID1cb220=
github.com/onflow/cadence v1.3.1/go.mod h1:6/47FljVAdl3/31tShI8JOJW0sXYZHK1PwXkE+yk0qA=
github.com/onflow/cadence v1.3.3 h1:h9uyhqfiiBahk0P7JHQ1XR5b42wOGRIn+fNRd3JppYs=
github.com/onflow/cadence v1.3.3/go.mod h1:6/47FljVAdl3/31tShI8JOJW0sXYZHK1PwXkE+yk0qA=
github.com/onflow/crypto v0.25.2 h1:GjHunqVt+vPcdqhxxhAXiMIF3YiLX7gTuTR5O+VG2ns=
github.com/onflow/crypto v0.25.2/go.mod h1:fY7eLqUdMKV8EGOw301unP8h7PvLVy8/6gVR++/g0BY=
github.com/onflow/flow-core-contracts/lib/go/contracts v1.5.1-preview h1:W+QkNQcIbhtR+zXVROKq0bdDEnvzUfUrQrCmegmwzvc=
github.com/onflow/flow-core-contracts/lib/go/contracts v1.5.1-preview/go.mod h1:LyCICUK6sK1jtEyb+3GuRw5tYfHT1uxACLwLTLxw/0I=
github.com/onflow/flow-core-contracts/lib/go/templates v1.5.1-preview h1:C0PraQFfwpav4nJAf/RPE9BJyYD6lUMvt+cJyiMDeis=
github.com/onflow/flow-core-contracts/lib/go/templates v1.5.1-preview/go.mod h1:pN768Al/wLRlf3bwugv9TyxniqJxMu4sxnX9eQJam64=
github.com/onflow/flow-emulator v1.2.1-0.20250219181005-4205d790a414 h1:BqtG980BxX/bY9Bpq1uFm9q1pTvlK2r6nzeXpTyS5TU=
github.com/onflow/flow-emulator v1.2.1-0.20250219181005-4205d790a414/go.mod h1:+RV5j5TYEE0VYtUAEn/vduecy8yK8P+rB+a9BCc3gQA=
github.com/onflow/flow-core-contracts/lib/go/contracts v1.6.0 h1:zbJaqR3bHicNz68YFJ/6gieUkxnMYz8dKxQrUUCc+/M=
github.com/onflow/flow-core-contracts/lib/go/contracts v1.6.0/go.mod h1:ufT77Epq1gfXAHQQk13WcAHWEv+Aarecn5PMnljWJ1A=
github.com/onflow/flow-core-contracts/lib/go/templates v1.6.0 h1:hVlyGbZ+gkeX0mTxTC4D65HulJCUbbVFgOvVWdMfRI8=
github.com/onflow/flow-core-contracts/lib/go/templates v1.6.0/go.mod h1:pN768Al/wLRlf3bwugv9TyxniqJxMu4sxnX9eQJam64=
github.com/onflow/flow-emulator v1.2.1-0.20250314224016-04620ca53b38 h1:B6qqvBPK+0f0cXkn32eaZkZkmi1KGs6codYAPht7CN4=
github.com/onflow/flow-emulator v1.2.1-0.20250314224016-04620ca53b38/go.mod h1:UDdaUBoBMysFdeyKuJbDbyaRnss9NnegwIUtZ0PbgEo=
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.38.1-0.20250218174738-2181389f9f7d h1:XRefc4rcBjGDEqsj3OB6XjSjSeYwMtysl7jmaLYpg+s=
github.com/onflow/flow-go v0.38.1-0.20250218174738-2181389f9f7d/go.mod h1:VS7MlNHZeDrGm9/jkuMCSvAQTLFXpzQD0BIMB8/QYB8=
github.com/onflow/flow-go-sdk v1.3.1 h1:2YdTL/R1/DjMYYmyKgArTeQ93GKvLlfCeCpMVH7b8q4=
github.com/onflow/flow-go-sdk v1.3.1/go.mod h1:0rMuCLShdX9F4pLBCPhlMGCFu8gu9SfiXT/Lc9qAi24=
github.com/onflow/flow-go v0.39.3-unsafe-cdp.0.0.20250310185932-da0779039232 h1:+IB58xC+XNdi1O06eDwbfpWS+TTKYXAusoicl3xP1Tw=
github.com/onflow/flow-go v0.39.3-unsafe-cdp.0.0.20250310185932-da0779039232/go.mod h1:2803MDj6lkXyz+N4EmfeMEyH+bOT3SGfb6h6jAqis68=
github.com/onflow/flow-go-sdk v1.3.3 h1:wj7llql3wesQYBePh3lEFI+jk3Df1sa13bRsL139JDo=
github.com/onflow/flow-go-sdk v1.3.3/go.mod h1:tSLvYIac9DlmUEqKHSHbVRyv4mSB0va4AuiV3XB9ENc=
github.com/onflow/flow-nft/lib/go/contracts v1.2.3 h1:4ju20g1xgDKWBT63rOj5f/Sa4Lc+naCSWT4p31x9yQk=
github.com/onflow/flow-nft/lib/go/contracts v1.2.3/go.mod h1:eZ9VMMNfCq0ho6kV25xJn1kXeCfxnkhj3MwF3ed08gY=
github.com/onflow/flow-nft/lib/go/templates v1.2.1 h1:SAALMZPDw9Eb9p5kSLnmnFxjyig1MLiT4JUlLp0/bSE=
github.com/onflow/flow-nft/lib/go/templates v1.2.1/go.mod h1:W6hOWU0xltPqNpv9gQX8Pj8Jtf0OmRxc1XX2V0kzJaI=
github.com/onflow/flow/protobuf/go/flow v0.4.9 h1:UfsWWqj6VQbEHvaw8kSGvIawCpEfz3gOGZfcdugNxVE=
github.com/onflow/flow/protobuf/go/flow v0.4.9/go.mod h1:NA2pX2nw8zuaxfKphhKsk00kWLwfd+tv8mS23YXO4Sk=
github.com/onflow/flow/protobuf/go/flow v0.4.10 h1:CGEO3n96XZQd/k5HtkZyb90ouem9G+8fNcKyt8s2fvs=
github.com/onflow/flow/protobuf/go/flow v0.4.10/go.mod h1:NA2pX2nw8zuaxfKphhKsk00kWLwfd+tv8mS23YXO4Sk=
github.com/onflow/go-ethereum v1.14.7 h1:gg3awYqI02e3AypRdpJKEvNTJ6kz/OhAqRti0h54Wlc=
github.com/onflow/go-ethereum v1.14.7/go.mod h1:zV14QLrXyYu5ucvcwHUA0r6UaqveqbXaehAVQJlSW+I=
github.com/onflow/nft-storefront/lib/go/contracts v1.0.0 h1:sxyWLqGm/p4EKT6DUlQESDG1ZNMN9GjPCm1gTq7NGfc=
Expand Down
57 changes: 57 additions & 0 deletions tests/web3js/evm_dry_call_test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
const { assert } = require('chai')
const conf = require('./config')
const web3 = conf.web3

it('should not contain transactions from EVM.dryCall & COA.dryCall', async () => {
// this test relies on the setup of 'test EVM.dryCall & COA.dryCall'
// found in ../e2e_web3js_test.go

let latestHeight = await web3.eth.getBlockNumber()
let block = await web3.eth.getBlock(latestHeight)

assert.lengthOf(block.transactions, 3)

// First transaction is the Storage contract deployment
let tx = await web3.eth.getTransactionFromBlock(latestHeight, 0)
let receipt = await web3.eth.getTransactionReceipt(tx.hash)
assert.equal(receipt.contractAddress, '0x99A64c993965f8d69F985b5171bC20065Cc32fAB')

// Second transaction is the Storage.storeWithLog(42) contract call
tx = await web3.eth.getTransactionFromBlock(latestHeight, 1)
receipt = await web3.eth.getTransactionReceipt(tx.hash)
assert.equal(receipt.to, '0x99A64c993965f8d69F985b5171bC20065Cc32fAB')
assert.equal(
receipt.logs[0].topics[2],
'0x000000000000000000000000000000000000000000000000000000000000002a'
)

// Third transaction is the creation of a COA
tx = await web3.eth.getTransactionFromBlock(latestHeight, 2)
receipt = await web3.eth.getTransactionReceipt(tx.hash)
assert.equal(receipt.from, '0x0000000000000000000000020000000000000000')

let logs = await web3.eth.getPastLogs({
fromBlock: block.number,
toBlock: block.number
})
assert.deepEqual(
logs,
[
{
address: '0x99a64c993965f8d69f985b5171bc20065cc32fab',
topics: [
'0x043cc306157a91d747b36aba0e235bbbc5771d75aba162f6e5540767d22673c6',
'0x000000000000000000000000facf71692421039876a5bb4f10ef7a439d8ef61e',
'0x000000000000000000000000000000000000000000000000000000000000002a'
],
data: '0x',
blockNumber: 4n,
transactionHash: '0x096b843b983df3a10ed57e260d1e8858c9d768eb607e1baa5525a1e20a757b3d',
transactionIndex: 1n,
blockHash: block.hash,
logIndex: 0n,
removed: false
}
]
)
})