Skip to content

Commit

Permalink
fix tests (same as moonriver)
Browse files Browse the repository at this point in the history
  • Loading branch information
nanocryk committed Dec 16, 2021
1 parent 5a5d448 commit 9b36b68
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions runtime/moonbeam/tests/runtime_apis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ use pallet_evm::{Account as EVMAccount, AddressMapping, FeeCalculator, GenesisAc
use sp_core::{Public, H160, H256, U256};

use fp_rpc::runtime_decl_for_EthereumRuntimeRPCApi::EthereumRuntimeRPCApi;
use frame_support::assert_noop;
use moonbeam_rpc_primitives_txpool::runtime_decl_for_TxPoolRuntimeApi::TxPoolRuntimeApi;
use std::collections::BTreeMap;
use std::str::FromStr;
Expand Down Expand Up @@ -205,15 +204,14 @@ fn ethereum_runtime_rpc_api_current_transaction_statuses() {
.build()
.execute_with(|| {
set_parachain_inherent_data();
// Calls are currently filtered, so the extrinsic will fail to apply.
// set_author(NimbusId::from_slice(&ALICE_NIMBUS));
let result =
Executive::apply_extrinsic(unchecked_eth_tx(VALID_ETH_TX)).expect("Apply result.");
assert_noop!(result, sp_runtime::DispatchError::BadOrigin);
// // Future us: uncomment below.
// run_to_block(2);
// let statuses =
// Runtime::current_transaction_statuses().expect("Transaction statuses result.");
// assert_eq!(statuses.len(), 1);
assert_eq!(result, Ok(()));
run_to_block(2, None);
let statuses =
Runtime::current_transaction_statuses().expect("Transaction statuses result.");
assert_eq!(statuses.len(), 1);
});
}

Expand All @@ -237,6 +235,7 @@ fn ethereum_runtime_rpc_api_current_block() {
.build()
.execute_with(|| {
set_parachain_inherent_data();
// set_author(NimbusId::from_slice(&ALICE_NIMBUS));
run_to_block(2, None);
let block = Runtime::current_block().expect("Block result.");
assert_eq!(block.header.number, U256::from(1));
Expand Down Expand Up @@ -268,14 +267,13 @@ fn ethereum_runtime_rpc_api_current_receipts() {
.build()
.execute_with(|| {
set_parachain_inherent_data();
// Calls are currently filtered, so the extrinsic will fail to apply.
// set_author(NimbusId::from_slice(&ALICE_NIMBUS));
let result =
Executive::apply_extrinsic(unchecked_eth_tx(VALID_ETH_TX)).expect("Apply result.");
assert_noop!(result, sp_runtime::DispatchError::BadOrigin);
// // Future us: uncomment below.
// run_to_block(2);
// let receipts = Runtime::current_receipts().expect("Receipts result.");
// assert_eq!(receipts.len(), 1);
assert_eq!(result, Ok(()));
run_to_block(2, None);
let receipts = Runtime::current_receipts().expect("Receipts result.");
assert_eq!(receipts.len(), 1);
});
}

Expand Down

0 comments on commit 9b36b68

Please sign in to comment.