Skip to content

Commit

Permalink
Ledger 2.0+ compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
btclinux committed Jun 7, 2022
1 parent ae1d2ec commit 59c4f78
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
15 changes: 7 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ endif
include $(BOLOS_SDK)/Makefile.defines

APPNAME = Burstcoin
DEFINES = "PATH_PREFIX={44|0x80000000,30|0x80000000}"
DEFINES += "PATH_PREFIX={44|0x80000000,30|0x80000000}"
PATH_PREFIX = "44'/30'"
DEFINES += APP_PREFIX=\"BURST-\"

ifeq ($(TARGET_NAME),TARGET_NANOX)
ICONNAME = icons/nanox_app_burst.gif
else
Expand All @@ -46,22 +46,22 @@ $(info Building $(APPNAME) app...)

#This inits the SDK_SOURCE_PATH variable, moving this will screw up the build, because the next if does +=
SDK_SOURCE_PATH = lib_stusb lib_stusb_impl lib_u2f lib_ux
APP_LOAD_PARAMS = --curve ed25519 $(COMMON_LOAD_PARAMS)
APP_LOAD_PARAMS = --curve ed25519 $(COMMON_LOAD_PARAMS)

# Ledger: add the "Pending security review" disclaimer
APP_LOAD_PARAMS += --tlvraw 9F:01

ifeq ($(TARGET_NAME),TARGET_NANOX)
SDK_SOURCE_PATH += lib_blewbxx lib_blewbxx_impl

# The --appFlags param gives permision to open bluetooth
APP_LOAD_PARAMS += --appFlags 0x0200

DEFINES += HAVE_BLE BLE_COMMAND_TIMEOUT_MS=2000
DEFINES += IO_SEPROXYHAL_BUFFER_SIZE_B=300
DEFINES += HAVE_BLE BLE_COMMAND_TIMEOUT_MS=2000
DEFINES += HAVE_BLE_APDU # basic ledger apdu transport over BLE

DEFINES += HAVE_GLO096
DEFINES += BAGL_WIDTH=128 BAGL_HEIGHT=64
DEFINES += HAVE_BAGL_ELLIPSIS # long label truncation feature
Expand All @@ -71,7 +71,7 @@ ifeq ($(TARGET_NAME),TARGET_NANOX)
else
# Since we don't have bluetooth in NanoS we set --appFlags to 0
APP_LOAD_PARAMS += --appFlags 0x0000

DEFINES += IO_SEPROXYHAL_BUFFER_SIZE_B=128
endif

Expand Down Expand Up @@ -172,4 +172,3 @@ include $(BOLOS_SDK)/Makefile.glyphs
include $(BOLOS_SDK)/Makefile.rules

dep/%.d: %.c Makefile

5 changes: 4 additions & 1 deletion src/burst.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
* limitations under the License.
********************************************************************************/

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

uint64_t public_key_to_id(const uint8_t * const publicKey);

Expand Down Expand Up @@ -48,7 +51,7 @@ typedef struct {
uint64_t fee; //What it says it is

int32_t attachmentTempInt32Num1, attachmentTempInt32Num2; //Different attachments parse in different ways, they all need space in state, so this is how it's defined
int64_t attachmentTempInt64Num1, attachmentTempInt64Num2, attachmentTempInt64Num3;
int64_t attachmentTempInt64Num1, attachmentTempInt64Num2, attachmentTempInt64Num3;

char feeText[21]; //9,223,372,036,854,775,807 is the biggest number you can hold in uint64 + the dot + null terminator means the longest text is 20
char txnTypeText[60]; //Aproximation of size
Expand Down

0 comments on commit 59c4f78

Please sign in to comment.