Skip to content

Commit 932e6d1

Browse files
Seulgi Kimsgkim126
authored andcommitted
Fix the regular_key_owner of TestBlockChainClient
1 parent 79e79d3 commit 932e6d1

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

core/src/client/test_client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ impl AccountData for TestBlockChainClient {}
366366

367367
impl RegularKeyOwner for TestBlockChainClient {
368368
fn regular_key_owner(&self, _address: &Address, _state: StateOrBlock) -> Option<Address> {
369-
Some(Address::default())
369+
None
370370
}
371371
}
372372

core/src/miner/mem_pool.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,7 @@ pub mod test {
980980
use std::cmp::Ordering;
981981

982982
use crate::client::{Balance, RegularKeyOwner, Seq, TestBlockChainClient};
983-
use ckey::{Address, Generator, KeyPair, Random};
983+
use ckey::{Generator, KeyPair, Random};
984984
use ctypes::transaction::{Action, AssetMintOutput, Transaction};
985985
use primitives::H160;
986986

@@ -1421,7 +1421,8 @@ pub mod test {
14211421
fn db_backup_and_recover() {
14221422
//setup test_client
14231423
let test_client = TestBlockChainClient::new();
1424-
let default_addr = Address::default();
1424+
let keypair = Random.generate().unwrap();
1425+
let default_addr = public_to_address(keypair.public());
14251426
test_client.set_seq(default_addr, 4u64);
14261427
test_client.set_balance(default_addr, u64::max_value());
14271428

@@ -1436,7 +1437,6 @@ pub mod test {
14361437
balance: test_client.latest_balance(&a),
14371438
}
14381439
};
1439-
let keypair = Random.generate().unwrap();
14401440
let no_timelock = TxTimelock {
14411441
block: None,
14421442
timestamp: None,
@@ -1480,6 +1480,7 @@ pub mod test {
14801480

14811481
assert_eq!(mem_pool_recovered.first_seqs, mem_pool.first_seqs);
14821482
assert_eq!(mem_pool_recovered.next_seqs, mem_pool.next_seqs);
1483+
assert_eq!(mem_pool_recovered.by_signer_public, mem_pool.by_signer_public);
14831484
assert_eq!(mem_pool_recovered.is_local_account, mem_pool.is_local_account);
14841485
assert_eq!(mem_pool_recovered.next_transaction_id, mem_pool.next_transaction_id);
14851486
assert_eq!(mem_pool_recovered.by_hash, mem_pool.by_hash);

core/src/miner/mem_pool_types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ pub enum QueueTag {
282282
New,
283283
}
284284

285-
#[derive(Clone, Copy, Debug)]
285+
#[derive(Clone, Copy, Debug, PartialEq)]
286286
pub struct TransactionOrderWithTag {
287287
pub order: TransactionOrder,
288288
pub tag: QueueTag,

0 commit comments

Comments
 (0)