@@ -35,15 +35,15 @@ impl Deref for SubmittedTransaction {
3535#[ derive( Debug , Clone ) ]
3636pub struct SubmittedNoopTransaction {
3737 pub nonce : u64 ,
38- pub hash : String ,
38+ pub transaction_hash : String ,
3939}
4040
4141pub type SubmittedTransactionStringWithNonce = ( String , u64 ) ;
4242
4343impl SubmittedNoopTransaction {
4444 pub fn to_redis_string_with_nonce ( & self ) -> SubmittedTransactionStringWithNonce {
4545 (
46- format ! ( "{}:{}:0" , self . hash , NO_OP_TRANSACTION_ID ) ,
46+ format ! ( "{}:{}:0" , self . transaction_hash , NO_OP_TRANSACTION_ID ) ,
4747 self . nonce ,
4848 )
4949 }
@@ -58,8 +58,8 @@ pub enum SubmittedTransactionHydrated {
5858impl SubmittedTransactionHydrated {
5959 pub fn hash ( & self ) -> & str {
6060 match self {
61- SubmittedTransactionHydrated :: Noop ( tx) => & tx. hash ,
62- SubmittedTransactionHydrated :: Real ( tx) => & tx. hash ,
61+ SubmittedTransactionHydrated :: Noop ( tx) => & tx. transaction_hash ,
62+ SubmittedTransactionHydrated :: Real ( tx) => & tx. transaction_hash ,
6363 }
6464 }
6565
@@ -89,7 +89,7 @@ impl SubmittedTransactionHydrated {
8989#[ serde( rename_all = "camelCase" ) ]
9090pub struct SubmittedTransactionDehydrated {
9191 pub nonce : u64 ,
92- pub hash : String ,
92+ pub transaction_hash : String ,
9393 pub transaction_id : String ,
9494 pub queued_at : u64 ,
9595}
@@ -103,7 +103,7 @@ impl SubmittedTransactionDehydrated {
103103 if parts. len ( ) == 3 {
104104 if let Ok ( queued_at) = parts[ 2 ] . parse :: < u64 > ( ) {
105105 Some ( SubmittedTransactionDehydrated {
106- hash : parts[ 0 ] . to_string ( ) ,
106+ transaction_hash : parts[ 0 ] . to_string ( ) ,
107107 transaction_id : parts[ 1 ] . to_string ( ) ,
108108 nonce : tx. 1 ,
109109 queued_at,
@@ -136,7 +136,10 @@ impl SubmittedTransactionDehydrated {
136136 /// The nonce is the value of the transaction in the submitted state, and is used as the score of the submitted zset
137137 pub fn to_redis_string_with_nonce ( & self ) -> SubmittedTransactionStringWithNonce {
138138 (
139- format ! ( "{}:{}:{}" , self . hash, self . transaction_id, self . queued_at) ,
139+ format ! (
140+ "{}:{}:{}" ,
141+ self . transaction_hash, self . transaction_id, self . queued_at
142+ ) ,
140143 self . nonce ,
141144 )
142145 }
@@ -226,7 +229,7 @@ impl SafeRedisTransaction for CleanSubmittedTransactions<'_> {
226229 let confirmed_hashes: HashSet < & str > = self
227230 . confirmed_transactions
228231 . iter ( )
229- . map ( |tx| tx. hash . as_str ( ) )
232+ . map ( |tx| tx. transaction_hash . as_str ( ) )
230233 . collect ( ) ;
231234
232235 let confirmed_ids: BTreeMap < & str , ConfirmedTransaction > = self
@@ -396,8 +399,8 @@ fn detect_violations<'a>(
396399 for ( nonce, txs) in & txs_by_nonce {
397400 let confirmed_hashes_for_nonce: Vec < String > = txs
398401 . iter ( )
399- . filter ( |tx| confirmed_hashes. contains ( tx. hash . as_str ( ) ) )
400- . map ( |tx| tx. hash . clone ( ) )
402+ . filter ( |tx| confirmed_hashes. contains ( tx. transaction_hash . as_str ( ) ) )
403+ . map ( |tx| tx. transaction_hash . clone ( ) )
401404 . collect ( ) ;
402405
403406 if confirmed_hashes_for_nonce. len ( ) > 1 {
@@ -411,9 +414,9 @@ fn detect_violations<'a>(
411414 for ( nonce, txs) in & txs_by_nonce {
412415 let has_confirmed = txs
413416 . iter ( )
414- . any ( |tx| confirmed_hashes. contains ( tx. hash . as_str ( ) ) ) ;
417+ . any ( |tx| confirmed_hashes. contains ( tx. transaction_hash . as_str ( ) ) ) ;
415418 if !has_confirmed {
416- let hashes: Vec < String > = txs. iter ( ) . map ( |tx| tx. hash . clone ( ) ) . collect ( ) ;
419+ let hashes: Vec < String > = txs. iter ( ) . map ( |tx| tx. transaction_hash . clone ( ) ) . collect ( ) ;
417420 report. nonces_without_receipts . push ( ( * nonce, hashes) ) ;
418421 }
419422 }
0 commit comments