Skip to content

Commit

Permalink
Merge branch 'develop' into zetaclient-evm-index-by-nonce
Browse files Browse the repository at this point in the history
  • Loading branch information
brewmaster012 authored Sep 7, 2024
2 parents 1bed195 + ba3b1c0 commit 0c73da6
Show file tree
Hide file tree
Showing 24 changed files with 1,906 additions and 96 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
* [2726](https://github.com/zeta-chain/node/pull/2726) - add e2e tests for deposit and call, deposit and revert
* [2703](https://github.com/zeta-chain/node/pull/2703) - add e2e tests for stateful precompiled contracts
* [2763](https://github.com/zeta-chain/node/pull/2763) - add V2 contracts migration test
* [2830] (https://github.com/zeta-chain/node/pull/2830) - extend staking precompile tests

### Fixes

Expand Down
2 changes: 2 additions & 0 deletions cmd/zetae2e/local/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,9 @@ func localE2ETest(cmd *cobra.Command, _ []string) {
if !skipPrecompiles {
precompiledContractTests = []string{
e2etests.TestPrecompilesPrototypeName,
e2etests.TestPrecompilesPrototypeThroughContractName,
e2etests.TestPrecompilesStakingName,
e2etests.TestPrecompilesStakingThroughContractName,
}
}

Expand Down
8 changes: 8 additions & 0 deletions contrib/localnet/orchestrator/start-zetae2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ fund_eth_from_config '.additional_accounts.user_admin.evm_address' 10000 "admin
# unlock migration tests accounts
fund_eth_from_config '.additional_accounts.user_migration.evm_address' 10000 "migration tester"

# unlock precompile tests accounts
fund_eth_from_config '.additional_accounts.user_precompile.evm_address' 10000 "precompile tester"

# unlock v2 ethers tests accounts
fund_eth_from_config '.additional_accounts.user_v2_ether.evm_address' 10000 "V2 ethers tester"

Expand All @@ -133,6 +136,11 @@ address=$(yq -r '.additional_accounts.user_precompile.evm_address' config.yml)
echo "funding precompile tester address ${address} with 10000 Ether"
geth --exec "eth.sendTransaction({from: eth.coinbase, to: '${address}', value: web3.toWei(10000,'ether')})" attach http://eth:8545 > /dev/null

# unlock precompile tests accounts
address=$(yq -r '.additional_accounts.user_precompile.evm_address' config.yml)
echo "funding precompile tester address ${address} with 10000 Ether"
geth --exec "eth.sendTransaction({from: eth.coinbase, to: '${address}', value: web3.toWei(10000,'ether')})" attach http://eth:8545 > /dev/null

# unlock local solana relayer accounts
if host solana > /dev/null; then
solana_url=$(config_str '.rpcs.solana')
Expand Down
2 changes: 1 addition & 1 deletion contrib/localnet/scripts/start-zetacored.sh
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ then
# migration tester
address=$(yq -r '.additional_accounts.user_migration.bech32_address' /root/config.yml)
zetacored add-genesis-account "$address" 100000000000000000000000000azeta
# precompiles tester
# precompile tester
address=$(yq -r '.additional_accounts.user_precompile.bech32_address' /root/config.yml)
zetacored add-genesis-account "$address" 100000000000000000000000000azeta
# v2 ether tester
Expand Down
64 changes: 64 additions & 0 deletions e2e/contracts/testprototype/TestPrototype.abi
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
[
{
"inputs": [
{
"internalType": "string",
"name": "bech32",
"type": "string"
}
],
"name": "bech32ToHexAddr",
"outputs": [
{
"internalType": "address",
"name": "addr",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "prefix",
"type": "string"
},
{
"internalType": "address",
"name": "addr",
"type": "address"
}
],
"name": "bech32ify",
"outputs": [
{
"internalType": "string",
"name": "bech32",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "int64",
"name": "chainID",
"type": "int64"
}
],
"name": "getGasStabilityPoolBalance",
"outputs": [
{
"internalType": "uint256",
"name": "result",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
]
1 change: 1 addition & 0 deletions e2e/contracts/testprototype/TestPrototype.bin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
608060405260656000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555034801561005157600080fd5b50610878806100616000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80630615b74e146100465780633ee8d1a414610076578063e4e2a4ec146100a6575b600080fd5b610060600480360381019061005b9190610481565b6100d6565b60405161006d9190610565565b60405180910390f35b610090600480360381019061008b91906105c0565b610181565b60405161009d9190610606565b60405180910390f35b6100c060048036038101906100bb9190610621565b610225565b6040516100cd9190610679565b60405180910390f35b606060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630615b74e84846040518363ffffffff1660e01b8152600401610133929190610694565b600060405180830381865afa158015610150573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906101799190610734565b905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633ee8d1a4836040518263ffffffff1660e01b81526004016101dd919061078c565b602060405180830381865afa1580156101fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061021e91906107d3565b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e4e2a4ec836040518263ffffffff1660e01b81526004016102819190610565565b602060405180830381865afa15801561029e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102c29190610815565b9050919050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610330826102e7565b810181811067ffffffffffffffff8211171561034f5761034e6102f8565b5b80604052505050565b60006103626102c9565b905061036e8282610327565b919050565b600067ffffffffffffffff82111561038e5761038d6102f8565b5b610397826102e7565b9050602081019050919050565b82818337600083830152505050565b60006103c66103c184610373565b610358565b9050828152602081018484840111156103e2576103e16102e2565b5b6103ed8482856103a4565b509392505050565b600082601f83011261040a576104096102dd565b5b813561041a8482602086016103b3565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061044e82610423565b9050919050565b61045e81610443565b811461046957600080fd5b50565b60008135905061047b81610455565b92915050565b60008060408385031215610498576104976102d3565b5b600083013567ffffffffffffffff8111156104b6576104b56102d8565b5b6104c2858286016103f5565b92505060206104d38582860161046c565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b60005b838110156105175780820151818401526020810190506104fc565b83811115610526576000848401525b50505050565b6000610537826104dd565b61054181856104e8565b93506105518185602086016104f9565b61055a816102e7565b840191505092915050565b6000602082019050818103600083015261057f818461052c565b905092915050565b60008160070b9050919050565b61059d81610587565b81146105a857600080fd5b50565b6000813590506105ba81610594565b92915050565b6000602082840312156105d6576105d56102d3565b5b60006105e4848285016105ab565b91505092915050565b6000819050919050565b610600816105ed565b82525050565b600060208201905061061b60008301846105f7565b92915050565b600060208284031215610637576106366102d3565b5b600082013567ffffffffffffffff811115610655576106546102d8565b5b610661848285016103f5565b91505092915050565b61067381610443565b82525050565b600060208201905061068e600083018461066a565b92915050565b600060408201905081810360008301526106ae818561052c565b90506106bd602083018461066a565b9392505050565b60006106d76106d284610373565b610358565b9050828152602081018484840111156106f3576106f26102e2565b5b6106fe8482856104f9565b509392505050565b600082601f83011261071b5761071a6102dd565b5b815161072b8482602086016106c4565b91505092915050565b60006020828403121561074a576107496102d3565b5b600082015167ffffffffffffffff811115610768576107676102d8565b5b61077484828501610706565b91505092915050565b61078681610587565b82525050565b60006020820190506107a1600083018461077d565b92915050565b6107b0816105ed565b81146107bb57600080fd5b50565b6000815190506107cd816107a7565b92915050565b6000602082840312156107e9576107e86102d3565b5b60006107f7848285016107be565b91505092915050565b60008151905061080f81610455565b92915050565b60006020828403121561082b5761082a6102d3565b5b600061083984828501610800565b9150509291505056fea26469706673582212203599aa5bcc18cda9492a410a6619dfd803fa572b0624c47efa4d4159a8f2430f64736f6c634300080a0033
Loading

0 comments on commit 0c73da6

Please sign in to comment.