Skip to content

Commit

Permalink
Merge branch 'murisi/pow-solution-fix' (#1949)
Browse files Browse the repository at this point in the history
* origin/murisi/pow-solution-fix:
  Added changelog entry.
  Reintroduced a dummy field in order to achieve compatability with hardware wallet.
  • Loading branch information
tzemanovic authored and brentstone committed Nov 11, 2023
2 parents 2a881ee + 696c8be commit c75185e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
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 @@ -963,7 +963,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 @@ -1968,6 +1968,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 @@ -165,6 +165,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 @@ -191,6 +206,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 @@ -212,6 +229,7 @@ pub mod wrapper_tx {
epoch,
gas_limit,
unshield_section_hash: unshield_hash,
pow_solution: Solution::None,
}
}

Expand Down

0 comments on commit c75185e

Please sign in to comment.