mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-09 04:39:24 +00:00
Only allow designated participants to send transactions
This commit is contained in:
@@ -92,12 +92,11 @@ fn duplicate_nonces() {
|
||||
insert(NonceTransaction::new(0, 0));
|
||||
insert(NonceTransaction::new(i, 1));
|
||||
|
||||
let nonces = HashMap::new();
|
||||
let res = Block::new(LAST, &ProvidedTransactions::new(), mempool).verify(
|
||||
GENESIS,
|
||||
LAST,
|
||||
HashSet::new(),
|
||||
nonces,
|
||||
HashMap::from([(<Ristretto as Ciphersuite>::G::identity(), 0)]),
|
||||
);
|
||||
if i == 1 {
|
||||
res.unwrap();
|
||||
@@ -125,13 +124,14 @@ fn unsorted_nonces() {
|
||||
// Create and verify the block
|
||||
const GENESIS: [u8; 32] = [0xff; 32];
|
||||
const LAST: [u8; 32] = [0x01; 32];
|
||||
let nonces = HashMap::from([(<Ristretto as Ciphersuite>::G::identity(), 0)]);
|
||||
Block::new(LAST, &ProvidedTransactions::new(), mempool.clone())
|
||||
.verify(GENESIS, LAST, HashSet::new(), HashMap::new())
|
||||
.verify(GENESIS, LAST, HashSet::new(), nonces.clone())
|
||||
.unwrap();
|
||||
|
||||
let skip = NonceTransaction::new(65, 0);
|
||||
mempool.insert(skip.hash(), skip);
|
||||
assert!(Block::new(LAST, &ProvidedTransactions::new(), mempool)
|
||||
.verify(GENESIS, LAST, HashSet::new(), HashMap::new())
|
||||
.verify(GENESIS, LAST, HashSet::new(), nonces)
|
||||
.is_err());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user