diff --git a/chain/src/repository/balance.rs b/chain/src/repository/balance.rs index c09bbdb5..a9ee0af0 100644 --- a/chain/src/repository/balance.rs +++ b/chain/src/repository/balance.rs @@ -133,7 +133,7 @@ mod tests { insert_tokens(conn, vec![token.clone()])?; - seed_blocks_from_balances(conn, &vec![balance.clone()])?; + seed_blocks_from_balances(conn, &[balance.clone()])?; insert_balances(conn, vec![balance.clone()])?; @@ -180,7 +180,7 @@ mod tests { ..(balance.clone()) }; - seed_blocks_from_balances(conn, &vec![new_balance.clone()])?; + seed_blocks_from_balances(conn, &[new_balance.clone()])?; insert_balances(conn, vec![new_balance])?; let queried_balance = @@ -418,7 +418,7 @@ mod tests { insert_tokens(conn, vec![token.clone()])?; - seed_blocks_from_balances(conn, &vec![balance.clone()])?; + seed_blocks_from_balances(conn, &[balance.clone()])?; insert_balances(conn, vec![balance.clone()])?; let queried_balance = query_balance_by_address(conn, owner, token)?; @@ -515,10 +515,10 @@ mod tests { fn seed_blocks_from_balances( conn: &mut PgConnection, - balances: &Vec, + balances: &[Balance], ) -> anyhow::Result<()> { for height in balances - .into_iter() + .iter() .map(|balance| balance.height as i32) .collect::>() { diff --git a/shared/src/block.rs b/shared/src/block.rs index ccfb0c56..efd3fb4b 100644 --- a/shared/src/block.rs +++ b/shared/src/block.rs @@ -104,6 +104,7 @@ pub struct Block { pub hash: Id, pub header: BlockHeader, pub transactions: Vec<(WrapperTransaction, Vec)>, + pub epoch: Epoch } impl Block { @@ -112,6 +113,7 @@ impl Block { block_results: &BlockResult, proposer_address_namada: &Option, // Provide the namada address of the proposer, if available checksums: Checksums, + epoch: Epoch, block_height: BlockHeight, ) -> Self { let transactions = block_response @@ -152,6 +154,7 @@ impl Block { app_hash: Id::from(&block_response.block.header.app_hash), }, transactions, + epoch } } diff --git a/transactions/src/main.rs b/transactions/src/main.rs index abd728c7..fbaf35a5 100644 --- a/transactions/src/main.rs +++ b/transactions/src/main.rs @@ -136,6 +136,7 @@ async fn crawling_fn( &block_results, &proposer_address_namada, checksums, + 1_u32, // placeholder, we dont need the epoch here block_height, );