Skip to content

Commit

Permalink
Merge pull request #325 from Zondax/container
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosala authored Nov 23, 2023
2 parents 27aff5e + daf3edc commit 95adf33
Show file tree
Hide file tree
Showing 8 changed files with 7,844 additions and 4,633 deletions.
138 changes: 120 additions & 18 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,73 +1,175 @@
# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore

# Logs

logs
*.log
npm-debug.log*
_.log
npm-debug.log_
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)

report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json

# Runtime data

pids
*.pid
*.seed
*.pid.lock
_.pid
_.seed
\*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover

lib-cov

# Coverage directory used by tools like istanbul

coverage
\*.lcov

# nyc test coverage

.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)

.grunt

# Bower dependency directory (https://bower.io/)

bower_components

# node-waf configuration

.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)

build/Release

# Dependency directories

node_modules/
jspm_packages/
/docs/.vuepress/dist

# TypeScript v1 declaration files
typings/
# Snowpack dependency directory (https://snowpack.dev/)

web_modules/

# TypeScript cache

\*.tsbuildinfo

# Optional npm cache directory

.npm

# Optional eslint cache

.eslintcache

# Optional stylelint cache

.stylelintcache

# Microbundle cache

.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history

.node_repl_history

# Output of 'npm pack'
*.tgz

\*.tgz

# Yarn Integrity file

.yarn-integrity

# dotenv environment variables file
# dotenv environment variable files

.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)

.cache
.parcel-cache

# Next.js build output

# next.js build output
.next
out

# Nuxt.js build / generate output

.nuxt
dist

# Gatsby files

.cache/

# Comment in the public line in if your project uses Gatsby and not Next.js

# https://nextjs.org/blog/next-9-1#public-directory-support

# public

# vuepress build output

.vuepress/dist

# vuepress v2.x temp and cache directory

.temp
.cache

# Docusaurus cache and generated files

.docusaurus

# Serverless directories

.serverless/

# FuseBox cache

.fusebox/

# DynamoDB Local files

.dynamodb/

# TernJS port file

.tern-port

# Stores VSCode versions used for testing VSCode extensions

\.idea/
.vscode-test

.vscode
# yarn v2

TODO\.md
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.\*

\dist
\tests/snapshots-tmp
# IntelliJ based IDEs
.idea

package-lock.json
# Finder (MacOS) folder config
.DS_Store
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
dist
node_modules
.yarn
893 changes: 893 additions & 0 deletions .yarn/releases/yarn-4.0.2.cjs

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.0.2.cjs
54 changes: 29 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,41 +31,45 @@
"url": "https://github.com/zondax/zemu/issues"
},
"dependencies": {
"@grpc/grpc-js": "^1.9.3",
"@grpc/proto-loader": "^0.7.9",
"@ledgerhq/hw-transport-http": "^6.28.3",
"axios": "^1.5.0",
"axios-retry": "^3.7.0",
"dockerode": "^3.3.1",
"@grpc/grpc-js": "^1.9.11",
"@grpc/proto-loader": "^0.7.10",
"@ledgerhq/hw-transport-http": "^6.28.4",
"axios": "^1.6.2",
"axios-retry": "^3.9.1",
"dockerode": "^4.0.0",
"elfy": "^1.0.0",
"fs-extra": "^11.0.0",
"fs-extra": "^11.1.1",
"get-port": "^5.1.1",
"pngjs": "^7.0.0",
"randomstring": "^1.3.0"
},
"devDependencies": {
"@ledgerhq/hw-transport": "^6.28.8",
"@types/dockerode": "^3.3.19",
"@types/fs-extra": "^11.0.2",
"@types/jest": "^29.5.4",
"@types/node": "^20.6.1",
"@types/pngjs": "^6.0.1",
"@types/randomstring": "^1.1.8",
"@typescript-eslint/eslint-plugin": "^6.7.0",
"@typescript-eslint/parser": "^6.7.0",
"@zondax/ledger-substrate": "^0.41.2",
"@ledgerhq/hw-transport": "^6.29.0",
"@types/dockerode": "^3.3.23",
"@types/fs-extra": "^11.0.4",
"@types/jest": "^29.5.10",
"@types/node": "^20.9.4",
"@types/pngjs": "^6.0.4",
"@types/randomstring": "^1.1.11",
"@typescript-eslint/eslint-plugin": "^6.12.0",
"@typescript-eslint/parser": "^6.12.0",
"@zondax/ledger-substrate": "^0.41.3",
"copyfiles": "^2.4.1",
"eslint": "^8.49.0",
"eslint": "^8.54.0",
"eslint-config-prettier": "^9.0.0",
"eslint-config-standard-with-typescript": "^39.0.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-n": "^16.1.0",
"eslint-plugin-promise": "^6.0.0",
"eslint-config-standard-with-typescript": "^40.0.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-n": "^16.3.1",
"eslint-plugin-promise": "^6.1.1",
"jest": "^29.7.0",
"prettier": "^3.0.3",
"rimraf": "^5.0.0",
"prettier": "^3.1.0",
"rimraf": "^5.0.5",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"typescript": "5.2.2"
}
},
"files": [
"dist/**/*"
],
"packageManager": "[email protected]"
}
2 changes: 2 additions & 0 deletions src/Zemu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ export default class Zemu {

async fetchSnapshot(url: string): Promise<AxiosResponse<Buffer, any>> {
// Exponential back-off retry delay between requests
// eslint-disable-next-line @typescript-eslint/unbound-method
axiosRetry(axios, { retryDelay: axiosRetry.exponentialDelay });

return await axios({
Expand Down Expand Up @@ -712,6 +713,7 @@ export default class Zemu {
}

async getEvents(): Promise<IEvent[]> {
// eslint-disable-next-line @typescript-eslint/unbound-method
axiosRetry(axios, { retryDelay: axiosRetry.exponentialDelay });
const eventsUrl = `${this.transportProtocol}://${this.host}:${this.speculosApiPort}/events`;
try {
Expand Down
4 changes: 2 additions & 2 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
******************************************************************************* */
import { ButtonKind, type IDeviceWindow, type IStartOptions } from "./types";

export const DEFAULT_EMU_IMG = "zondax/builder-zemu:speculos-6a346803f53bc31fa8e4ef210c061fe08a9fbe16";
export const DEFAULT_EMU_IMG = "zondax/builder-zemu:speculos-76bff6673c6c71c15d33a4ac6dc1372b71181283";

export const DEFAULT_MODEL = "nanos";
export const DEFAULT_NANO_START_TEXT = "Ready";
Expand All @@ -32,7 +32,7 @@ export const DEFAULT_WAIT_TIMEOUT = 45000;
export const DEFAULT_NANO_APPROVE_KEYWORD = "APPROVE";
export const DEFAULT_NANO_REJECT_KEYWORD = "REJECT";

export const DEFAULT_STAX_APPROVE_KEYWORD = "Hold";
export const DEFAULT_STAX_APPROVE_KEYWORD = "Hold to sign";
export const DEFAULT_STAX_REJECT_KEYWORD = "Cancel";

export const DEFAULT_START_OPTIONS: IStartOptions = {
Expand Down
Loading

0 comments on commit 95adf33

Please sign in to comment.