Skip to content

Commit

Permalink
Merge pull request #203 from Zondax/time
Browse files Browse the repository at this point in the history
increase method timeout
  • Loading branch information
jleni authored Feb 18, 2023
2 parents 4d90f45 + bd1de6b commit 0fd1340
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/Zemu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ export default class Zemu {
this.log(`Screen changed`);
}

async waitForScreenChanges(prevEvents: IEvent[], timeout: number = 10000): Promise<void> {
async waitForScreenChanges(prevEvents: IEvent[], timeout = DEFAULT_METHOD_TIMEOUT): Promise<void> {
let currEvents = await this.getEvents();
const startTime = new Date();
while (currEvents.length === prevEvents.length) {
Expand Down
6 changes: 3 additions & 3 deletions src/buttons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ const approveTapButton: IButton = {
};

const approveHoldButton: IButton = {
x: 400,
y: 500,
delay: 2.5,
x: 335,
y: 525,
delay: 3,
};

const rejectButton: IButton = {
Expand Down
6 changes: 3 additions & 3 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ export const DEFAULT_START_DELAY = 20000;
export const DEFAULT_KEY_DELAY = 100;
export const DEFAULT_HOST = "127.0.0.1";
export const BASE_NAME = "zemu-test-";
export const DEFAULT_START_TIMEOUT = 20000;
export const DEFAULT_START_TIMEOUT = 30000;
export const KILL_TIMEOUT = 5000;
export const DEFAULT_METHOD_TIMEOUT = 10000;
export const DEFAULT_METHOD_TIMEOUT = 30000;

export const DEFAULT_NANO_APPROVE_KEYWORD = "APPROVE";
export const DEFAULT_NANO_REJECT_KEYWORD = "REJECT";

export const DEFAULT_STAX_APPROVE_KEYWORD = "APPROVE";
export const DEFAULT_STAX_APPROVE_KEYWORD = "Hold";
export const DEFAULT_STAX_REJECT_KEYWORD = "Cancel";

export const DEFAULT_START_OPTIONS: IStartOptions = {
Expand Down
7 changes: 1 addition & 6 deletions src/emulator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ export default class EmuContainer {
logging: boolean;
custom: string;
model: string;
sdk: string;
transportPort: string;
speculosApiPort: string;
}): Promise<void> {
Expand All @@ -105,15 +104,11 @@ export default class EmuContainer {
});

const modelOptions = options.model !== "" ? options.model : "nanos";
if (modelOptions === "nanosp" && options.sdk === "") options.sdk = "1.0.3";

const sdkOption = options.sdk !== "" ? `-k ${options.sdk}` : "";
if (sdkOption !== "") this.log(`[ZEMU] Using SDK ${modelOptions} with version ${options.sdk}`);

const customOptions = options.custom;

const displaySetting = "--display headless";
const command = `/home/zondax/speculos/speculos.py --log-level speculos:DEBUG --color JADE_GREEN ${displaySetting} ${customOptions} -m ${modelOptions} ${sdkOption} ${DEFAULT_APP_PATH}/${appFilename} ${libArgs}`;
const command = `/home/zondax/speculos/speculos.py --log-level speculos:DEBUG --color JADE_GREEN ${displaySetting} ${customOptions} -m ${modelOptions} ${DEFAULT_APP_PATH}/${appFilename} ${libArgs}`;

this.log(`[ZEMU] Command: ${command}`);

Expand Down

0 comments on commit 0fd1340

Please sign in to comment.