namada
namada copied to clipboard
Murisi/denominated fee amount on 0.28.0
Describe your changes
Made changes necessary to enable hardware wallets to first correctly display amounts in different tokens and second sign over them. Specifically, the following changes were made:
- Converted
WrapperTx::amount_per_gas_unit
fromAmount
toDenominatedAmount
to enable the hardware wallet to display amount with correct precision regardless of the token. - Modified the protocol to always align the
DenominatedAmount::denom
field before extracting theDenominatedAmount::admount
field so that hardware wallet users cannot be tricked into signing unrelated amounts. - Added checked high level operations (like add, subtract, and multiply) to
DenominatedAmount
to reduce the potential for arithmetic mistakes when manipulating the significand and denomination. - Fixed the redacting of
Transfer::amount
andTransfer::token
for fully shielded transactions. Also fixed the bug whereTransfer::amount
and its denomination did not correspond toTransfer::token
.
The following are known omissions from this PR:
- Ethereum bridge pool transactions:
EthereumBridgePool::amount
andEthereumBridgePool::fee_amount
should probably be converted fromAmount
toDenominatedAmount
to allow the hardware wallet to display quantities properly, and the protocol should safely convert them back toAmount
s.
Indicate on which release or other PRs this topic is based on
Namada v0.28.0
Checklist before merging to draft
- [x] I have added a changelog
- [x] Git history is in acceptable state