From d414819b04ee780956ab80b8c477e8509f115264 Mon Sep 17 00:00:00 2001 From: Alexandre Paillier Date: Thu, 19 Oct 2023 11:42:03 +0200 Subject: [PATCH 1/2] Revert plugin SDK version --- ethereum-plugin-sdk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethereum-plugin-sdk b/ethereum-plugin-sdk index 06ca39d60..b9777e7a8 160000 --- a/ethereum-plugin-sdk +++ b/ethereum-plugin-sdk @@ -1 +1 @@ -Subproject commit 06ca39d60a14111966c28ad114886c8683264075 +Subproject commit b9777e7a81a9c33b3f8997ffa23396fa2b3f861d From bdec1cdc8c3c8441ea39a2922c5ffb321b738f66 Mon Sep 17 00:00:00 2001 From: Alexandre Paillier Date: Thu, 19 Oct 2023 11:40:48 +0200 Subject: [PATCH 2/2] Added missing plugin SDK changes --- src_plugin_sdk/CHANGELOG.md | 36 ++++++++++++++++++++++++++++++++++++ src_plugin_sdk/README.md | 18 ++++++++++++++++++ src_plugin_sdk/main.c | 2 +- tools/build_sdk.py | 9 ++++++++- 4 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 src_plugin_sdk/CHANGELOG.md create mode 100644 src_plugin_sdk/README.md diff --git a/src_plugin_sdk/CHANGELOG.md b/src_plugin_sdk/CHANGELOG.md new file mode 100644 index 000000000..d01453e61 --- /dev/null +++ b/src_plugin_sdk/CHANGELOG.md @@ -0,0 +1,36 @@ +# Ethereum Plugin SDK changelog + +| Icon | Impact | +|----------------------|-------------------------------| +| :rotating_light: | Breaks build | +| :warning: | Breaks compatibility with app | + +## [latest](/) - 2023/10/19 + +### Changed + +* Now only uses *\_no\_throw* functions, SDK functions now return a boolean +(keeps the guidelines enforcer happy) + +### Added + +* *main* & *dispatch\_call* functions are now part of the SDK and don't need to +be implemented by each plugin :rotating_light: + +## [b9777e7](/../../commit/b9777e7) - 2023/05/16 + +### Added + +* Stax support with information passed from plugin to app-ethereum (with caller app struct) + +## [a4b971f](/../../commit/a4b971f) - 2023/01/24 + +### Changed + +* Removed end space in tickers :warning: + +## [81eb658](/../../commit/81eb658) - 2022/11/17 + +### Added + +* *U2BE\_from\_parameter* & *U4BE\_from\_parameter* safe functions diff --git a/src_plugin_sdk/README.md b/src_plugin_sdk/README.md new file mode 100644 index 000000000..b183cab3b --- /dev/null +++ b/src_plugin_sdk/README.md @@ -0,0 +1,18 @@ +# ethereum-plugin-sdk + +This repository is meant to be linked as submodule and used in external plugins working with [app-ethereum](https://github.com/LedgerHQ/app-ethereum). +It is composed of a few headers containing definitions about app-ethereum's internal transaction parsing state and some structures to communicate via shared memory. + +## Updating this SDK + +This SDK is updated at (app-ethereum) build time every time one of app-ethereum internals structures of interest are modified. +If this SDK gets updated, it is possible that all plugins must be recompiled (and eventually updated to work again with the update) with this new SDK. +Be careful, and weight your choices. + +## Manual build + +If for some reasons you want to rebuild this SDK manually from [app-ethereum](https://github.com/LedgerHQ/app-ethereum) (reminder: it is rebuild automatically when building app-ethereum itself): + +```shell +$> python3 tools/build_sdk.py +``` diff --git a/src_plugin_sdk/main.c b/src_plugin_sdk/main.c index 76c3d4dac..f06a2bb60 100644 --- a/src_plugin_sdk/main.c +++ b/src_plugin_sdk/main.c @@ -27,7 +27,7 @@ void handle_query_contract_id(ethQueryContractID_t *parameters); void handle_query_contract_ui(ethQueryContractUI_t *parameters); // Calls the ethereum app. -void call_app_ethereum() { +static void call_app_ethereum() { unsigned int libcall_params[5]; libcall_params[0] = (unsigned int) "Ethereum"; libcall_params[1] = 0x100; diff --git a/tools/build_sdk.py b/tools/build_sdk.py index 225ef5d39..9f5775c32 100755 --- a/tools/build_sdk.py +++ b/tools/build_sdk.py @@ -213,7 +213,14 @@ def merge_c_files(sources, nodes_to_extract): "utils.c", "utils.h", ] - for file in files_to_copy: shutil.copyfile("src_plugin_sdk/" + file, "ethereum-plugin-sdk/include/" + file) + + files_to_copy = [ + "CHANGELOG.md", + "README.md", + ] + for file in files_to_copy: + shutil.copyfile("src_plugin_sdk/" + file, + "ethereum-plugin-sdk/" + file)