Skip to content

Commit

Permalink
Update plugin sdk build script to only copy files instead of cherry-p…
Browse files Browse the repository at this point in the history
…icking functions
  • Loading branch information
fbeutin-ledger committed Jan 18, 2024
1 parent b8402af commit 084fa26
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 284 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/sdk-generation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
persist-credentials: false

- name: Build new SDK
run: python tools/build_sdk.py
run: ./tools/build_sdk.sh

- name: Extract branch name
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ ifeq ($(CHAIN),ethereum)
endif

# rebuild SDK
$(shell python3 tools/build_sdk.py)
$(shell ./tools/build_sdk.sh)

# check if a difference is noticed (fail if it happens in CI build)
ifneq ($(shell git status | grep 'ethereum-plugin-sdk'),)
Expand Down
12 changes: 8 additions & 4 deletions src_common/eth_plugin_interface.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
// clang-format off

#ifndef _ETH_PLUGIN_INTERFACE_H_
#define _ETH_PLUGIN_INTERFACE_H_
#pragma once

#include "os.h"
#include "cx.h"

// Include other header compatible with plugins
#include "asset_info.h"
#include "caller_api.h"
#include "common_utils.h"
#include "tx_content.h"
#include "uint128.h"
#include "uint256.h"
#include "uint_common.h"

/*************************************************************************************************
* Comments provided in this file are quick reminders on the usage of the plugin interface *
Expand Down Expand Up @@ -217,6 +223,4 @@ typedef struct ethQueryContractUI_s {
} ethQueryContractUI_t;
// void handle_query_contract_ui(ethQueryContractUI_t *parameters);

#endif // _ETH_PLUGIN_INTERFACE_H_

// clang-format on
2 changes: 2 additions & 0 deletions src_common/plugin_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#include <stdint.h>
#include <stdbool.h>

#include "eth_plugin_interface.h"

#define SELECTOR_SIZE 4
#define PARAMETER_LENGTH 32

Expand Down
2 changes: 1 addition & 1 deletion src_plugin_sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ Be careful, and weight your choices.
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
$> ./tools/build_sdk.sh
```
28 changes: 0 additions & 28 deletions src_plugin_sdk/plugin_utils.c

This file was deleted.

27 changes: 0 additions & 27 deletions src_plugin_sdk/plugin_utils.h

This file was deleted.

File renamed without changes.
222 changes: 0 additions & 222 deletions tools/build_sdk.py

This file was deleted.

10 changes: 10 additions & 0 deletions tools/build_sdk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

# Clean the sdk
find ./ethereum-plugin-sdk/ -mindepth 1 -maxdepth 1 ! -name .git -exec rm -r {} \;

# Copy exclusive files
cp -r src_plugin_sdk/* ./ethereum-plugin-sdk/

# Copy common sources
cp -r src_common/* ./ethereum-plugin-sdk/src/

0 comments on commit 084fa26

Please sign in to comment.