File tree Expand file tree Collapse file tree 5 files changed +16
-14
lines changed
Expand file tree Collapse file tree 5 files changed +16
-14
lines changed Original file line number Diff line number Diff line change @@ -159,7 +159,7 @@ async fn get_escrow_accounts_v2(
159159 // 4. Service provider (indexer) receives payments from payer's escrow
160160
161161 let senders_balances: HashMap < Address , U256 > = response
162- . escrow_accounts
162+ . payments_escrow_accounts
163163 . iter ( )
164164 . map ( |account| {
165165 let balance = U256 :: checked_sub (
@@ -180,7 +180,7 @@ async fn get_escrow_accounts_v2(
180180 . collect :: < Result < HashMap < _ , _ > , anyhow:: Error > > ( ) ?;
181181
182182 let senders_to_signers = response
183- . escrow_accounts
183+ . payments_escrow_accounts
184184 . into_iter ( )
185185 . map ( |account| {
186186 let payer = Address :: from_str ( & account. payer . id ) ?;
Original file line number Diff line number Diff line change @@ -6661,8 +6661,8 @@ input PaymentsEscrowAccount_filter {
66616661 thawEndTimestamp_in : [BigInt ! ]
66626662 thawEndTimestamp_not_in : [BigInt ! ]
66636663 _change_block : BlockChangedFilter
6664- and : [EscrowAccount_filter ]
6665- or : [EscrowAccount_filter ]
6664+ and : [PaymentsEscrowAccount_filter ]
6665+ or : [PaymentsEscrowAccount_filter ]
66666666}
66676667
66686668enum PaymentsEscrowAccount_orderBy {
Original file line number Diff line number Diff line change @@ -753,7 +753,7 @@ impl State {
753753 let signer_id = Address :: from_str ( & row. signer_address )
754754 . expect ( "signer_address should be a valid address" ) ;
755755 let sender_id = self
756- . escrow_accounts_v1
756+ . escrow_accounts_v2
757757 . borrow ( )
758758 . get_sender_for_signer ( & signer_id)
759759 . expect ( "should be able to get sender from signer" ) ;
@@ -785,10 +785,10 @@ impl State {
785785 if let Some ( allocation_id_strings) = row. allocation_ids {
786786 let allocation_ids = allocation_id_strings
787787 . iter ( )
788- . map ( |allocation_id | {
789- AllocationId :: Legacy (
790- AllocationIdCore :: from_str ( allocation_id )
791- . expect ( "allocation_id should be a valid allocation ID" ) ,
788+ . map ( |collection_id | {
789+ AllocationId :: Horizon (
790+ CollectionId :: from_str ( collection_id )
791+ . expect ( "collection_id should be a valid collection ID" ) ,
792792 )
793793 } )
794794 . collect :: < HashSet < _ > > ( ) ;
Original file line number Diff line number Diff line change @@ -1131,14 +1131,16 @@ impl DatabaseInteractions for SenderAllocationState<Horizon> {
11311131 ) -> anyhow:: Result < ( ) > {
11321132 sqlx:: query!(
11331133 r#"
1134- DELETE FROM scalar_tap_receipts
1134+ DELETE FROM tap_horizon_receipts
11351135 WHERE timestamp_ns BETWEEN $1 AND $2
1136- AND allocation_id = $3
1137- AND signer_address IN (SELECT unnest($4::text[]));
1136+ AND collection_id = $3
1137+ AND service_provider = $4
1138+ AND signer_address IN (SELECT unnest($5::text[]));
11381139 "# ,
11391140 BigDecimal :: from( min_timestamp) ,
11401141 BigDecimal :: from( max_timestamp) ,
1141- self . allocation_id. as_address( ) . encode_hex( ) ,
1142+ self . allocation_id. to_string( ) ,
1143+ self . indexer_address. encode_hex( ) ,
11421144 & signers,
11431145 )
11441146 . execute ( & self . pgpool )
Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ pub const ESCROW_QUERY_RESPONSE: &str = r#"
116116pub const ESCROW_QUERY_RESPONSE_V2 : & str = r#"
117117 {
118118 "data": {
119- "escrowAccounts ": [
119+ "paymentsEscrowAccounts ": [
120120 {
121121 "balance": "34",
122122 "totalAmountThawing": "10",
You can’t perform that action at this time.
0 commit comments