Skip to content

Commit 5f210fb

Browse files
committed
Cloning LedgerHQ-app-plugin-app-plugin-nft
0 parents  commit 5f210fb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+10775
-0
lines changed

.clang-format

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
BasedOnStyle: Google
3+
IndentWidth: 4
4+
---
5+
Language: Cpp
6+
ColumnLimit: 100
7+
PointerAlignment: Right
8+
AlignAfterOpenBracket: Align
9+
AlignConsecutiveMacros: true
10+
AllowAllParametersOfDeclarationOnNextLine: false
11+
SortIncludes: false
12+
SpaceAfterCStyleCast: true
13+
AllowShortCaseLabelsOnASingleLine: false
14+
AllowAllArgumentsOnNextLine: false
15+
AllowAllParametersOfDeclarationOnNextLine: false
16+
AllowShortBlocksOnASingleLine: Never
17+
AllowShortFunctionsOnASingleLine: None
18+
BinPackArguments: false
19+
BinPackParameters: false
20+
---

.github/workflows/ci-workflow.yml

+271
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,271 @@
1+
name: Compilation & tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
job_build_debug:
13+
name: Build debug
14+
runs-on: ubuntu-latest
15+
16+
container:
17+
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
18+
19+
steps:
20+
- name: Clone
21+
uses: actions/checkout@v2
22+
with:
23+
submodules: recursive
24+
25+
- name: Build Ledger NFT plugin
26+
run: |
27+
make DEBUG=1
28+
29+
- name: Upload Ledger NFT binary
30+
uses: actions/upload-artifact@v2
31+
with:
32+
name: ledger-nft-app-debug
33+
path: bin
34+
35+
job_scan_build:
36+
name: Clang Static Analyzer
37+
needs: job_build_debug
38+
runs-on: ubuntu-latest
39+
40+
container:
41+
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
42+
43+
steps:
44+
- uses: actions/checkout@v2
45+
46+
- name: Build with Clang Static Analyzer
47+
run: |
48+
make clean
49+
scan-build --use-cc=clang -analyze-headers -enable-checker security -enable-checker unix -enable-checker valist -o scan-build --status-bugs make default
50+
- uses: actions/upload-artifact@v2
51+
if: failure()
52+
with:
53+
name: scan-build
54+
path: scan-build
55+
56+
job_coverity_scan:
57+
name: Coverity Scan
58+
needs: job_build_debug
59+
runs-on: ubuntu-latest
60+
61+
container:
62+
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-scanner:latest
63+
64+
steps:
65+
- uses: actions/checkout@v2
66+
67+
- name: Build with cov-build
68+
run: |
69+
make clean
70+
cov-build --dir cov-int make default
71+
- name: Submit the result to Coverity Scan
72+
run: |
73+
tar czvf cov-int.tar.gz cov-int
74+
curl \
75+
--form token=$TOKEN \
76+
--form email=$EMAIL \
77+
78+
--form version=master \
79+
--form description="Ledger NFT Plugin" \
80+
https://scan.coverity.com/builds?project=LedgerHQ%2Fapp-plugin-ledgernft
81+
env:
82+
EMAIL: ${{ secrets.COVERITY_SCAN_EMAIL }}
83+
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
84+
job_build_debug_nano_s:
85+
name: Build debug Nano S
86+
runs-on: ubuntu-latest
87+
container:
88+
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
89+
steps:
90+
- name: Clone
91+
uses: actions/checkout@v2
92+
with:
93+
submodules: recursive
94+
- name: Build plugin for Nano S
95+
run: |
96+
make clean
97+
make BOLOS_SDK=$NANOS_SDK
98+
- name: Move binary to test directory
99+
run: |
100+
mkdir -p ./tests/elfs/
101+
mv bin/app.elf ./tests/elfs/ledger_nft_nanos.elf
102+
- name: Upload plugin binary
103+
uses: actions/upload-artifact@v2
104+
with:
105+
name: binaries
106+
path: tests/elfs/ledger_nft_nanos.elf
107+
108+
job_build_debug_nano_sp:
109+
name: Build debug Nano S+
110+
runs-on: ubuntu-latest
111+
container:
112+
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
113+
steps:
114+
- name: Clone
115+
uses: actions/checkout@v2
116+
with:
117+
submodules: recursive
118+
- name: Build plugin for Nano S+
119+
run: |
120+
make clean
121+
make BOLOS_SDK=$NANOSP_SDK
122+
- name: Move binary to test directory
123+
run: |
124+
mkdir -p ./tests/elfs/
125+
mv bin/app.elf ./tests/elfs/ledger_nft_nanosp.elf
126+
- name: Upload plugin binary
127+
uses: actions/upload-artifact@v2
128+
with:
129+
name: binaries
130+
path: tests/elfs/ledger_nft_nanosp.elf
131+
132+
job_build_debug_nano_x:
133+
name: Build debug Nano X
134+
runs-on: ubuntu-latest
135+
container:
136+
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
137+
steps:
138+
- name: Clone
139+
uses: actions/checkout@v2
140+
with:
141+
submodules: recursive
142+
- name: Build plugin for Nano X
143+
run: |
144+
make clean
145+
make BOLOS_SDK=$NANOX_SDK
146+
- name: Move binary to test directory
147+
run: |
148+
mkdir -p ./tests/elfs/
149+
mv bin/app.elf ./tests/elfs/ledger_nft_nanox.elf
150+
- name: Upload plugin binary
151+
uses: actions/upload-artifact@v2
152+
with:
153+
name: binaries
154+
path: tests/elfs/ledger_nft_nanox.elf
155+
156+
job_build_ethereum_nano_s:
157+
name: Build Ethereum application for Nano S testing
158+
runs-on: ubuntu-latest
159+
container:
160+
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
161+
steps:
162+
- name: Checkout app-ethereum
163+
uses: actions/checkout@v2
164+
with:
165+
repository: LedgerHQ/app-ethereum
166+
ref: ${{ ((github.base_ref || github.ref_name) == 'main' && 'master') || (github.base_ref || github.ref_name) }}
167+
submodules: recursive
168+
- name: Build ethereum
169+
run: |
170+
make clean
171+
make -j DEBUG=1 BYPASS_SIGNATURES=1 BOLOS_SDK=$NANOS_SDK CHAIN=ethereum ALLOW_DATA=1
172+
- name: Move binary to test directory
173+
run: |
174+
mkdir -p ./tests/elfs/
175+
mv bin/app.elf ./tests/elfs/ethereum_nanos.elf
176+
- name: Upload plugin binary
177+
uses: actions/upload-artifact@v2
178+
with:
179+
name: binaries
180+
path: tests/elfs/ethereum_nanos.elf
181+
182+
job_build_ethereum_nano_sp:
183+
name: Build Ethereum application for Nano S+ testing
184+
runs-on: ubuntu-latest
185+
container:
186+
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
187+
steps:
188+
- name: Checkout app-ethereum
189+
uses: actions/checkout@v2
190+
with:
191+
repository: LedgerHQ/app-ethereum
192+
ref: ${{ ((github.base_ref || github.ref_name) == 'main' && 'master') || (github.base_ref || github.ref_name) }}
193+
submodules: recursive
194+
- name: Build ethereum
195+
run: |
196+
make clean
197+
make -j DEBUG=1 BYPASS_SIGNATURES=1 BOLOS_SDK=$NANOSP_SDK CHAIN=ethereum ALLOW_DATA=1
198+
- name: Move binary to test directory
199+
run: |
200+
mkdir -p ./tests/elfs/
201+
mv bin/app.elf ./tests/elfs/ethereum_nanosp.elf
202+
- name: Upload plugin binary
203+
uses: actions/upload-artifact@v2
204+
with:
205+
name: binaries
206+
path: tests/elfs/ethereum_nanosp.elf
207+
208+
job_build_ethereum_nano_x:
209+
name: Build Ethereum application for Nano X testing
210+
runs-on: ubuntu-latest
211+
container:
212+
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
213+
steps:
214+
- name: Checkout app-ethereum
215+
uses: actions/checkout@v2
216+
with:
217+
repository: LedgerHQ/app-ethereum
218+
ref: ${{ ((github.base_ref || github.ref_name) == 'main' && 'master') || (github.base_ref || github.ref_name) }}
219+
submodules: recursive
220+
- name: Build ethereum
221+
run: |
222+
make clean
223+
make -j DEBUG=1 BYPASS_SIGNATURES=1 BOLOS_SDK=$NANOX_SDK CHAIN=ethereum ALLOW_DATA=1
224+
- name: Move binary to test directory
225+
run: |
226+
mkdir -p ./tests/elfs/
227+
mv bin/app.elf ./tests/elfs/ethereum_nanox.elf
228+
- name: Upload plugin binary
229+
uses: actions/upload-artifact@v2
230+
with:
231+
name: binaries
232+
path: tests/elfs/ethereum_nanox.elf
233+
234+
jobs-e2e-tests:
235+
needs:
236+
- job_build_debug_nano_s
237+
- job_build_debug_nano_sp
238+
- job_build_debug_nano_x
239+
- job_build_ethereum_nano_s
240+
- job_build_ethereum_nano_sp
241+
- job_build_ethereum_nano_x
242+
runs-on: ubuntu-latest
243+
steps:
244+
- name: Test
245+
run: |
246+
id
247+
echo $HOME
248+
echo $DISPLAY
249+
- name: Checkout
250+
uses: actions/checkout@v2
251+
- name: Download built binaries
252+
uses: actions/download-artifact@v2
253+
with:
254+
name: binaries
255+
path: tests/elfs/
256+
- name: Check downloaded binaries
257+
run: ls -lh ./tests/elfs
258+
- run: sudo apt-get update -y && sudo apt-get install -y libusb-1.0.0 libudev-dev
259+
- name: Install node
260+
uses: actions/setup-node@v2
261+
with:
262+
node-version: "16.4.0"
263+
- name: Install yarn
264+
run: |
265+
npm install -g yarn
266+
- name: Build/Install build js deps
267+
run: |
268+
cd tests && yarn install
269+
- name: Run zemu tests
270+
run: |
271+
cd tests && yarn test

