Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bowenwang1996 committed Sep 6, 2023
1 parent d6282a6 commit d0d8d4a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
4 changes: 2 additions & 2 deletions chain/chain/src/tests/simple_chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ fn build_chain() {
// cargo insta test --accept -p near-chain --features nightly -- tests::simple_chain::build_chain
let hash = chain.head().unwrap().last_block_hash;
if cfg!(feature = "nightly") {
insta::assert_display_snapshot!(hash, @"GargNTMFiuET32KH5uPLFwMSU8xXtvrk6aGqgkPbRZg8");
insta::assert_display_snapshot!(hash, @"CwaiZ4AmfJSnMN9rytYwwYHCTzLioC5xcjHzNkDex1HH");
} else {
insta::assert_display_snapshot!(hash, @"712T4sPbJhNWWN3bWweccECGYWbnUmGpqpKW2SJpb2k5");
}
Expand Down Expand Up @@ -78,7 +78,7 @@ fn build_chain() {

let hash = chain.head().unwrap().last_block_hash;
if cfg!(feature = "nightly") {
insta::assert_display_snapshot!(hash, @"2aurKZqRfPkZ3woNjA7Kf79wq5MYz98AohTYWoBFiG7o");
insta::assert_display_snapshot!(hash, @"Dn18HUFm149fojXpwV1dYCfjdPh56S1k233kp7vmnFeE");
} else {
insta::assert_display_snapshot!(hash, @"GUAPgvPQQmhumyuFzPusg3BKtRkVLpCw4asTAWgdTLq6");
}
Expand Down
7 changes: 4 additions & 3 deletions integration-tests/src/tests/client/process_blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2296,10 +2296,11 @@ fn test_data_reset_before_state_sync() {
let signer = InMemorySigner::from_seed("test0".parse().unwrap(), KeyType::ED25519, "test0");
let genesis_block = env.clients[0].chain.get_block_by_height(0).unwrap();
let genesis_hash = *genesis_block.hash();
let new_account_id: AccountId = "test_account.test0".parse().unwrap();
let tx = SignedTransaction::create_account(
1,
"test0".parse().unwrap(),
"test_account".parse().unwrap(),
new_account_id.clone(),
NEAR_BASE,
signer.public_key(),
&signer,
Expand All @@ -2322,7 +2323,7 @@ fn test_data_reset_before_state_sync() {
&head.prev_block_hash,
&head.last_block_hash,
head_block.header().epoch_id(),
&QueryRequest::ViewAccount { account_id: "test_account".parse().unwrap() },
&QueryRequest::ViewAccount { account_id: new_account_id.clone() },
)
.unwrap();
assert_matches!(response.kind, QueryResponseKind::ViewAccount(_));
Expand All @@ -2336,7 +2337,7 @@ fn test_data_reset_before_state_sync() {
&head.prev_block_hash,
&head.last_block_hash,
head_block.header().epoch_id(),
&QueryRequest::ViewAccount { account_id: "test_account".parse().unwrap() },
&QueryRequest::ViewAccount { account_id: new_account_id.clone() },
);
// TODO(#3742): ViewClient still has data in cache by current design.
assert!(response.is_ok());
Expand Down
9 changes: 7 additions & 2 deletions integration-tests/src/tests/standard_cases/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -674,12 +674,17 @@ pub fn test_create_top_level_account(node: impl Node) {
"0x5e97870f263700f46aa00d967821199b9bc5a120",
"0x0000000000000000000000000000000000000000",
"alice",
"thisisaveryverylongtoplevelaccount"
"thisisaveryverylongtoplevelaccount",
];
for (_, id) in top_level_accounts.iter().enumerate() {
let new_account_id = id.parse::<AccountId>().unwrap();
let transaction_result = node_user
.create_account(account_id.clone(), new_account_id.clone(), node.signer().public_key(), 0)
.create_account(
account_id.clone(),
new_account_id.clone(),
node.signer().public_key(),
0,
)
.unwrap();
assert_eq!(
transaction_result.status,
Expand Down
2 changes: 1 addition & 1 deletion runtime/runtime/src/actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,7 @@ mod tests {
"0x32400084c286cf3e17e7b677ea9583e60a000324",
"thisisaveryverylongtoplevelaccount",
"32400084c286cf3e17e7b677ea9583e60a000324",
"000000000000000000000000000000000000000000000000000000000000000"
"000000000000000000000000000000000000000000000000000000000000000",
];
for id in &account_ids {
let account_id: AccountId = id.parse().unwrap();
Expand Down

0 comments on commit d0d8d4a

Please sign in to comment.