Skip to content

Commit

Permalink
testing blacklist
Browse files Browse the repository at this point in the history
  • Loading branch information
sanlee42 committed Feb 20, 2024
1 parent 58e99dc commit 9021b10
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions chain/open-block/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,15 @@ impl OpenedBlock {
}
}
pub struct AddressFilter;
static BLACKLIST: [&str; 1] = ["0x5d3729704311db3ac10ee04d08054543","0xda507619aedef9755faf2111cd63d3c5"];
impl AddressFilter {
const BLACKLIST: Vec<AccountAddress> = vec![]; //TODO: Fill in
const ACTIVATION_BLOCK_NUMBER: BlockNumber = 16801958;
const ACTIVATION_BLOCK_NUMBER: BlockNumber = 10;
pub fn is_blacklisted(raw_txn: &SignedUserTransaction, block_number: BlockNumber) -> bool {
block_number > Self::ACTIVATION_BLOCK_NUMBER && Self::BLACKLIST.contains(&raw_txn.sender())
let blacklist: Vec<AccountAddress> = BLACKLIST
.iter()
.map(|&s| AccountAddress::from_hex(s).expect("account address decode must success"))
.collect();

block_number > Self::ACTIVATION_BLOCK_NUMBER && blacklist.contains(&raw_txn.sender())
}
}

0 comments on commit 9021b10

Please sign in to comment.