This repository was archived by the owner on Dec 16, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 277
test: convert warp npm test to go test #1907
Merged
michaelkaplan13
merged 88 commits into
master
from
JonathanOppenheimer/convert-warp-test
Dec 11, 2025
+1,095
−607
Merged
Changes from all commits
Commits
Show all changes
88 commits
Select commit
Hold shift + click to select a range
e7a0cc1
feat: convert tx allow list npm test to go test
JonathanOppenheimer 060eb2b
Merge branch 'master' into JonathanOppenheimer/convert-tx-allow-list-…
JonathanOppenheimer 169f6f3
chore: delete old example
JonathanOppenheimer 60110f8
feat: convert reward manager npm test to go test
JonathanOppenheimer b057b88
fix: contract formatting and import
JonathanOppenheimer a98b243
chore: delete old binding
JonathanOppenheimer fb29afb
chore: delete example contract
JonathanOppenheimer 4eef5e6
chore: lint
JonathanOppenheimer bb21931
test: add should not let non-enabled address submit txs
JonathanOppenheimer 8cfb75b
Merge branch 'master' into JonathanOppenheimer/convert-tx-allow-list-…
JonathanOppenheimer 1e0d2fe
style: ignore lint error for now
JonathanOppenheimer 1069395
test: add helper function for backend
JonathanOppenheimer 7a12f05
Merge branch 'master' into JonathanOppenheimer/convert-tx-allow-list-…
JonathanOppenheimer f519ccc
chore: lint
JonathanOppenheimer de4726e
Merge branch 'master' into JonathanOppenheimer/convert-tx-allow-list-…
JonathanOppenheimer a8d7ebd
Merge branch 'master' into JonathanOppenheimer/convert-reward-manager…
JonathanOppenheimer ab29c98
Merge branch 'master' into JonathanOppenheimer/convert-reward-manager…
JonathanOppenheimer 43ade2c
Merge branch 'master' into JonathanOppenheimer/convert-tx-allow-list-…
JonathanOppenheimer 78fd11d
Merge branch 'JonathanOppenheimer/convert-tx-allow-list-test' into Jo…
JonathanOppenheimer df3d4d1
chore: delete more deprecated code
JonathanOppenheimer 5e77010
test: use new structure
JonathanOppenheimer a135782
chore: delete vestigial CI
JonathanOppenheimer a7ea83e
chore: unused file
JonathanOppenheimer 997ce0f
test: restore task.ts
JonathanOppenheimer c82ccd7
fix: restore run_ginkgo.sh
JonathanOppenheimer 8540c62
chore: regenerate bindings
JonathanOppenheimer 63d4aaa
chore: reduce diff
JonathanOppenheimer 37a9e0d
chore: format
JonathanOppenheimer 284c1fc
chore: regenerate bindings
JonathanOppenheimer 3abde93
Merge branch 'master' into JonathanOppenheimer/convert-reward-manager…
JonathanOppenheimer 748ca1c
Update IAllowList.sol
JonathanOppenheimer d7f590e
docs: add comment explaining import replace
JonathanOppenheimer 72d5ebe
chore: regenerate bindings
JonathanOppenheimer 0804768
test: convert warp hardhat test to go
JonathanOppenheimer 6877bd8
reduce diff with master
ceyonur 650bd1d
further reduce diffs
ceyonur ddc92e7
further reduce diffs
ceyonur a024dc6
fix linter
ceyonur 9afb94c
fix
ceyonur 8d6af33
style: move tx function
JonathanOppenheimer aafb6db
test: use random key for reward address test
JonathanOppenheimer 07ab33f
test: through contract rather than interface
JonathanOppenheimer 5ea2a0d
revert extra change
ceyonur 8f146c6
test: add coinbase test
JonathanOppenheimer 755449b
Ceyonur/reduce diff reward manager tests (#1909)
JonathanOppenheimer 9ec5e25
Merge branch 'JonathanOppenheimer/convert-reward-manager-test' into J…
JonathanOppenheimer 31edb02
feat: warp bindings test
JonathanOppenheimer f9deda0
chore: revert util.ts deletion
JonathanOppenheimer 15729af
chore: move util.ts
JonathanOppenheimer e5631aa
chore: rename util -> utils
JonathanOppenheimer 36eca4a
fix: export only roles
JonathanOppenheimer 282f862
fix: verifyAndExtractWarpMessage()
JonathanOppenheimer 8725814
chore: lint
JonathanOppenheimer 8702753
Update precompile/contracts/testutils/simulated_helpers.go
JonathanOppenheimer 8859053
fix: don't export sendSimpleTx
JonathanOppenheimer 9177c3a
chore: consolidate NewBackendWithPrecompile
JonathanOppenheimer b2fbe9e
chore: lint
JonathanOppenheimer 64c71f8
chore: delete warp.json
JonathanOppenheimer ef7c953
Merge branch 'JonathanOppenheimer/convert-reward-manager-test' into J…
JonathanOppenheimer 97e182c
fix: revert delete warp.json
JonathanOppenheimer e85cc03
Merge branch 'master' into JonathanOppenheimer/convert-warp-test
JonathanOppenheimer 473405a
test: move interfaces to top level
JonathanOppenheimer 34023f3
chore: git track move
JonathanOppenheimer 607a237
chore: regenerate bindings
JonathanOppenheimer 6031f25
style: rename bindings test
JonathanOppenheimer e0c9b79
test: full warp bindings test
JonathanOppenheimer bf3ad0f
test: extract using bindings
JonathanOppenheimer 66ae1e8
style: set addressedCallUnsignedMessage directly
JonathanOppenheimer 2b2e3ff
chore: lint
JonathanOppenheimer ad6f6b9
chore: reduce diff
JonathanOppenheimer b11a074
style: add back blank line
JonathanOppenheimer 9701be7
Merge branch 'JonathanOppenheimer/move-interfaces' into JonathanOppen…
JonathanOppenheimer d2c7704
chore: move ExampleWarp.sol to where it is used
JonathanOppenheimer f8af497
style: restore blank line
JonathanOppenheimer 86ce37b
test: reuse verifyAndExtractWarpMessage helper
JonathanOppenheimer c2e0eb7
test: specify sender
JonathanOppenheimer 440840f
Merge branch 'master' into JonathanOppenheimer/convert-warp-test
JonathanOppenheimer 5e78e94
Update tests/warp/warp_test.go
JonathanOppenheimer 9016376
Update tests/warp/warp_test.go
JonathanOppenheimer dfec9d9
Update tests/warp/warp_test.go
JonathanOppenheimer e16d112
docs: expand verifyAndExtractWarpMessage function comment
JonathanOppenheimer e0f9532
Update tests/warp/warp_test.go
JonathanOppenheimer 12d27a8
chore: regenerate bindings
JonathanOppenheimer 9be0e67
refactor: make verifyAndExtractWarpMessage a static helper
JonathanOppenheimer 7a55db4
docs: add arran comment note
JonathanOppenheimer 20cd6be
chore: regenerate bindings
JonathanOppenheimer 5ab245f
Update precompile/contracts/warp/warptest/bindings/WarpTest.sol
JonathanOppenheimer daf8bc3
chore: regenerate bindings
JonathanOppenheimer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| export { test } from './test/utils'; | ||
| export { Roles } from './test/utils'; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| // SPDX-License-Identifier: MIT | ||
michaelkaplan13 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| pragma solidity ^0.8.24; | ||
|
|
||
| struct WarpMessage { | ||
| bytes32 sourceChainID; | ||
| address originSenderAddress; | ||
| bytes payload; | ||
| } | ||
|
|
||
| struct WarpBlockHash { | ||
| bytes32 sourceChainID; | ||
| bytes32 blockHash; | ||
| } | ||
|
|
||
| interface IWarpMessenger { | ||
| event SendWarpMessage( | ||
| address indexed sender, | ||
| bytes32 indexed messageID, | ||
| bytes message | ||
| ); | ||
|
|
||
| // sendWarpMessage emits a request for the subnet to send a warp message from [msg.sender] | ||
| // with the specified parameters. | ||
| // This emits a SendWarpMessage log from the precompile. When the corresponding block is accepted | ||
| // the Accept hook of the Warp precompile is invoked with all accepted logs emitted by the Warp | ||
| // precompile. | ||
| // Each validator then adds the UnsignedWarpMessage encoded in the log to the set of messages | ||
| // it is willing to sign for an off-chain relayer to aggregate Warp signatures. | ||
| function sendWarpMessage( | ||
| bytes calldata payload | ||
| ) external returns (bytes32 messageID); | ||
|
|
||
| // getVerifiedWarpMessage parses the pre-verified warp message in the | ||
| // predicate storage slots as a WarpMessage and returns it to the caller. | ||
| // If the message exists and passes verification, returns the verified message | ||
| // and true. | ||
| // Otherwise, returns false and the empty value for the message. | ||
| function getVerifiedWarpMessage( | ||
| uint32 index | ||
| ) external view returns (WarpMessage calldata message, bool valid); | ||
|
|
||
| // getVerifiedWarpBlockHash parses the pre-verified WarpBlockHash message in the | ||
| // predicate storage slots as a WarpBlockHash message and returns it to the caller. | ||
| // If the message exists and passes verification, returns the verified message | ||
| // and true. | ||
| // Otherwise, returns false and the empty value for the message. | ||
| function getVerifiedWarpBlockHash( | ||
| uint32 index | ||
| ) external view returns (WarpBlockHash calldata warpBlockHash, bool valid); | ||
|
|
||
| // getBlockchainID returns the snow.Context BlockchainID of this chain. | ||
| // This blockchainID is the hash of the transaction that created this blockchain on the P-Chain | ||
| // and is not related to the Ethereum ChainID. | ||
| function getBlockchainID() external view returns (bytes32 blockchainID); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| // Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. | ||
| // See the file LICENSE for licensing terms. | ||
|
|
||
| package warpbindings | ||
|
|
||
| // Step 1: Compile Solidity contract to generate ABI and bin files | ||
| //go:generate solc-v0.8.30 -o artifacts --overwrite --abi --bin --evm-version cancun IWarpMessenger.sol | ||
| // Step 2: Generate Go bindings from the compiled artifacts | ||
| //go:generate go run github.com/ava-labs/libevm/cmd/abigen --pkg warpbindings --type IWarpMessenger --abi artifacts/IWarpMessenger.abi --bin artifacts/IWarpMessenger.bin --out gen_iwarpmessenger_binding.go | ||
| // Step 3: Replace import paths in generated binding to use subnet-evm instead of libevm | ||
| // This is necessary because the libevm bindings package is not compatible with the subnet-evm simulated backend, which is used for testing. | ||
| //go:generate sh -c "sed -i.bak -e 's|github.com/ava-labs/libevm/accounts/abi|github.com/ava-labs/subnet-evm/accounts/abi|g' -e 's|github.com/ava-labs/libevm/accounts/abi/bind|github.com/ava-labs/subnet-evm/accounts/abi/bind|g' gen_iwarpmessenger_binding.go && rm -f gen_iwarpmessenger_binding.go.bak" |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.