mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-09 12:49:23 +00:00
Work on testing the Router
Completes the `Executed` enum in the router. Adds an `Escape` struct. Both are needed for testing purposes. Documents the gas constants in intent and reasoning. Adds modernized tests around key rotation and the escape hatch. Also updates the rest of the codebase which had accumulated errors.
This commit is contained in:
@@ -165,12 +165,14 @@ impl<D: Db> ScannerFeed for Rpc<D> {
|
||||
let mut instructions = router.in_instructions(block.number, &HashSet::from(TOKENS)).await?;
|
||||
|
||||
for token in TOKENS {
|
||||
for TopLevelTransfer { id, from, amount, data } in Erc20::new(provider.clone(), **token)
|
||||
.top_level_transfers(block.number, router.address())
|
||||
.await?
|
||||
for TopLevelTransfer { id, transaction_hash, from, amount, data } in
|
||||
Erc20::new(provider.clone(), **token)
|
||||
.top_level_transfers(block.number, router.address())
|
||||
.await?
|
||||
{
|
||||
instructions.push(EthereumInInstruction {
|
||||
id,
|
||||
transaction_hash,
|
||||
from,
|
||||
coin: EthereumCoin::Erc20(token),
|
||||
amount,
|
||||
@@ -179,7 +181,7 @@ impl<D: Db> ScannerFeed for Rpc<D> {
|
||||
}
|
||||
}
|
||||
|
||||
let executed = router.executed(block.number).await?;
|
||||
let executed = router.executed(block.number, block.number).await?;
|
||||
|
||||
Ok((instructions, executed))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user