Skip to content

Commit

Permalink
Merge pull request #20 from blooo-io/refactor/LDG-411update-plugin-fr…
Browse files Browse the repository at this point in the history
…amework

Update plugin framework
  • Loading branch information
Z4karia authored Jan 18, 2024
2 parents e0d936e + ea38e12 commit a0a628d
Show file tree
Hide file tree
Showing 233 changed files with 33 additions and 307 deletions.
8 changes: 8 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# 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/embedded-app/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 -->
30 changes: 3 additions & 27 deletions .github/workflows/check_sdk.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,16 @@
---
name: Check SDK submodule version

on:
workflow_dispatch:
push:
branches:
- master
- main
- develop
pull_request:

jobs:
job_check_SDK:
name: Check Ethereum plugin SDK submodule is up-to-date
runs-on: ubuntu-latest
steps:
- name: Clone plugin
uses: actions/checkout@v3
with:
submodules: recursive
- name: Clone SDK
uses: actions/checkout@v3
with:
repository: LedgerHQ/ethereum-plugin-sdk
path: plugin-sdk
ref: ${{ github.base_ref || github.ref_name }}
- name: Comparing the SDK hash values
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
REPO_SDK_HASH=$(git submodule status | grep sdk | cut -d ' ' -f2)
echo "SDK submodule hash: ${REPO_SDK_HASH} (checked out from '${{ github.base_ref || github.ref_name }}')"
CURRENT_SDK_HASH=$(cd ./plugin-sdk/ && git rev-parse HEAD)
echo "SDK submodule hash: ${CURRENT_SDK_HASH}"
if [ ${REPO_SDK_HASH} = ${CURRENT_SDK_HASH} ]
then
echo "SDK versions match!"
exit 0
else
echo "SDK versions mismatch!"
exit 1
fi
uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_check_ethereum_sdk.yml@v1
4 changes: 1 addition & 3 deletions .github/workflows/lint-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ on:
push:
branches:
- main
- master
- develop
pull_request:
branches:
- main
- develop

jobs:
job_lint:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ build

# Editors
.idea/
.vscode

# Python
*.pyc[cod]
Expand Down
123 changes: 4 additions & 119 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ****************************************************************************
# Ledger App Boilerplate
# Ledger Ethereum Plugin Boilerplate
# (c) 2023 Ledger SAS.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -15,127 +15,12 @@
# limitations under the License.
# ****************************************************************************

ifeq ($(BOLOS_SDK),)
$(error Environment variable BOLOS_SDK is not set)
endif

include $(BOLOS_SDK)/Makefile.defines

########################################
# Mandatory configuration #
########################################
# Application name
APPNAME = "StakeKit"

# Application version
APPVERSION_M = 1
APPVERSION_N = 0
APPVERSION_P = 1
APPVERSION = "$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)"

# Initialize plugin SDK submodule if needed
ifneq ($(shell git submodule status | grep '^[-+]'),)
$(info INFO: Need to reinitialize git submodules)
$(shell git submodule update --init)
endif

ifeq ($(ETHEREUM_PLUGIN_SDK),)
ETHEREUM_PLUGIN_SDK=ethereum-plugin-sdk
endif

# Application source files
APP_SOURCE_PATH += src $(ETHEREUM_PLUGIN_SDK)

# Application icons following guidelines:
# https://developers.ledger.com/docs/embedded-app/design-requirements/#device-icon
ICON_ID = $(shell echo -n "$(APPNAME)" | tr " " "_" | tr "[:upper:]" "[:lower:]")
ICON_NANOS = icons/nanos_app_$(ICON_ID).gif
ICON_NANOX = icons/nanox_app_$(ICON_ID).gif
ICON_NANOSP = $(ICON_NANOX)
ICON_STAX = icons/stax_app_$(ICON_ID).gif

ifeq ($(TARGET_NAME),TARGET_STAX)
DEFINES += ICONGLYPH=C_stax_$(ICON_ID)_64px
DEFINES += ICONBITMAP=C_stax_$(ICON_ID)_64px_bitmap
endif

# Application allowed derivation curves.
# Possibles curves are: secp256k1, secp256r1, ed25519 and bls12381g1
# If your app needs it, you can specify multiple curves by using:
# `CURVE_APP_LOAD_PARAMS = <curve1> <curve2>`
CURVE_APP_LOAD_PARAMS = secp256k1

