forked from vacuumlabs/ledger-app-cardano-shelley
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #82 from LedgerHQ/cev/B2CA-1838_implement-swap
B2CA-1838: Implement swap
- Loading branch information
Showing
343 changed files
with
39,489 additions
and
31,715 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
BasedOnStyle: Google | ||
IndentWidth: 4 | ||
Language: Cpp | ||
ColumnLimit: 100 | ||
PointerAlignment: Right | ||
AlignAfterOpenBracket: Align | ||
AlignConsecutiveMacros: true | ||
AllowAllParametersOfDeclarationOnNextLine: false | ||
SortIncludes: false | ||
SpaceAfterCStyleCast: true | ||
AllowShortCaseLabelsOnASingleLine: false | ||
AllowAllArgumentsOnNextLine: false | ||
AllowShortBlocksOnASingleLine: Never | ||
AllowShortFunctionsOnASingleLine: None | ||
BinPackArguments: false | ||
BinPackParameters: false | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,4 @@ pushd fuzzing | |
cmake -DBOLOS_SDK=../BOLOS_SDK -Bbuild -H. | ||
make -C build | ||
mv build/*_harness $OUT | ||
popd | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
language: c | ||
language: c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
# Checklist | ||
|
||
<!-- Put an `x` in each box when you have completed the items. --> | ||
|
||
- [ ] App update process has been followed <!-- See comment below --> | ||
- [ ] Target branch is `develop` <!-- unless you have a very good reason --> | ||
- [ ] Application version has been bumped <!-- required if your changes are to be deployed --> | ||
|
||
<!-- Make sure you followed the process described in https://developers.ledger.com/docs/device-app/deliver/maintenance before opening your Pull Request. | ||
<!-- Make sure you followed the process described in https://developers.ledger.com/docs/device-app/deliver/maintenance | ||
before opening your Pull Request. | ||
Don't hesitate to contact us directly on Discord if you have any questions ! https://developers.ledger.com/discord --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Build and run functional tests using ragger through reusable workflow | ||
|
||
# This workflow will build the app and then run functional tests using the Ragger framework upon Speculos emulation. | ||
# It calls a reusable workflow developed by Ledger's internal developer team to build the application and upload the | ||
# resulting binaries. | ||
# It then calls another reusable workflow to run the Ragger tests on the compiled application binary. | ||
# | ||
# While this workflow is optional, having functional testing on your application is mandatory and this workflow and | ||
# tooling environment is meant to be easy to use and adapt after forking your application | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
golden_run: | ||
type: choice | ||
required: true | ||
default: 'Raise an error (default)' | ||
description: CI behavior if the test snapshots are different than expected. | ||
options: | ||
- 'Raise an error (default)' | ||
- 'Open a PR' | ||
push: | ||
branches: | ||
- master | ||
- develop | ||
pull_request: | ||
|
||
jobs: | ||
build_application: | ||
name: Build application using the reusable workflow | ||
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_build.yml@v1 | ||
with: | ||
upload_app_binaries_artifact: "compiled_app_binaries" | ||
|
||
ragger_tests: | ||
name: Run ragger tests using the reusable workflow | ||
needs: build_application | ||
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_ragger_tests.yml@v1 | ||
with: | ||
download_app_binaries_artifact: "compiled_app_binaries" | ||
regenerate_snapshots: ${{ inputs.golden_run == 'Open a PR' }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,4 +38,3 @@ jobs: | |
fuzz-seconds: 300 # 5 minutes | ||
mode: ${{ matrix.mode }} | ||
sanitizer: ${{ matrix.sanitizer }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Run coding style check through reusable workflow | ||
|
||
# This workflow will run linting checks to ensure a level of uniformization among all Ledger applications. | ||
# | ||
# The presence of this workflow is mandatory as a minimal level of linting is required. | ||
# You are however free to modify the content of the .clang-format file and thus the coding style of your application. | ||
# We simply ask you to not diverge too much from the linting of the Boilerplate application. | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
- develop | ||
pull_request: | ||
|
||
jobs: | ||
check_linting: | ||
name: Check linting using the reusable workflow | ||
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_lint.yml@v1 | ||
with: | ||
source: './src' | ||
extensions: 'h,c' | ||
version: 11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Misspellings checks | ||
|
||
# This workflow performs some misspelling checks on the repository | ||
# It is there to help us maintain a level of quality in our codebase and does not have to be kept on forked | ||
# applications. | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
- develop | ||
pull_request: | ||
|
||
jobs: | ||
misspell: | ||
name: Check misspellings | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Clone | ||
uses: actions/checkout@v4 | ||
|
||
- name: Check misspellings | ||
uses: codespell-project/actions-codespell@v2 | ||
with: | ||
builtin: clear,rare | ||
check_filenames: true | ||
ignore_words_list: cips |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Checks on the Python client | ||
|
||
# This workflow performs some checks on the Python client used by the Application tests | ||
# It is there to help us maintain a level of quality in our codebase and does not have to be kept on forked | ||
# applications. | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
- develop | ||
pull_request: | ||
|
||
jobs: | ||
lint: | ||
name: Client linting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Clone | ||
uses: actions/checkout@v4 | ||
- name: Installing PIP dependencies | ||
run: | | ||
pip install pylint | ||
pip install -r tests/requirements.txt | ||
- name: Lint Python code | ||
run: | | ||
pylint --rc tests/setup.cfg tests/application_client/ | ||
mypy: | ||
name: Type checking | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Clone | ||
uses: actions/checkout@v4 | ||
- name: Installing PIP dependencies | ||
run: | | ||
pip install mypy | ||
pip install -r tests/requirements.txt | ||
- name: Mypy type checking | ||
run: | | ||
mypy tests/application_client/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
name: Swap functional tests | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
- develop | ||
pull_request: | ||
|
||
jobs: | ||
job_functional_tests: | ||
uses: LedgerHQ/app-exchange/.github/workflows/reusable_swap_functional_tests.yml@develop | ||
with: | ||
branch_for_cardano: ${{ github.ref }} | ||
test_filter: '"ADA or ada or Cardano or cardano"' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,24 @@ | ||
ledger | ||
bin | ||
# Compilation files of the application | ||
build | ||
|
||
# Legacy compilation output | ||
bin | ||
debug | ||
dep | ||
obj | ||
src/u2f_crypto_data.h | ||
src/glyphs.h | ||
src/glyphs.c | ||
.vscode | ||
|
||
# Temporary directory with snapshots taken during test runs | ||
tests/snapshots-tmp/ | ||
|
||
# Fuzzing | ||
fuzz/build | ||
fuzz/corpus | ||
fuzz/coverage | ||
|
||
# Python | ||
__pycache__/ | ||
venv/ | ||
|
||
# IDE | ||
.vscode | ||
|
||
# Virtual env for sideload (macOS and Windows) | ||
ledger/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Style file for mdl | ||
# https://github.com/markdownlint/markdownlint/blob/main/docs/creating_styles.md | ||
|
||
# Include all rules | ||
all | ||
|
||
# Disable specific rules | ||
#exclude_rule 'MD012' | ||
|
||
# Update rules configuration | ||
rule 'MD013', :line_length => 130, :tables => false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# markdownlint config file | ||
|
||
# Use custom style file | ||
style "#{File.dirname(__FILE__)}/.mdl.rb" | ||
|
||
# MD005 - Inconsistent indentation for list items at the same level | ||
# MD007 - Unordered list indentation | ||
# MD014 - Dollar signs used before commands without showing output | ||
# MD024 - Multiple headers with the same content | ||
# MD041 - First line in file should be a top level header | ||
# MD036 - Emphasis used instead of a header | ||
# MD029 - Ordered list item prefix | ||
rules "~MD005,~MD007,~MD014,~MD024,~MD041,~MD036,~MD029" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# To install hooks, run: | ||
# pre-commit install --hook-type pre-commit | ||
# pre-commit install --hook-type commit-msg | ||
|
||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v5.0.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: mixed-line-ending | ||
- id: check-added-large-files | ||
- id: check-merge-conflict | ||
- id: check-case-conflict | ||
|
||
- repo: https://github.com/codespell-project/codespell | ||
rev: v2.3.0 | ||
hooks: | ||
- id: codespell | ||
args: ['--ignore-words-list', 'cips'] | ||
|
||
- repo: https://github.com/pre-commit/mirrors-clang-format | ||
rev: v11.0.1 | ||
hooks: | ||
- id: clang-format | ||
types_or: [c] | ||
|
||
- repo: https://github.com/Mateusz-Grzelinski/actionlint-py | ||
rev: v1.7.3.17 | ||
hooks: | ||
- id: actionlint | ||
types_or: [yaml] | ||
args: [-shellcheck="" -pyflakes=""] | ||
|
||
|
||
- repo: https://github.com/markdownlint/markdownlint | ||
rev: v0.13.0 | ||
hooks: | ||
- id: markdownlint | ||
types_or: [markdown] | ||
|
||
- repo: local | ||
hooks: | ||
|
||
# Python scripts | ||
- id: pylint | ||
name: Check python Client | ||
# Only display messages, no score, disable few errors | ||
entry: pylint -j 0 --rc tests/setup.cfg | ||
language: system | ||
types: [python] | ||
files: '^tests\/.*$' |
Oops, something went wrong.