Skip to content

Commit

Permalink
Merge branch 'develop' into v17/remove-deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
lumtis authored May 18, 2024
2 parents d41fd86 + cca3253 commit f61f1a7
Show file tree
Hide file tree
Showing 57 changed files with 3,422 additions and 1,710 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
### Tests

* [2047](https://github.com/zeta-chain/node/pull/2047) - fix liquidity cap advanced test
* [2181](https://github.com/zeta-chain/node/pull/2181) - add more assertion and test cases in ZEVM message passing E2E tests
* [2184](https://github.com/zeta-chain/node/pull/2184) - add tx priority checks to e2e tests

### Fixes
Expand Down
17 changes: 10 additions & 7 deletions cmd/zetae2e/local/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"path/filepath"
"time"

"golang.org/x/sync/errgroup"

"github.com/fatih/color"
"github.com/spf13/cobra"
zetae2econfig "github.com/zeta-chain/zetacore/cmd/zetae2e/config"
Expand All @@ -15,7 +17,6 @@ import (
"github.com/zeta-chain/zetacore/e2e/utils"
"github.com/zeta-chain/zetacore/pkg/chains"
crosschaintypes "github.com/zeta-chain/zetacore/x/crosschain/types"
"golang.org/x/sync/errgroup"
)

const (
Expand Down Expand Up @@ -246,10 +247,10 @@ func localE2ETest(cmd *cobra.Command, _ []string) {
// run tests
var eg errgroup.Group
if !skipRegular {
// defines all tests, if light is enabled, only the most basic tests are run
// defines all tests, if light is enabled, only the most basic tests are run and advanced are skipped
erc20Tests := []string{
e2etests.TestERC20WithdrawName,
e2etests.TestMultipleWithdrawsName,
e2etests.TestMultipleERC20WithdrawsName,
e2etests.TestERC20DepositAndCallRefundName,
e2etests.TestZRC20SwapName,
}
Expand All @@ -258,16 +259,18 @@ func localE2ETest(cmd *cobra.Command, _ []string) {
}
zetaTests := []string{
e2etests.TestZetaWithdrawName,
e2etests.TestMessagePassingName,
e2etests.TestMessagePassingRevertFailName,
e2etests.TestMessagePassingRevertSuccessName,
e2etests.TestMessagePassingExternalChainsName,
e2etests.TestMessagePassingRevertFailExternalChainsName,
e2etests.TestMessagePassingRevertSuccessExternalChainsName,
}
zetaAdvancedTests := []string{
e2etests.TestZetaDepositRestrictedName,
e2etests.TestMessagePassingZEVMToEVMName,
e2etests.TestMessagePassingEVMtoZEVMName,
e2etests.TestMessagePassingEVMtoZEVMRevertName,
e2etests.TestMessagePassingZEVMtoEVMRevertName,
e2etests.TestMessagePassingZEVMtoEVMRevertFailName,
e2etests.TestMessagePassingEVMtoZEVMRevertFailName,
e2etests.TestZetaDepositName,
e2etests.TestZetaDepositNewAddressName,
}
Expand All @@ -288,7 +291,7 @@ func localE2ETest(cmd *cobra.Command, _ []string) {
e2etests.TestEtherWithdrawName,
e2etests.TestContextUpgradeName,
e2etests.TestEtherDepositAndCallName,
e2etests.TestDepositAndCallRefundName,
e2etests.TestEtherDepositAndCallRefundName,
}
ethereumAdvancedTests := []string{
e2etests.TestEtherWithdrawRestrictedName,
Expand Down
8 changes: 6 additions & 2 deletions contrib/localnet/scripts/start-zetacored.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,12 @@ then

# set governance parameters in new params module for sdk v0.47+
# these parameters will normally be migrated but is needed for localnet genesis
cat $HOME/.zetacored/config/genesis.json | jq '.app_state["gov"]["params"]["min_deposit"][0]["denom"]="azeta"' > $HOME/.zetacored/config/tmp_genesis.json && mv $HOME/.zetacored/config/tmp_genesis.json $HOME/.zetacored/config/genesis.json
cat $HOME/.zetacored/config/genesis.json | jq '.app_state["gov"]["params"]["voting_period"]="100s"' > $HOME/.zetacored/config/tmp_genesis.json && mv $HOME/.zetacored/config/tmp_genesis.json $HOME/.zetacored/config/genesis.json
# set the parameters only if params field is defined in gov
# in the case of sdk v0.46 during upgrade test, the params field is not defined
if jq -e '.app_state.gov | has("params")' "$HOME/.zetacored/config/genesis.json" > /dev/null; then
cat $HOME/.zetacored/config/genesis.json | jq '.app_state["gov"]["params"]["min_deposit"][0]["denom"]="azeta"' > $HOME/.zetacored/config/tmp_genesis.json && mv $HOME/.zetacored/config/tmp_genesis.json $HOME/.zetacored/config/genesis.json
cat $HOME/.zetacored/config/genesis.json | jq '.app_state["gov"]["params"]["voting_period"]="100s"' > $HOME/.zetacored/config/tmp_genesis.json && mv $HOME/.zetacored/config/tmp_genesis.json $HOME/.zetacored/config/genesis.json
fi

# set admin account
zetacored add-genesis-account zeta1srsq755t654agc0grpxj4y3w0znktrpr9tcdgk 100000000000000000000000000azeta
Expand Down
2 changes: 1 addition & 1 deletion e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The E2E testing project is organized into several packages, each with a specific
- `config`: Provides general configuration for E2E tests, including RPC addresses for connected networks, addresses of deployed smart contracts, and account details for test transactions.
- `contracts`: Includes sample Solidity smart contracts used in testing scenarios.
- `runner`: Responsible for executing E2E tests, handling interactions with various network clients.
- `e2etests`: Houses a collection of E2E tests that can be run against the ZetaChain network.
- `e2etests`: Houses a collection of E2E tests that can be run against the ZetaChain network. Each test is implemented as a separate Go file prefixed with `test_`.
- `txserver`: A minimalistic client for interacting with the ZetaChain RPC interface.
- `utils`: Offers utility functions to facilitate interactions with the different blockchain networks involved in testing.

Expand Down
147 changes: 147 additions & 0 deletions e2e/contracts/testdappnorevert/TestDAppNoRevert.abi
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
[
{
"inputs": [
{
"internalType": "address",
"name": "_connector",
"type": "address"
},
{
"internalType": "address",
"name": "_zetaToken",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "ErrorTransferringZeta",
"type": "error"
},
{
"inputs": [],
"name": "InvalidMessageType",
"type": "error"
},
{
"anonymous": false,
"inputs": [],
"name": "HelloWorldEvent",
"type": "event"
},
{
"anonymous": false,
"inputs": [],
"name": "RevertedHelloWorldEvent",
"type": "event"
},
{
"inputs": [],
"name": "HELLO_WORLD_MESSAGE_TYPE",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "connector",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"components": [
{
"internalType": "bytes",
"name": "zetaTxSenderAddress",
"type": "bytes"
},
{
"internalType": "uint256",
"name": "sourceChainId",
"type": "uint256"
},
{
"internalType": "address",
"name": "destinationAddress",
"type": "address"
},
{
"internalType": "uint256",
"name": "zetaValue",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "message",
"type": "bytes"
}
],
"internalType": "struct ZetaInterfaces.ZetaMessage",
"name": "zetaMessage",
"type": "tuple"
}
],
"name": "onZetaMessage",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "destinationAddress",
"type": "address"
},
{
"internalType": "uint256",
"name": "destinationChainId",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
},
{
"internalType": "bool",
"name": "doRevert",
"type": "bool"
}
],
"name": "sendHelloWorld",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [],
"name": "zeta",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
}
]
1 change: 1 addition & 0 deletions e2e/contracts/testdappnorevert/TestDAppNoRevert.bin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
608060405234801561001057600080fd5b50604051610cf4380380610cf48339818101604052810190610032919061011d565b816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505061015d565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100ea826100bf565b9050919050565b6100fa816100df565b811461010557600080fd5b50565b600081519050610117816100f1565b92915050565b60008060408385031215610134576101336100ba565b5b600061014285828601610108565b925050602061015385828601610108565b9150509250929050565b610b888061016c6000396000f3fe60806040526004361061004a5760003560e01c80633749c51a1461004f5780637caca3041461007857806383f3084f146100945780638ac44a3f146100bf578063e8f9cb3a146100ea575b600080fd5b34801561005b57600080fd5b5061007660048036038101906100719190610533565b610115565b005b610092600480360381019061008d9190610648565b6101ae565b005b3480156100a057600080fd5b506100a9610497565b6040516100b691906106be565b60405180910390f35b3480156100cb57600080fd5b506100d46104bb565b6040516100e191906106f2565b60405180910390f35b3480156100f657600080fd5b506100ff6104df565b60405161010c91906106be565b60405180910390f35b6000818060800190610127919061071c565b81019061013491906107ab565b915050600015158115151461017e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161017590610848565b60405180910390fd5b7f3399097dded3a4667baa7375fe02dfaec8fb76c75ba8da569c40bd175686b0d160405160405180910390a15050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b360008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16856040518363ffffffff1660e01b815260040161022d929190610877565b6020604051808303816000875af115801561024c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061027091906108b5565b90506000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330876040518463ffffffff1660e01b81526004016102d3939291906108e2565b6020604051808303816000875af11580156102f2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061031691906108b5565b90508180156103225750805b610358576040517f2bd0ba5000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ec0269016040518060c00160405280888152602001896040516020016103b69190610961565b60405160208183030381529060405281526020016203d09081526020017f6e0182194bb1deba01849afd3e035a0b70ce7cb069e482ee663519c76cf569b48760405160200161040692919061098b565b604051602081830303815290604052815260200187815260200160405160200161042f906109da565b6040516020818303038152906040528152506040518263ffffffff1660e01b815260040161045d9190610b30565b600060405180830381600087803b15801561047757600080fd5b505af115801561048b573d6000803e3d6000fd5b50505050505050505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b7f6e0182194bb1deba01849afd3e035a0b70ce7cb069e482ee663519c76cf569b481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080fd5b600080fd5b600080fd5b600060a0828403121561052a5761052961050f565b5b81905092915050565b60006020828403121561054957610548610505565b5b600082013567ffffffffffffffff8111156105675761056661050a565b5b61057384828501610514565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006105a78261057c565b9050919050565b6105b78161059c565b81146105c257600080fd5b50565b6000813590506105d4816105ae565b92915050565b6000819050919050565b6105ed816105da565b81146105f857600080fd5b50565b60008135905061060a816105e4565b92915050565b60008115159050919050565b61062581610610565b811461063057600080fd5b50565b6000813590506106428161061c565b92915050565b6000806000806080858703121561066257610661610505565b5b6000610670878288016105c5565b9450506020610681878288016105fb565b9350506040610692878288016105fb565b92505060606106a387828801610633565b91505092959194509250565b6106b88161059c565b82525050565b60006020820190506106d360008301846106af565b92915050565b6000819050919050565b6106ec816106d9565b82525050565b600060208201905061070760008301846106e3565b92915050565b600080fd5b600080fd5b600080fd5b600080833560016020038436030381126107395761073861070d565b5b80840192508235915067ffffffffffffffff82111561075b5761075a610712565b5b60208301925060018202360383131561077757610776610717565b5b509250929050565b610788816106d9565b811461079357600080fd5b50565b6000813590506107a58161077f565b92915050565b600080604083850312156107c2576107c1610505565b5b60006107d085828601610796565b92505060206107e185828601610633565b9150509250929050565b600082825260208201905092915050565b7f6d65737361676520736179732072657665727400000000000000000000000000600082015250565b60006108326013836107eb565b915061083d826107fc565b602082019050919050565b6000602082019050818103600083015261086181610825565b9050919050565b610871816105da565b82525050565b600060408201905061088c60008301856106af565b6108996020830184610868565b9392505050565b6000815190506108af8161061c565b92915050565b6000602082840312156108cb576108ca610505565b5b60006108d9848285016108a0565b91505092915050565b60006060820190506108f760008301866106af565b61090460208301856106af565b6109116040830184610868565b949350505050565b60008160601b9050919050565b600061093182610919565b9050919050565b600061094382610926565b9050919050565b61095b6109568261059c565b610938565b82525050565b600061096d828461094a565b60148201915081905092915050565b61098581610610565b82525050565b60006040820190506109a060008301856106e3565b6109ad602083018461097c565b9392505050565b50565b60006109c46000836107eb565b91506109cf826109b4565b600082019050919050565b600060208201905081810360008301526109f3816109b7565b9050919050565b610a03816105da565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610a43578082015181840152602081019050610a28565b60008484015250505050565b6000601f19601f8301169050919050565b6000610a6b82610a09565b610a758185610a14565b9350610a85818560208601610a25565b610a8e81610a4f565b840191505092915050565b600060c083016000830151610ab160008601826109fa565b5060208301518482036020860152610ac98282610a60565b9150506040830151610ade60408601826109fa565b5060608301518482036060860152610af68282610a60565b9150506080830151610b0b60808601826109fa565b5060a083015184820360a0860152610b238282610a60565b9150508091505092915050565b60006020820190508181036000830152610b4a8184610a99565b90509291505056fea264697066735822122058690b26f0645b6f20806288a08764ea93439a663b2bff50b96d229cba0652c964736f6c63430008170033
Loading

0 comments on commit f61f1a7

Please sign in to comment.