Scraper tool can be used to scrape storage and/or transactions from a live chain and store them in a file. This file can then be used to write tests against the state stored in the file or apply the stored transactions.
cargo build --release -p scraper./target/debug/scraper save-storage --pallet Omnipool System AssetRegistry Balances Tokens --uri wss://rpc.hydradx.cloud:443./target/debug/scraper save-storage --at 0xfee166d4ba86ef6b33246e22b8d71dcc085923332849c4bc96e618361ba7f446 --uri wss://rpc.hydradx.cloud:443scraper --uri wss://rpc.hydradx.cloud:443 save-blocks 2039120 5#[test]
fn test_with_stored_state_and_txs() {
hydra_live_ext().execute_with(|| {
whitelisted_pallets: vec!["Tokens", "Balances"]; // only calls from the Tokens and Balances pallets will be applied
apply_blocks_from_file(whitelisted_pallets);
});
}