Skip to content

Commit

Permalink
refactor: implement receipt traits for horizon (#609)
Browse files Browse the repository at this point in the history
* refactor: implement receipt traits for horizon

Signed-off-by: Gustavo Inacio <[email protected]>

* docs: explain why use a trait over a match

Signed-off-by: Gustavo Inacio <[email protected]>

---------

Signed-off-by: Gustavo Inacio <[email protected]>
  • Loading branch information
gusinacio authored Feb 10, 2025
1 parent d0731e3 commit d08b3e3
Show file tree
Hide file tree
Showing 11 changed files with 871 additions and 207 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/tap-agent/src/agent/sender_allocation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ where
let context = TapAgentContext::new(
pgpool.clone(),
allocation_id,
config.indexer_address,
sender,
escrow_accounts.clone(),
);
Expand Down
3 changes: 3 additions & 0 deletions crates/tap-agent/src/tap/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ pub struct TapAgentContext<T> {
pgpool: PgPool,
allocation_id: Address,
sender: Address,
indexer_address: Address,
escrow_accounts: Receiver<EscrowAccounts>,
/// We use phantom data as a marker since it's
/// only used to define what methods are available
Expand All @@ -168,12 +169,14 @@ impl<T: NetworkVersion> TapAgentContext<T> {
pub fn new(
pgpool: PgPool,
allocation_id: Address,
indexer_address: Address,
sender: Address,
escrow_accounts: Receiver<EscrowAccounts>,
) -> Self {
Self {
pgpool,
allocation_id,
indexer_address,
sender,
escrow_accounts,
_phantom: PhantomData,
Expand Down
3 changes: 2 additions & 1 deletion crates/tap-agent/src/tap/context/rav.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ mod test {
use tokio::sync::watch;

use super::*;
use crate::test::{create_rav, ALLOCATION_ID_0};
use crate::test::{create_rav, ALLOCATION_ID_0, INDEXER};

#[derive(Debug)]
struct TestableRav(SignedRav);
Expand All @@ -199,6 +199,7 @@ mod test {
let context = TapAgentContext::new(
pool.clone(),
ALLOCATION_ID_0,
INDEXER.1,
SENDER.1,
watch::channel(EscrowAccounts::default()).1,
);
Expand Down
Loading

0 comments on commit d08b3e3

Please sign in to comment.