Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: add horizon support to tap-agent #594

Merged
merged 1 commit into from
Jan 30, 2025

Conversation

gusinacio
Copy link
Member

No description provided.

Copy link
Contributor

Pull Request Test Coverage Report for Build 13059209804

Details

  • 106 of 168 (63.1%) changed or added relevant lines in 6 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.3%) to 78.893%

Changes Missing Coverage Covered Lines Changed/Added Lines %
crates/tap-agent/src/agent/sender_allocation.rs 14 15 93.33%
crates/tap-agent/src/test.rs 18 21 85.71%
crates/indexer-receipt/src/lib.rs 63 121 52.07%
Totals Coverage Status
Change from base Build 13059003691: -0.3%
Covered Lines: 7042
Relevant Lines: 8926

💛 - Coveralls

Comment on lines +90 to +116
pub fn as_v1(self) -> Option<tap_graph::SignedReceipt> {
match self {
TapReceipt::V1(receipt) => Some(receipt),
_ => None,
}
}

pub fn as_v2(self) -> Option<tap_graph::v2::SignedReceipt> {
match self {
TapReceipt::V2(receipt) => Some(receipt),
_ => None,
}
}

pub fn get_v1_receipt(&self) -> Option<&tap_graph::SignedReceipt> {
match self {
TapReceipt::V1(receipt) => Some(receipt),
_ => None,
}
}

pub fn get_v2_receipt(&self) -> Option<&tap_graph::v2::SignedReceipt> {
match self {
TapReceipt::V2(receipt) => Some(receipt),
_ => None,
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this necessary with the v1 v2 separation?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just for Aggregation, it's especially important that we can only aggregate V1 Receipts into V1 Ravs and for V2 as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't the enum handle that? I'm trying to understand how a V2 receipt could match as V1.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you suggest doing it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm asking you, why you think this won't work:

pub fn get_receipt(&self) -> &tap_graph::v2::SignedReceipt {
        match self {
            TapReceipt::V2(receipt) => receipt,
            TapReceipt::V1(receipt) => receipt,
        }
    }

Maybe I'm missing something!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each one has a different type, the compiler would say tap_graph::SignedReceipt is not an instance of tap_graph::v2::SignedReceipt

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I see that now, the v1 having no similar label threw me.

But do the SignedReceipt types not implement some shared behavior? But it doesn't have to look so confusing?

@gusinacio gusinacio merged commit 1e4ea11 into main Jan 30, 2025
10 checks passed
@gusinacio gusinacio deleted the gustavo/tap-agent-v2-support branch January 30, 2025 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants