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

Remove fee information for INCOME transactions #390

Merged
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
12 changes: 8 additions & 4 deletions app/components/wallet/transactions/Transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,14 @@ export default class Transaction extends Component<Props, State> {
</div>
)}
<div>
<h2>
{intl.formatMessage(messages.fee)}
</h2>
<span>{formattedWalletAmount(data.fee.abs(), false)}</span>
{data.type !== transactionTypes.INCOME && (
<div>
<h2>
{intl.formatMessage(messages.fee)}
</h2>
<span>{formattedWalletAmount(data.fee.abs(), false)}</span>
</div>
)}
<h2>
{intl.formatMessage(messages.fromAddresses)}
</h2>
Expand Down
19 changes: 17 additions & 2 deletions features/step_definitions/tx-history-steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,23 @@ Then(
await clickeableElement.click();
const txData = await actualTxsList[i].getText();
const txDataFields = txData.split('\n');
const [txType, txTime, txStatus, txAmount, , txFee, , txFrom, , txTo, , ...pendingTxFields]
= txDataFields;
const [txType, txTime, txStatus, txAmount] = txDataFields;

let txFee;
let txFrom;
let txTo;
let pendingTxFields;

if (txType === 'ADA received') {
// Exclude fee
[, , , , , txFrom, , txTo, , ...pendingTxFields]
= txDataFields;

} else {
[, , , , , txFee, , txFrom, , txTo, , ...pendingTxFields]
= txDataFields;
}

const [txId, txConfirmations] = mapPendingTxFields(txExpectedStatus, pendingTxFields);
verifyAllTxsFields(txType, txAmount, txTime, txStatus, txFee, [txFrom],
[txTo], txId, expectedTxsList[i], txConfirmations);
Expand Down