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

Dummy PoW solution field for hardware wallet #1949

Merged
merged 2 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changelog/unreleased/bug-fixes/1949-pow-solution-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Reintroduced a dummy field in order to achieve compatibility with hardware
wallet. ([\#1949](https://github.com/anoma/namada/pull/1949))
3 changes: 2 additions & 1 deletion apps/src/lib/node/ledger/shell/process_proposal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,7 @@ mod test_process_proposal {
use namada::types::token;
use namada::types::token::Amount;
use namada::types::transaction::protocol::EthereumTxData;
use namada::types::transaction::{Fee, WrapperTx};
use namada::types::transaction::{Fee, Solution, WrapperTx};
#[cfg(feature = "abcipp")]
use namada::types::vote_extensions::bridge_pool_roots::MultiSignedVext;
#[cfg(feature = "abcipp")]
Expand Down Expand Up @@ -2005,6 +2005,7 @@ mod test_process_proposal {
epoch: Epoch(0),
gas_limit: GAS_LIMIT_MULTIPLIER.into(),
unshield_section_hash: None,
pow_solution: Solution::None,
};

let tx = Tx::from_type(TxType::Wrapper(Box::new(wrapper)));
Expand Down
18 changes: 18 additions & 0 deletions core/src/types/transaction/wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,21 @@ pub mod wrapper_tx {
}
}

/// A degenerate PoW solution type
#[derive(
Debug,
Clone,
BorshSerialize,
BorshDeserialize,
BorshSchema,
Serialize,
Deserialize,
)]
pub enum Solution {
/// No PoW solution
None,
}

/// A transaction with an encrypted payload, an optional shielded pool
/// unshielding tx for fee payment and some non-encrypted metadata for
/// inclusion and / or verification purposes
Expand All @@ -190,6 +205,8 @@ pub mod wrapper_tx {
/// The hash of the optional, unencrypted, unshielding transaction for
/// fee payment
pub unshield_section_hash: Option<Hash>,
/// Mandatory 0x00 byte for deprecated field
pub pow_solution: Solution,
}

impl WrapperTx {
Expand All @@ -211,6 +228,7 @@ pub mod wrapper_tx {
epoch,
gas_limit,
unshield_section_hash: unshield_hash,
pow_solution: Solution::None,
}
}

Expand Down
Loading