diff --git a/crates/telos/node/tests/integration_lite.rs b/crates/telos/node/tests/integration_lite.rs index 2c017e74ac2f..7e3c73586382 100644 --- a/crates/telos/node/tests/integration_lite.rs +++ b/crates/telos/node/tests/integration_lite.rs @@ -24,7 +24,7 @@ use antelope::name; use antelope::chain::name::Name; pub mod utils; -use crate::utils::cleos_evm::{EOSIO_ADDR, EOSIO_PKEY, EOSIO_WALLET, get_nonce, multi_raw_eth_tx, sign_native_tx}; +use crate::utils::cleos_evm::{EOSIO_ADDR, EOSIO_PKEY, EOSIO_SIGNER, EOSIO_WALLET, get_nonce, multi_raw_eth_tx, setrevision_tx, sign_native_tx}; use crate::utils::runners::{build_consensus_and_translator, CONTAINER_LAST_EVM_BLOCK_LITE, CONTAINER_NAME_LITE, CONTAINER_TAG_LITE, init_reth, start_ship, TelosRethNodeHandle}; use alloy_provider::{Identity, Provider, ProviderBuilder, ReqwestProvider}; @@ -148,6 +148,13 @@ pub async fn run_tests( Address::from_hex("0000000000000000deadbeef0000000000000000").unwrap() ).await; + // set revision to 1 + let info = telos_client.v1_chain.get_info().await.unwrap(); + let eosio_key = PrivateKey::from_str(EOSIO_PKEY, false).unwrap(); + let unsigned_rev_tx = setrevision_tx(&info, 1); + let rev_tx = sign_native_tx(&unsigned_rev_tx, &info, &eosio_key); + telos_client.v1_chain.send_transaction(rev_tx).await.unwrap(); + test_blocknum_onchain(reth_provider).await; } diff --git a/crates/telos/node/tests/utils/cleos_evm.rs b/crates/telos/node/tests/utils/cleos_evm.rs index ddfaf0891c7b..874381cd0a04 100644 --- a/crates/telos/node/tests/utils/cleos_evm.rs +++ b/crates/telos/node/tests/utils/cleos_evm.rs @@ -62,6 +62,34 @@ pub async fn get_nonce(client: &APIClient, address: &Address) - account.nonce } +#[allow(dead_code)] +pub fn setrevision_tx( + info: &GetInfoResponse, + new_revision: u32 +) -> Transaction { + #[derive(Clone, Eq, PartialEq, Default, StructPacker)] + struct SetRevision { + new_revision: u32, + } + + let raw_data = SetRevision { + new_revision + }; + let rev_act = Action::new_ex( + name!("eosio.evm"), + name!("setrevision"), + vec![PermissionLevel::new(name!("eosio.evm"), name!("active"))], + raw_data, + ); + + Transaction { + header: info.get_transaction_header(90), + context_free_actions: vec![], + actions: vec![rev_act], + extension: vec![], + } +} + #[allow(dead_code)] pub async fn raw_eth_tx( info: &GetInfoResponse,