# Application allowed derivation paths.
# You should request a specific path for your app.
# This serve as an isolation mechanism.
# Most application will have to request a path according to the BIP-0044
# and SLIP-0044 standards.
# If your app needs it, you can specify multiple path by using:
# `PATH_APP_LOAD_PARAMS = "44'/1'" "45'/1'"`
PATH_APP_LOAD_PARAMS = "44'/60'" # purpose=coin(44) / coin_type=Testnet(1)

# Setting to allow building variant applications
# - <VARIANT_PARAM> is the name of the parameter which should be set
# to specify the variant that should be build.
# - <VARIANT_VALUES> a list of variant that can be build using this app code.
# * It must at least contains one value.
# * Values can be the app ticker or anything else but should be unique.
VARIANT_PARAM = COIN
VARIANT_VALUES = stakekit

# Enabling DEBUG flag will enable PRINTF and disable optimizations
DEBUG := 0
DISABLE_DEBUG_LEDGER_ASSERT = 1
DISABLE_DEBUG_THROW = 1
ifneq ($(DEBUG),0)
ifneq ($(TARGET_NAME),TARGET_NANOS)
DEFINES += HAVE_PRINTF PRINTF=mcu_usb_printf
else
DEFINES += HAVE_PRINTF PRINTF=screen_printf
endif
else
DEFINES += PRINTF\(...\)=
endif

########################################
# Application custom permissions #
########################################
# See SDK `include/appflags.h` for the purpose of each permission
#HAVE_APPLICATION_FLAG_DERIVE_MASTER = 1
#HAVE_APPLICATION_FLAG_GLOBAL_PIN = 1
#HAVE_APPLICATION_FLAG_BOLOS_SETTINGS = 1
HAVE_APPLICATION_FLAG_LIBRARY = 1

########################################
# Application communication interfaces #
########################################
#ENABLE_BLUETOOTH = 1
#ENABLE_NFC = 1

########################################
# NBGL custom features #
########################################
#ENABLE_NBGL_QRCODE = 1
#ENABLE_NBGL_KEYBOARD = 1
#ENABLE_NBGL_KEYPAD = 1

########################################
# Features disablers #
########################################
# These advanced settings allow to disable some feature that are by
# default enabled in the SDK `Makefile.standard_app`.

DISABLE_STANDARD_APP_FILES = 1

# To allow custom size declaration
#DISABLE_DEFAULT_IO_SEPROXY_BUFFER_SIZE = 1

# Will set all the following disablers
#DISABLE_STANDARD_APP_DEFINES = 1

DISABLE_STANDARD_SNPRINTF = 1
#DISABLE_STANDARD_USB = 1
DISABLE_STANDARD_WEBUSB = 1
DISABLE_STANDARD_BAGL_UX_FLOW = 1
APPVERSION_N = 1
APPVERSION_P = 0

include $(BOLOS_SDK)/Makefile.standard_app
include ethereum-plugin-sdk/standard_plugin.mk
Binary file added glyphs/stax_stakekit_64px.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
142 changes: 0 additions & 142 deletions src/main.c