.github/workflows/lint-workflow.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Code style check
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- develop
8+
pull_request:
9+
branches:
10+
- main
11+
- develop
12+
13+
jobs:
14+
job_lint:
15+
name: Lint
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Clone
20+
uses: actions/checkout@v2
21+
22+
- name: Lint
23+
uses: DoozyX/[email protected]
24+
with:
25+
source: "./"
26+
extensions: "h,c"
27+
clangFormatVersion: 12.0.0

.gitignore

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Compilation of Ledger's app
2+
src/glyphs.c
3+
src/glyphs.h
4+
bin/
5+
debug/
6+
dep/
7+
obj/
8+
tests/elfs/
9+
10+
# Editors
11+
.idea/
12+
13+
# Python
14+
*.pyc[cod]
15+
*.egg
16+
__pycache__/
17+
*.egg-info/
18+
.eggs/
19+
.python-version
20+
21+
# JS
22+
tests/node_modules
23+
tests/lib
24+
tests/snapshots-tmp

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "ethereum-plugin-sdk"]
2+
path = ethereum-plugin-sdk
3+
url = https://github.com/LedgerHQ/ethereum-plugin-sdk

CHANGELOG.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [1.1.2](https://github.com/ledgerhq/app-ethereum/compare/1.1.1...1.1.2) - 2021-10-12
9+
10+
### Fixed
11+
12+
- Network ticker is correctly displayed for sidechains
13+
14+
## [1.1.1](https://github.com/ledgerhq/app-ethereum/compare/1.1.0...1.1.1) - 2021-9-17
15+
16+
### Fixed
17+
18+
- Fixed derivation curve access
19+
20+
## [1.1.0](https://github.com/ledgerhq/app-ethereum/compare/1.0.6...1.1.0) - 2021-9-16
21+
22+
### Added
23+
24+
- Update to work with the latest plugin sdk
25+
26+
### Fixed
27+
28+
- Fixed derivation path access
29+
30+
## [1.0.6] - 2021-06-08
31+
32+
### Added
33+
34+
- Inital version of the brand new Paraswap plugin for Ethereum application.

0 commit comments

Comments
 (0)