-
Notifications
You must be signed in to change notification settings - Fork 265
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
implement TransactionView
#1426
Conversation
As mentioned in #1368, it looks like there are just four Action types that will require additional data not present in the Transaction object itself (for now). @hdevalence does this look like we are heading in the right direction here based on the stubbed decryption code? |
b1ade10
to
240fd5b
Compare
TransactionView
TransactionView
and pcli v tx
TransactionView
and pcli v tx
TransactionView
and pcli v tx
240fd5b
to
d101a54
Compare
d101a54
to
5625669
Compare
5625669
to
dca4284
Compare
TransactionView
and pcli v tx
TransactionView
dca4284
to
cff9b16
Compare
cff9b16
to
b00fbc7
Compare
b00fbc7
to
bcbde9f
Compare
bcbde9f
to
709fb20
Compare
709fb20
to
9a4d1a2
Compare
9a4d1a2
to
374b753
Compare
15130f4
to
01f888f
Compare
Co-authored by: aubreka <aubrey@penumbra.zone>
01f888f
to
b8af99e
Compare
let payload_key = txp | ||
.payload_keys | ||
.get(¬e_commitment) | ||
.ok_or_else(|| anyhow::anyhow!("corresponding payload key not found"))?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error message is pretty opaque, and I think it won't give much information if it's encountered. Perhaps
perspective is missing payload key for output note commitment {}
would be better, since it identifies exactly what's missing and in what context.
transaction/src/lib.rs
Outdated
@@ -8,10 +8,12 @@ mod witness_data; | |||
|
|||
pub mod action; | |||
pub mod plan; | |||
pub mod transaction_view; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is already in the transaction
crate, it'd be better to call the module view
, so that instead of penumbra_transaction::transaction_view
, we have penumbra_transaction::view
.
Following yesterday's design discussion, this work will be refactored to include an |
proto/proto/penumbra/core/transaction/v1alpha1/transaction.proto
Outdated
Show resolved
Hide resolved
Spend spend = 1; | ||
Output output = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These ones (and the Swap
, SwapClaim
below) are the four that need replacing with view-specific protos, right?
transaction/src/action/delegate.rs
Outdated
@@ -31,6 +33,10 @@ impl IsAction for Delegate { | |||
fn balance_commitment(&self) -> penumbra_crypto::balance::Commitment { | |||
self.balance().commit(Fr::zero()) | |||
} | |||
|
|||
fn decrypt_with_perspective(&self, txp: &TransactionPerspective) -> anyhow::Result<ActionView> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that we have the design decision to have an "interpreted" ActionView
, I think that this method would really be better named view_from_perspective
, rather than decrypt
-- and we won't need a Result
, since viewing is infallible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest we leave the signature for the moment & make an issue for next release to go over this work and make sure Results/Errors arising from composed function calls are handled in a way that's informative, because we can make view_from_perspective
infallible, but there are component functions that may fail & I don't want to refactor around that thoughtlessly.
04a36d8
to
88cdde1
Compare
@aubrika and I started sketching out the
TransactionView
required for implementingpcli v tx
as described in #1364