Skip to content

Commit

Permalink
update snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
chcmedeiros committed Nov 29, 2024
1 parent 2830295 commit cab2641
Show file tree
Hide file tree
Showing 82 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/src/evm/eth_eip191.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ parser_error_t eip191_msg_parse() {
// or first char is not printable.
if (messageLength > 0 && (npc * 100) / messageLength >= 40 && !app_mode_blindsign()) {
return parser_blindsign_required;
} else if ((npc * 100) / messageLength < 40) {
} else if (messageLength > 0 && (npc * 100) / messageLength < 40) {
app_mode_skip_blindsign_ui();
}

Expand Down
1 change: 1 addition & 0 deletions app/src/evm/parser_eth.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>

#include "parser_impl.h"

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 13 additions & 4 deletions tests_zemu/tests/eip191.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
******************************************************************************* */
import Zemu, { ButtonKind, isTouchDevice } from '@zondax/zemu'
import { SeiApp } from '@zondax/ledger-sei'
import { FlareApp } from '@zondax/ledger-flare'
import { ETH_PATH, EXPECTED_ETH_ADDRESS, EXPECTED_ETH_PK, defaultOptions, models } from './common'
import { ec } from 'elliptic'
jest.setTimeout(90000)
Expand All @@ -23,26 +23,35 @@ const SIGN_TEST_DATA = [
{
name: 'personal_sign_msg',
message: Buffer.from('Hello World!', 'utf8'),
blind: false,
},
{
name: 'personal_sign_big_msg',
message: Buffer.from('Just a big dummy message to be sign. To test if ew are parsing the chunks in the right way. By: Zondax', 'utf8'),
blind: false,
},
{
name: 'personal_sign_non_printable_msg',
message: Buffer.from('\x00\x00\x00\x00\x00zx', 'utf8'),
blind: true,
},
]
describe.each(models)('EIP191', function (m) {
test.concurrent.each(SIGN_TEST_DATA)('sign transaction: $name', async function (data) {
const sim = new Zemu(m.path)
try {
await sim.start({ ...defaultOptions, model: m.name })
const app = new SeiApp(sim.getTransport())
const app = new FlareApp(sim.getTransport())
const msgData = data.message

await sim.toggleBlindSigning()
if (data.blind) {
await sim.toggleBlindSigning()
}
// do not wait here..
const signatureRequest = app.signPersonalMessage(ETH_PATH, msgData.toString('hex'))
// Wait until we are not in the main menu
await sim.waitUntilScreenIsNot(sim.getMainMenuSnapshot())
await sim.compareSnapshotsAndApprove('.', `${m.prefix.toLowerCase()}-eth-${data.name}`)
await sim.compareSnapshotsAndApprove('.', `${m.prefix.toLowerCase()}-eth-${data.name}`, true, 0, 1500, data.blind)
let resp = await signatureRequest
console.log(resp)
const header = Buffer.from('\x19Ethereum Signed Message:\n', 'utf8')
Expand Down

0 comments on commit cab2641

Please sign in to comment.