diff --git a/src/test/mappingHandlers.test.ts b/src/test/mappingHandlers.test.ts index c0697a51..57c99d7e 100644 --- a/src/test/mappingHandlers.test.ts +++ b/src/test/mappingHandlers.test.ts @@ -1,12 +1,22 @@ /** @file test against agoric-3-proposals:latest */ import { subqlTest } from '@subql/testing'; -import { StateChangeEvent, Wallet } from '../types'; +import { + ReserveAllocationMetrics, + ReserveAllocationMetricsDaily, + ReserveMetrics, + StateChangeEvent, + Vault, + VaultManagerGovernance, + VaultManagerMetrics, + VaultManagerMetricsDaily, + VaultStatesDaily, + Wallet, +} from '../types'; // FIXME observed in A3P:latest but not passing tests subqlTest( 'StateChangeEvent in state_change at block 627', - 627, // block height to process - // dependent entities + 627, [], [ new Wallet( @@ -29,3 +39,102 @@ subqlTest( 'handleStateChangeEvent', ); + +subqlTest( + 'Vault and VaultStateDailies at height 742', + 742, + [], + [ + new Vault( + 'published.vaultFactory.managers.manager0.vaults.vault6', + BigInt(742), + new Date('2024-12-09 23:13:19.186'), + 'published.wallet.agoric1ee9hr0jyrxhy999y755mp862ljgycmwyp4pl7q.current', + ), + + new VaultStatesDaily( + '20241209', + BigInt(742), + new Date('2024-12-09 23:13:19.186'), + BigInt(1), + BigInt(0), + BigInt(0), + BigInt(0), + BigInt(0), + ), + ], + + 'handleStateChangeEvent', +); + +subqlTest( + 'VaultManagerGovernance, VaultManagerMetrics, VaultManagerMetricsDaily, ReserveMetrics, \ + and ReserveAllocationMetrics at block height 1212', + 1212, + [], + [ + new VaultManagerGovernance( + 'published.vaultFactory.managers.manager1.governance', + BigInt(1212), + new Date('2024-12-16 11:42:27.202'), + BigInt(1000000000), + BigInt(100), + BigInt(1), + BigInt(100), + BigInt(150), + BigInt(100), + BigInt(25), + BigInt(100), + BigInt(1), + BigInt(10000), + BigInt(50), + ), + new VaultManagerMetrics( + 'published.vaultFactory.managers.manager1.metrics', + BigInt(1212), + new Date('2024-12-16 11:42:27.202'), + 'stATOM', + BigInt(0), + 'IST', + BigInt(0), + BigInt(0), + BigInt(0), + BigInt(0), + BigInt(0), + BigInt(0), + BigInt(0), + BigInt(0), + BigInt(0), + BigInt(0), + BigInt(0), + BigInt(0), + BigInt(0), + BigInt(0), + ), + new VaultManagerMetricsDaily( + ' published.vaultFactory.managers.manager1.metrics:20241216', + 'published.vaultFactory.managers.manager1.metrics', + 20241216, + BigInt(1212), + new Date('2024-12-16 11:42:27.202'), + ), + new ReserveMetrics( + 'published.reserve.metrics', + BigInt(1212), + new Date('2024-12-16T11:42:27.202Z'), + BigInt(0), + BigInt(0), + BigInt(0), + ), + new ReserveAllocationMetrics( + 'IST', + BigInt(1212), + new Date('2024-12-16T11:42:27.202Z'), + 'IST', + 'Fee', + BigInt(184980868), + 'published.reserve.metrics', + ), + ], + 'handleStateChangeEvent', +);