mirror of
https://github.com/serai-dex/serai.git
synced 2025-02-02 11:16:41 +00:00
Move LastBatchBlock, LastBatch sets by their checks
This commit is contained in:
parent
6068978676
commit
e5113c333e
1 changed files with 2 additions and 3 deletions
|
@ -115,9 +115,6 @@ pub mod pallet {
|
||||||
|
|
||||||
let batch = batch.batch;
|
let batch = batch.batch;
|
||||||
|
|
||||||
LastBatchBlock::<T>::insert(batch.network, frame_system::Pallet::<T>::block_number());
|
|
||||||
|
|
||||||
LastBatch::<T>::insert(batch.network, batch.id);
|
|
||||||
LatestNetworkBlock::<T>::insert(batch.network, batch.block);
|
LatestNetworkBlock::<T>::insert(batch.network, batch.block);
|
||||||
Self::deposit_event(Event::Batch {
|
Self::deposit_event(Event::Batch {
|
||||||
network: batch.network,
|
network: batch.network,
|
||||||
|
@ -195,6 +192,7 @@ pub mod pallet {
|
||||||
if last_block >= current_block {
|
if last_block >= current_block {
|
||||||
Err(InvalidTransaction::Future)?;
|
Err(InvalidTransaction::Future)?;
|
||||||
}
|
}
|
||||||
|
LastBatchBlock::<T>::insert(batch.batch.network, frame_system::Pallet::<T>::block_number());
|
||||||
|
|
||||||
// Verify the batch is sequential
|
// Verify the batch is sequential
|
||||||
// LastBatch has the last ID set. The next ID should be it + 1
|
// LastBatch has the last ID set. The next ID should be it + 1
|
||||||
|
@ -206,6 +204,7 @@ pub mod pallet {
|
||||||
if batch.batch.id > expected {
|
if batch.batch.id > expected {
|
||||||
Err(InvalidTransaction::Future)?;
|
Err(InvalidTransaction::Future)?;
|
||||||
}
|
}
|
||||||
|
LastBatch::<T>::insert(batch.batch.network, batch.batch.id);
|
||||||
|
|
||||||
// Verify all Balances in this Batch are for this network
|
// Verify all Balances in this Batch are for this network
|
||||||
for instruction in &batch.batch.instructions {
|
for instruction in &batch.batch.instructions {
|
||||||
|
|
Loading…
Reference in a new issue