This file was deleted.

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.
Binary file modified tests/snapshots/arbitrum_nanosp_arbitrum_angle_deposit/00005.png
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.
Binary file modified tests/snapshots/avalanche_nanosp_avalanche_redeem_1/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/avalanche_nanosp_avalanche_redeem_1/00002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/avalanche_nanosp_avalanche_redeem_1/00004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/avalanche_nanosp_avalanche_redeem_1/00006.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/avalanche_nanosp_avalanche_redeem_2/00001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/avalanche_nanosp_avalanche_redeem_2/00004.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/snapshots/avalanche_nanosp_avalanche_redeem_2/00006.png
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.
Binary file modified tests/snapshots/avalanche_nanosp_avalanche_submit/00001.png
Binary file modified tests/snapshots/avalanche_nanosp_avalanche_submit/00002.png
Binary file modified tests/snapshots/avalanche_nanosp_avalanche_submit/00004.png
Binary file modified tests/snapshots/avalanche_nanosp_avalanche_submit/00006.png
Binary file modified tests/snapshots/bsc_nanosp_bsc_transfer_out/00001.png
Binary file modified tests/snapshots/bsc_nanosp_bsc_transfer_out/00002.png
Binary file modified tests/snapshots/bsc_nanosp_bsc_transfer_out/00005.png
Binary file modified tests/snapshots/bsc_nanosp_bsc_transfer_out/00007.png
Binary file modified tests/snapshots/celo_nanosp_celo_create_account/00001.png
Binary file modified tests/snapshots/celo_nanosp_celo_create_account/00002.png
Binary file modified tests/snapshots/celo_nanosp_celo_create_account/00004.png
Binary file modified tests/snapshots/celo_nanosp_celo_create_account/00006.png
Binary file modified tests/snapshots/celo_nanosp_celo_lock/00001.png
Binary file modified tests/snapshots/celo_nanosp_celo_lock/00002.png
Binary file modified tests/snapshots/celo_nanosp_celo_lock/00004.png
Binary file modified tests/snapshots/celo_nanosp_celo_lock/00006.png
Binary file modified tests/snapshots/celo_nanosp_celo_revoke_active/00001.png
Binary file modified tests/snapshots/celo_nanosp_celo_revoke_active/00007.png
Binary file modified tests/snapshots/celo_nanosp_celo_revoke_active/00009.png
Binary file modified tests/snapshots/celo_nanosp_celo_unlock/00001.png
Binary file modified tests/snapshots/celo_nanosp_celo_unlock/00004.png
Binary file modified tests/snapshots/celo_nanosp_celo_unlock/00006.png
Binary file modified tests/snapshots/celo_nanosp_celo_vote/00001.png
Binary file modified tests/snapshots/celo_nanosp_celo_vote/00007.png
Binary file modified tests/snapshots/celo_nanosp_celo_vote/00009.png
Binary file modified tests/snapshots/ethereum_nanosp_ethereum_angle_deposit/00004.png
Binary file modified tests/snapshots/ethereum_nanosp_ethereum_buy_voucher/00001.png
Binary file modified tests/snapshots/ethereum_nanosp_ethereum_buy_voucher/00002.png
Binary file modified tests/snapshots/ethereum_nanosp_ethereum_buy_voucher/00003.png
Binary file modified tests/snapshots/ethereum_nanosp_ethereum_buy_voucher/00005.png
Binary file modified tests/snapshots/ethereum_nanosp_ethereum_claim_tokens/00001.png
Binary file modified tests/snapshots/ethereum_nanosp_ethereum_claim_tokens/00003.png
Binary file modified tests/snapshots/ethereum_nanosp_ethereum_claim_tokens/00005.png
Binary file modified tests/snapshots/ethereum_nanosp_ethereum_comet_supply/00001.png
Binary file modified tests/snapshots/ethereum_nanosp_ethereum_comet_supply/00002.png
Binary file modified tests/snapshots/ethereum_nanosp_ethereum_comet_supply/00003.png
Binary file modified tests/snapshots/ethereum_nanosp_ethereum_comet_supply/00005.png
Binary file modified tests/snapshots/ethereum_nanosp_ethereum_enter/00001.png
Binary file modified tests/snapshots/ethereum_nanosp_ethereum_enter/00002.png
Binary file modified tests/snapshots/ethereum_nanosp_ethereum_enter/00003.png
Binary file modified tests/snapshots/ethereum_nanosp_ethereum_enter/00005.png
Binary file modified tests/snapshots/ethereum_nanosp_ethereum_grt_delegate/00001.png
Binary file modified tests/snapshots/ethereum_nanosp_ethereum_grt_delegate/00002.png
Binary file modified tests/snapshots/ethereum_nanosp_ethereum_grt_delegate/00004.png
Binary file modified tests/snapshots/ethereum_nanosp_ethereum_grt_delegate/00006.png
Binary file modified tests/snapshots/ethereum_nanosp_ethereum_leave/00001.png
Binary file modified tests/snapshots/ethereum_nanosp_ethereum_leave/00002.png
Binary file modified tests/snapshots/ethereum_nanosp_ethereum_leave/00003.png
Binary file modified tests/snapshots/ethereum_nanosp_ethereum_leave/00005.png
Binary file modified tests/snapshots/ethereum_nanosp_ethereum_stake/00001.png
Binary file modified tests/snapshots/ethereum_nanosp_ethereum_stake/00002.png
Binary file modified tests/snapshots/ethereum_nanosp_ethereum_stake/00003.png
Binary file modified tests/snapshots/ethereum_nanosp_ethereum_stake/00005.png
Binary file modified tests/snapshots/ethereum_nanosp_ethereum_swap_from/00001.png
Binary file modified tests/snapshots/ethereum_nanosp_ethereum_swap_from/00002.png
Binary file modified tests/snapshots/ethereum_nanosp_ethereum_swap_from/00004.png
Binary file modified tests/snapshots/ethereum_nanosp_ethereum_swap_from/00006.png
Binary file modified tests/snapshots/ethereum_nanosp_ethereum_swap_to/00001.png
Binary file modified tests/snapshots/ethereum_nanosp_ethereum_swap_to/00003.png
Binary file modified tests/snapshots/ethereum_nanosp_ethereum_swap_to/00005.png
Binary file modified tests/snapshots/fantom_nanosp_yearn_vault_deposit_1/00001.png
Binary file modified tests/snapshots/fantom_nanosp_yearn_vault_deposit_1/00002.png
Binary file modified tests/snapshots/fantom_nanosp_yearn_vault_deposit_1/00004.png
Binary file modified tests/snapshots/fantom_nanosp_yearn_vault_deposit_1/00006.png
Binary file modified tests/snapshots/fantom_nanosp_yearn_vault_deposit_2/00001.png
Binary file modified tests/snapshots/fantom_nanosp_yearn_vault_deposit_2/00002.png
Binary file modified tests/snapshots/fantom_nanosp_yearn_vault_deposit_2/00004.png
Binary file modified tests/snapshots/fantom_nanosp_yearn_vault_deposit_2/00006.png
Binary file modified tests/snapshots/fantom_nanosp_yearn_vault_deposit_3/00001.png
Binary file modified tests/snapshots/fantom_nanosp_yearn_vault_deposit_3/00002.png
Binary file modified tests/snapshots/fantom_nanosp_yearn_vault_deposit_3/00005.png
Binary file modified tests/snapshots/fantom_nanosp_yearn_vault_deposit_3/00007.png
Binary file modified tests/snapshots/polygon_nanosp_polygon_aave_v3_supply/00001.png
Binary file modified tests/snapshots/polygon_nanosp_polygon_aave_v3_supply/00002.png
Binary file modified tests/snapshots/polygon_nanosp_polygon_aave_v3_supply/00005.png
Binary file modified tests/snapshots/polygon_nanosp_polygon_aave_v3_supply/00007.png
Binary file modified tests/snapshots/polygon_nanosp_polygon_comet_claim/00001.png
Binary file modified tests/snapshots/polygon_nanosp_polygon_comet_claim/00003.png
Binary file modified tests/snapshots/polygon_nanosp_polygon_comet_claim/00005.png
Binary file modified tests/snapshots/polygon_nanosp_polygon_comet_claim/00007.png
Binary file modified tests/snapshots/polygon_nanosp_polygon_comet_withdraw/00001.png
Binary file modified tests/snapshots/polygon_nanosp_polygon_comet_withdraw/00004.png
Binary file modified tests/snapshots/polygon_nanosp_polygon_comet_withdraw/00006.png
Binary file modified tests/snapshots/tomochain_nanosp_tomochain_vic_vote_1/00001.png
Binary file modified tests/snapshots/tomochain_nanosp_tomochain_vic_vote_1/00004.png
Binary file modified tests/snapshots/tomochain_nanosp_tomochain_vic_vote_1/00006.png
32 changes: 16 additions & 16 deletions tests/src/fantom/fantom_yearn_vault_withdraw.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@ const chainID = 250;


