Skip to content

Commit

Permalink
do not show gas in simple mode (LedgerHQ#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
jleni authored Jun 16, 2020
1 parent d11d3aa commit 2755e74
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 21 deletions.
3 changes: 3 additions & 0 deletions app/src/tx_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,9 @@ __Z_INLINE uint8_t get_subitem_count(root_item_e root_item) {
case root_item_memo:
break;
case root_item_fee:
if (!tx_is_expert_mode()) {
tmp_num_items -= 1; // Hide Gas field
}
default:
break;
}
Expand Down
27 changes: 9 additions & 18 deletions tests/testcases/manual.json
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,7 @@
"2 | Dest Address : cosmosaccaddr1da6hgur4wse3jx32",
"3 | Dest Coins : 10 atom",
"4 | Memo : testmemo",
"5 | Fee : 5 photon",
"6 | Gas : 10000"
"5 | Fee : 5 photon"
],
"expert": false
},
Expand Down Expand Up @@ -306,8 +305,7 @@
"1 | Source Coins : 10 atom",
"2 | Dest Address : cosmosaccaddr1da6hgur4wse3jx32",
"3 | Dest Coins : 10 atom",
"4 | Fee : 5 photon",
"5 | Gas : 10000"
"4 | Fee : 5 photon"
],
"expert": false
},
Expand Down Expand Up @@ -419,8 +417,7 @@
"1 | Source Coins : 10 atom",
"2 | Dest Address : cosmosaccaddr1da6hgur4wse3jx32",
"3 | Dest Coins : 10 atom",
"4 | Fee : 5 photon",
"5 | Gas : 10000"
"4 | Fee : 5 photon"
],
"expert": false
},
Expand Down Expand Up @@ -590,8 +587,7 @@
"6 | Dest Address : test3",
"7 | Dest Coins : 50 ripple",
"8 | Memo : testmemo",
"9 | Fee : 5 photon",
"10 | Gas : 10000"
"9 | Fee : 5 photon"
],
"expert": false
},
Expand Down Expand Up @@ -731,8 +727,7 @@
"3 | Validator [1/2] : cosmosvaloper1grgelyng2v6v3t8z87wu3sxgt",
"3 | Validator [2/2] : 9m5s03xfytvz7",
"4 | Memo : Zondax.ch",
"5 | Fee : 0.005000 ATOM",
"6 | Gas : 200000"
"5 | Fee : 0.005000 ATOM"
],
"expert": false
},
Expand Down Expand Up @@ -818,8 +813,7 @@
"4 | msgs/proposer [2/2] : vwxyz0",
"5 | msgs/title : test",
"6 | Memo : abc",
"7 | Fee : Empty",
"8 | Gas : 500000"
"7 | Fee : Empty"
],
"expert": false
},
Expand Down Expand Up @@ -911,8 +905,7 @@
"3 | Validator [1/2] : cosmosvaloper1grgelyng2v6v3t8z87wu3sxgt",
"3 | Validator [2/2] : 9m5s03xfytvz7",
"4 | Memo : Delegated with Ledger from union.market",
"5 | Fee : 0.005000 ATOM",
"6 | Gas : 200000"
"5 | Fee : 0.005000 ATOM"
],
"expert": false
},
Expand Down Expand Up @@ -1111,8 +1104,7 @@
"2 | Validator [2/2] : vjhennyh568ys",
"3 | Validator [1/2] : cosmosvaloper1x88j7vp2xnw3zec8ur3g4waxy",
"3 | Validator [2/2] : cyz7m0mahdv3p",
"4 | Fee : 0.000600 ATOM",
"5 | Gas : 200000"
"4 | Fee : 0.000600 ATOM"
],
"expert": false
},
Expand Down Expand Up @@ -1522,8 +1514,7 @@
"4 | Amount : 20.139397 ATOM",
"5 | Validator [1/2] : cosmosvaloper1648ynlpdw7fqa2axt0w2yp3fk",
"5 | Validator [2/2] : 542junl7rsvq6",
"6 | Fee : 0.000600 ATOM",
"7 | Gas : 200000"
"6 | Fee : 0.000600 ATOM"
],
"expert": false
}
Expand Down
Binary file modified tests_zemu/snapshots/show-address-and-sign-basic/11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests_zemu/snapshots/sign-basic-combined/8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed tests_zemu/snapshots/sign-basic-combined/9.png
Binary file not shown.
Binary file modified tests_zemu/snapshots/sign-basic/6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions tests_zemu/tests/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ describe('Basic checks', function () {

// Reference window
await sim.snapshot(`${snapshotPrefixTmp}${snapshotCount++}.png`);
for (let i = 0; i < 7; i++) {
for (let i = 0; i < 6; i++) {
await sim.clickRight(Resolve(`${snapshotPrefixTmp}${snapshotCount++}.png`));
}
await sim.clickBoth();
Expand Down Expand Up @@ -405,7 +405,7 @@ describe('Basic checks', function () {

// Reference window
await sim.snapshot(`${snapshotPrefixTmp}${snapshotCount++}.png`);
for (let i = 0; i < 9; i++) {
for (let i = 0; i < 8; i++) {
await sim.clickRight(Resolve(`${snapshotPrefixTmp}${snapshotCount++}.png`));
}
await sim.clickBoth();
Expand Down Expand Up @@ -475,7 +475,7 @@ describe('Basic checks', function () {

// Reference window
await sim.snapshot(`${snapshotPrefixTmp}${snapshotCount++}.png`);
for (let i = 0; i < 7; i++) {
for (let i = 0; i < 6; i++) {
await sim.clickRight(Resolve(`${snapshotPrefixTmp}${snapshotCount++}.png`));
}
await sim.clickBoth();
Expand Down

0 comments on commit 2755e74

Please sign in to comment.