Skip to content

Commit 4bd2401

Browse files
authored
Merge pull request #84 from ArkEcosystem/release/v2.1.0
release: 2.1.0
2 parents ff298d6 + 80e04ee commit 4bd2401

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+1395
-1146
lines changed

.codeclimate.yml

-16
This file was deleted.

.github/workflows/build.yml

+16
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,19 @@ jobs:
5858
BOLOS_ENV: /opt/bolos
5959
BOLOS_SDK: /opt/bolos/nanos-secure-sdk
6060
ARM_HOME: /opt/bolos/gcc-arm-none-eabi-5_3-2016q1
61+
62+
- name: Preparing Artifacts
63+
run: |
64+
mkdir ./.github/workflows/artifacts
65+
cp ./bin/app.hex ./.github/workflows/artifacts/
66+
cp ./examples/example_helper.py ./.github/workflows/artifacts/
67+
printf '#!/usr/bin/env bash\n\n# Artifact builds are for TESTING PURPOSES ONLY!\n# Never use this with personal funds.\n#\n# unzip the artifacts and run "bash ./flash.sh" to execute this script.\n#\n# Requirements:\n# - python3\n# - ledgerblue (pip3 install ledgerblue)\n#\n' >> ./.github/workflows/artifacts/flash.sh && printf "%s" 'python3 -m ledgerblue.loadApp --fileName app.hex --appName Ark --appFlags 0x240 --curve secp256k1 --path ' "\"44'/111'\"" ' --path ' "\"44'/1'\"" ' --targetId 0x31100004 --targetVersion="1.6.0" --icon "010000000000ffffffffffffffffffffff7ffe3ffc1ff89ff98ff1cff347e267e6ffffffffffffffff" --tlv --delete' >> ./.github/workflows/artifacts/flash.sh && printf '\n' >> ./.github/workflows/artifacts/flash.sh
68+
printf '#!/usr/bin/env bash\n\npython3 example_helper.py --publickey\n' >> ./.github/workflows/artifacts/publickey.sh
69+
printf '#!/usr/bin/env bash\n\npython3 example_helper.py --message 416c6c2070617274732073686f756c6420676f20746f67657468657220776974686f757420666f7263696e672e20596f75206d7573742072656d656d62657220746861742074686520706172747320796f7520617265207265617373656d626c696e67207765726520646973617373656d626c656420627920796f752e205468657265666f72652c20696620796f752063616e277420676574207468656d20746f67657468657220616761696e2c207468657265206d757374206265206120726561736f6e2e20427920616c6c206d65616e732c20646f206e6f742075736520612068616d6d65722e207e2049424d204d616e75616c202d20283139373529\n' >> ./.github/workflows/artifacts/message.sh
70+
printf '#!/usr/bin/env bash\n\npython3 example_helper.py --tx ff0217010000000000010000000000000003a02b9d5fdd1307c2ee4652ba54d492d1fd11a7d1bb3f3a44c4a05e79f19de933809698000000000000a08601000000000000000000171dfc69b54c7fe901e91d5a9ab78388645e2427ea\n' >> ./.github/workflows/artifacts/transfer.sh
71+
72+
- name: Uploading Artifacts
73+
uses: actions/upload-artifact@v2-preview
74+
with:
75+
name: app-artifact-${{ github.sha }}
76+
path: ./.github/workflows/artifacts/*

.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
1+
# IDE
2+
.vscode
3+
4+
# Ledger/BOLOS SDK
15
bin
26
debug
37
dep
48
obj
59
src/glyphs.c
610
src/glyphs.h
711

12+
# OS
813
.DS_Store
14+
15+
# Vagrant
16+
*console.log
17+
.vagrant

.vscode/settings.json

-21
This file was deleted.

CHANGELOG.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

8+
## [2.1.0] - 2020-04-06
9+
10+
### Added
11+
- support large operations ([#72])
12+
- support schnorr signatures ([#63])
13+
814
## [2.0.1] - 2020-02-08
915

1016
### Changed
@@ -38,4 +44,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
3844
[#55]: https://github.com/ArkEcosystem/ledger/pull/53
3945
[2.0.0]: https://github.com/ArkEcosystem/ledger/compare/master...2.0.0
4046
[#66]: https://github.com/ArkEcosystem/ledger/pull/66
41-
[2.0.1]: https://github.com/ArkEcosystem/ledger/compare/master...2.0.1
47+
[2.0.1]: https://github.com/ArkEcosystem/ledger/compare/2.0.0...2.0.1
48+
[#63]: https://github.com/ArkEcosystem/ledger/pull/63
49+
[#72]: https://github.com/ArkEcosystem/ledger/pull/72
50+
[2.1.0]: https://github.com/ArkEcosystem/ledger/compare/2.0.1...develop

Makefile

+4-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ APPNAME = Ark
5151
APP_LOAD_PARAMS=--appFlags 0x240 --curve secp256k1 --path "44'/111'" --path "44'/1'" $(COMMON_LOAD_PARAMS)
5252

5353
APPVERSION_M=2
54-
APPVERSION_N=0
55-
APPVERSION_P=1
54+
APPVERSION_N=1
55+
APPVERSION_P=0
5656
APPVERSION=$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)
5757

5858
ifeq ($(TARGET_NAME),TARGET_BLUE)
@@ -77,6 +77,8 @@ all: default
7777
# Platform #
7878
############
7979

80+
DEFINES += HAVE_BOLOS_SDK
81+
8082
DEFINES += OS_IO_SEPROXYHAL
8183
DEFINES += HAVE_BAGL HAVE_SPRINTF
8284
DEFINES += HAVE_IO_USB HAVE_L4_USBLIB IO_USB_MAX_ENDPOINTS=6 IO_HID_EP_LENGTH=64 HAVE_USB_APDU

Vagrantfile

+17-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Vagrant.configure("2") do |config|
22

3-
# Specify the base box
3+
# Specify the OS VM Box
44
config.vm.box = "ubuntu/bionic64"
55
config.vm.box_version = "20190814.0.0"
66

7-
# set the `app`, `examples`, `glyphs`, and `src` folders for syncing
7+
# Sync the 'app', 'examples', 'glyphs', and 'src' directories
88
config.vm.synced_folder("apps/", "/home/vagrant/apps/",
99
id: "appsdir",
1010
:create => true,
@@ -22,10 +22,19 @@ Vagrant.configure("2") do |config|
2222
:create => true,
2323
type: "virtualbox")
2424

25-
# copy the rebuild script and app Makefile to vagrant machine
25+
# Copy scripts and the Makefile to the VM
2626
config.vm.provision("file",
2727
source: "./scripts/rebuild.sh",
2828
destination: "/home/vagrant/apps/ledger-app-ark/scripts/")
29+
config.vm.provision("file",
30+
source: "./scripts/rebuild_nanos.sh",
31+
destination: "/home/vagrant/apps/ledger-app-ark/scripts/")
32+
config.vm.provision("file",
33+
source: "./scripts/rebuild_nanox.sh",
34+
destination: "/home/vagrant/apps/ledger-app-ark/scripts/")
35+
config.vm.provision("file",
36+
source: "./scripts/udev.sh",
37+
destination: "/home/vagrant/apps/ledger-app-ark/scripts/")
2938
config.vm.provision("file",
3039
source: "./Makefile",
3140
destination: "/home/vagrant/apps/ledger-app-ark/")
@@ -38,22 +47,22 @@ Vagrant.configure("2") do |config|
3847
source: "./icons/nanox_app_ark.gif",
3948
destination: "/home/vagrant/apps/ledger-app-ark/icons/")
4049

41-
# VM specific configs
50+
# VM configuration
4251
config.vm.provider "virtualbox" do |v|
4352
v.name = "ARK Ledger App Development Box"
4453
v.customize ["modifyvm", :id, "--memory", "1024"]
4554

46-
# Connect Ledger Nano S throug usb
55+
# Configure the Ledger Nano S/X USB connection
4756
v.customize ["modifyvm", :id, "--usb", "on"]
4857
v.customize ["modifyvm", :id, "--usbehci", "on"]
4958
v.customize ["usbfilter", "add", "0",
5059
"--target", :id,
51-
"--name", "Ledger Nano S",
60+
"--name", "Ledger Nano S/X",
5261
"--manufacturer", "Ledger",
53-
"--product", "Nano S"]
62+
"--product", "Nano S/X"]
5463
end
5564

56-
# Shell provisioning
65+
# Run the Provisioning script
5766
config.vm.provision "shell" do |s|
5867
s.path = "scripts/provision.sh"
5968
end

docs/INSTALLATION.md

+6-19
Original file line numberDiff line numberDiff line change
@@ -131,33 +131,20 @@ Connect the Ledger device in before flashing.
131131

132132
The Build and Flash commands are executed from project root:
133133

134-
**Vagrant Shell**:
134+
**Vagrant Shell**: `~/apps/ledger-app-ark`
135135

136-
* `apps/ledger-app-ark`
136+
### Rebuild Script
137137

138-
**ledgerblue CLI**:
139-
140-
* `ledger-app-ark`
141-
142-
### Building the Ledger ARK app
138+
#### NanoS
143139

144140
```shell
145-
make
141+
bash ./scripts/rebuild.sh
146142
```
147143

148-
### Flashing the Ledger ARK app
149-
150-
```shell
151-
make && make load
152-
```
153-
154-
### Rebuilding and Flashing Changes
155-
156-
This is the go-to script to push changes to a Ledger device.
157-
It cleans, builds, deletes and re-flashes the app.
144+
#### NanoX
158145

159146
```shell
160-
sh ./scripts/rebuild.sh
147+
bash ./scripts/rebuild.sh -x
161148
```
162149

163150
---

docs/payloads.md

-158
This file was deleted.

docs/unsupported/delegate_registration/delegate_registration_ux.c

+3-4
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ void displayDelegateRegistration(const Transaction *transaction) {
6666
transaction->asset.delegateRegistration.length);
6767

6868
// Fee
69-
printAmount(transaction->fee,
70-
(uint8_t *)displayCtx.text[1],
71-
sizeof(displayCtx.text[1]),
72-
TOKEN_NAME, TOKEN_NAME_SIZE, TOKEN_DECIMALS);
69+
TokenAmountToString(TOKEN_NAME, TOKEN_NAME_SIZE, TOKEN_DECIMALS,
70+
transaction->fee,
71+
displayCtx.text[1], sizeof(displayCtx.text[1]));
7372
}

docs/unsupported/delegate_registration/delegate_registration_ux.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@
3636
#ifndef ARK_OPERATIONS_TRANSACTIONS_UX_DELEGATE_REGISTRATION_UX_H
3737
#define ARK_OPERATIONS_TRANSACTIONS_UX_DELEGATE_REGISTRATION_UX_H
3838

39-
#include <stdint.h>
39+
#include <stddef.h>
4040

4141
#include "operations/transactions/transaction.h"
4242

4343
////////////////////////////////////////////////////////////////////////////////
44-
static const uint8_t STEPS_DELEGATE_REGISTRATION = 2U;
44+
static const size_t UX_DELEGATE_REGISTRATION_STEPS = 2U;
4545

4646
////////////////////////////////////////////////////////////////////////////////
4747
void displayDelegateRegistration(const Transaction *transaction);

docs/unsupported/delegate_registration/deserializer.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@
265265
// if (deserializeAsset(transaction,
266266
// &buffer[assetOffset],
267267
// size - assetOffset)) {
268-
// setDisplay(transaction);
268+
// SetUx(transaction);
269269
// return true;
270270
// }
271271

@@ -285,7 +285,7 @@
285285
// transaction->assetOffset = ASSET_OFFSET_LEGACY;
286286
// transaction->assetPtr = (uint8_t*)&buffer[transaction->assetOffset];
287287

288-
// setDisplayLegacy(transaction);
288+
// SetUxLegacy(transaction);
289289

290290
// return true;
291291
// }

docs/unsupported/delegate_registration/display_ux.c

+19-21
Original file line numberDiff line numberDiff line change
@@ -55,55 +55,53 @@
5555
// #include "display/display.h"
5656

5757
// ////////////////////////////////////////////////////////////////////////////////
58-
// extern void setDisplaySteps(uint8_t steps, bool isExtended);
58+
// extern void SetUxDisplay(size_t steps, bool isExtended);
5959

6060
// ////////////////////////////////////////////////////////////////////////////////
61-
// void setDisplay(const Transaction *transaction) {
61+
// void SetUx(const Transaction *transaction) {
6262
// explicit_bzero(&displayCtx, sizeof(displayCtx));
6363

64+
// const bool hasVendorField = transaction->vendorFieldLength > 0;
65+
6466
// switch (transaction->type) {
6567
// case TRANSFER_TYPE:
66-
// displayTransfer(transaction);
67-
// bool hasVendorField = transaction->vendorFieldLength > 0;
68-
// setDisplaySteps(STEPS_TRANSFER_MIN + (uint8_t)hasVendorField,
69-
// hasVendorField);
68+
// SetUxTransfer(transaction);
69+
// SetUxDisplay(UX_TRANSFER_STEPS + hasVendorField, hasVendorField);
7070
// break;
7171

7272
// case SECOND_SIGNATURE_TYPE:
73-
// displaySecondSignature(transaction);
74-
// setDisplaySteps(STEPS_SECOND_SIGNATURE, false);
73+
// SetUxSecondSignature(transaction);
74+
// SetUxDisplay(UX_SECOND_SIGNATURE_STEPS, false);
7575
// break;
7676

7777
case DELEGATE_REGISTRATION_TYPE:
7878
displayDelegateRegistration(transaction);
79-
setDisplaySteps(STEPS_DELEGATE_REGISTRATION, false);
79+
SetUxDisplay(UX_DELEGATE_REGISTRATION_STEPS, false);
8080
break;
8181

8282
// case VOTE_TYPE:
83-
// displayVote(transaction);
84-
// setDisplaySteps(STEPS_VOTE, false);
83+
// SetUxVote(transaction);
84+
// SetUxDisplay(UX_VOTE_STEPS, false);
8585
// break;
8686

8787
// case IPFS_TYPE:
88-
// displayIpfs(transaction);
89-
// setDisplaySteps(STEPS_IPFS, true);
88+
// SetUxIpfs(transaction);
89+
// SetUxDisplay(UX_IPFS_STEPS, true);
9090
// break;
9191

9292
// case HTLC_LOCK_TYPE:
93-
// displayHtlcLock(transaction);
94-
// bool hasVendorField = transaction->vendorFieldLength > 0;
95-
// setDisplaySteps(STEPS_HTLC_LOCK_MIN + (uint8_t)hasVendorField,
96-
// hasVendorField);
93+
// SetUxHtlcLock(transaction);
94+
// SetUxDisplay(UX_HTLC_LOCK_STEPS + hasVendorField, hasVendorField);
9795
// break;
9896

9997
// case HTLC_CLAIM_TYPE:
100-
// displayHtlcClaim(transaction);
101-
// setDisplaySteps(STEPS_HTLC_CLAIM, false);
98+
// SetUxHtlcClaim(transaction);
99+
// SetUxDisplay(UX_HTLC_CLAIM_STEPS, false);
102100
// break;
103101

104102
// case HTLC_REFUND_TYPE:
105-
// displayHtlcRefund(transaction);
106-
// setDisplaySteps(STEPS_HTLC_REFUND, false);
103+
// SetUxHtlcRefund(transaction);
104+
// SetUxDisplay(UX_HTLC_REFUND_STEPS, false);
107105
// break;
108106

109107
// default: break;

docs/unsupported/delegate_resignation/delegate_resignation_ux.c

+5-6
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,11 @@ void displayDelegateResignation(const Transaction *transaction) {
6262
bytecpy((char *)displayCtx.title[1], LABEL_FEE, LABEL_FEE_SIZE);
6363

6464
// Delegate PublicKey
65-
bytesToHex((char *)displayCtx.text[0],
66-
transaction->senderPublicKey,
67-
PUBLICKEY_COMPRESSED_LEN);
65+
BytesToHex(transaction->senderPublicKey, PUBLICKEY_COMPRESSED_LEN,
66+
displayCtx.text[0], sizeof(displayCtx.text[0]));
6867

6968
// Fee
70-
printAmount(transaction->fee,
71-
(uint8_t *)displayCtx.text[1], sizeof(displayCtx.text[1]),
72-
TOKEN_NAME, TOKEN_NAME_SIZE, TOKEN_DECIMALS);
69+
TokenAmountToString(TOKEN_NAME, TOKEN_NAME_SIZE, TOKEN_DECIMALS,
70+
transaction->fee,
71+
displayCtx.text[1], sizeof(displayCtx.text[1]));
7372
}

docs/unsupported/delegate_resignation/delegate_resignation_ux.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@
3636
#ifndef ARK_OPERATIONS_TRANSACTIONS_UX_DELEGATE_RESIGNATION_UX_H
3737
#define ARK_OPERATIONS_TRANSACTIONS_UX_DELEGATE_RESIGNATION_UX_H
3838

39-
#include <stdint.h>
39+
#include <stddef.h>
4040

4141
#include "operations/transactions/transaction.h"
4242

4343
////////////////////////////////////////////////////////////////////////////////
44-
static const uint8_t STEPS_DELEGATE_REGISTRATION = 2U;
44+
static const size_t UX_DELEGATE_REGISTRATION_STEPS = 2U;
4545

4646
////////////////////////////////////////////////////////////////////////////////
4747
void displayDelegateResignation(const Transaction *transaction);

docs/unsupported/delegate_resignation/deserializer.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@
265265
// if (deserializeAsset(transaction,
266266
// &buffer[assetOffset],
267267
// size - assetOffset)) {
268-
// setDisplay(transaction);
268+
// SetUx(transaction);
269269
// return true;
270270
// }
271271

@@ -285,7 +285,7 @@
285285
// transaction->assetOffset = ASSET_OFFSET_LEGACY;
286286
// transaction->assetPtr = (uint8_t*)&buffer[transaction->assetOffset];
287287

288-
// setDisplayLegacy(transaction);
288+
// SetUxLegacy(transaction);
289289

290290
// return true;
291291
// }

0 commit comments

Comments
 (0)