const transactions = [
// {
// // From : https://ftmscan.com/tx/0x0886b343f22515ceeec557ab3a810aab99d296eefed5a402dd0022c1d2984591
// inputData: '0x3ccfd60b',
// nanoStep: 7,
// nanoSPtep: 5,
// nanoXtep: 5,
// index: 1,
// },
// {
// // From : https://ftmscan.com/tx/0x64c9853386866501f3fee802b269b50588832524a0fa7db8d62b9d05443ccedf
// inputData: '0x2e1a7d4d0000000000000000000000000000000000000000000000000000000011297cb7',
// nanoStep: 5,
// nanoSPtep: 5,
// nanoXtep: 5,
// index: 2,
// },
{
// From : https://ftmscan.com/tx/0x0886b343f22515ceeec557ab3a810aab99d296eefed5a402dd0022c1d2984591
inputData: '0x3ccfd60b',
nanoStep: 7,
nanoSPtep: 5,
nanoXtep: 5,
index: 1,
},
{
// From : https://ftmscan.com/tx/0x64c9853386866501f3fee802b269b50588832524a0fa7db8d62b9d05443ccedf
inputData: '0x2e1a7d4d0000000000000000000000000000000000000000000000000000000011297cb7',
nanoStep: 5,
nanoSPtep: 5,
nanoXtep: 5,
index: 2,
},
{
// From : https://ftmscan.com/tx/0xcb0590a2bd4ad4796bfd539f0ccce805ab2555d90b7a38369940701f2f20c0d5
inputData: '0x00f714ce00000000000000000000000000000000000000000000000000000000000e643f000000000000000000000000b6c5273e79e2add234ebc07d87f3824e0f94b2f7',
Expand Down

0 comments on commit a0a628d

Please sign in to comment.