Skip to content

Commit

Permalink
Fix coston network_id (#17)
Browse files Browse the repository at this point in the history
* update deps

* update coston network_id & add new chain ids

* update snapshots
  • Loading branch information
chcmedeiros authored Nov 5, 2024
1 parent 8f99334 commit aa98ba7
Show file tree
Hide file tree
Showing 14 changed files with 58 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/Makefile.version
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ APPVERSION_M=2
# This is the minor version
APPVERSION_N=1
# This is the patch version
APPVERSION_P=1
APPVERSION_P=2
35 changes: 32 additions & 3 deletions app/src/parser_impl_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,47 @@

static const chain_lookup_table_t chain_lookup_table[] = {

// Flare
{{0x77, 0xd3, 0x07, 0x4d, 0xc5, 0x10, 0xf4, 0x3b, 0x09, 0xac, 0x5b, 0xe7, 0x7e, 0xde, 0xe2, 0x76,
0xef, 0x3b, 0x55, 0xf0, 0x09, 0x7d, 0x50, 0x48, 0x46, 0xaa, 0x8e, 0xec, 0x61, 0x3f, 0xc6, 0x25},
c_chain,
'C'},
{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
p_chain,
'P'},

// Coston2
{{0x78, 0xdb, 0x5c, 0x30, 0xbe, 0xd0, 0x4c, 0x05, 0xce, 0x20, 0x91, 0x79, 0x81, 0x28, 0x50, 0xbb,
0xb3, 0xfe, 0x6d, 0x46, 0xd7, 0xee, 0xf3, 0x74, 0x4d, 0x81, 0x4c, 0x0d, 0xa5, 0x55, 0x24, 0x79},
c_chain,
'C'},
{{0x77, 0xd3, 0x07, 0x4d, 0xc5, 0x10, 0xf4, 0x3b, 0x09, 0xac, 0x5b, 0xe7, 0x7e, 0xde, 0xe2, 0x76,
0xef, 0x3b, 0x55, 0xf0, 0x09, 0x7d, 0x50, 0x48, 0x46, 0xaa, 0x8e, 0xec, 0x61, 0x3f, 0xc6, 0x25},
{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
p_chain,
'P'},

// Songbird
{{0x55, 0xf0, 0x77, 0xed, 0x33, 0x88, 0x89, 0x8d, 0x7c, 0x52, 0xc1, 0xa1, 0x0c, 0xae, 0x70, 0xe8,
0x34, 0x50, 0xc3, 0x34, 0x99, 0xf4, 0xeb, 0x1a, 0xe8, 0x18, 0x77, 0xb6, 0xf8, 0xfd, 0xa4, 0x02},
c_chain,
'C'},
{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
p_chain,
'P'},

// Coston
{{0xff, 0xb1, 0x19, 0xb4, 0x04, 0xc1, 0x35, 0x6b, 0x6b, 0xfd, 0xb8, 0x00, 0x45, 0xe2, 0x7b, 0xa1,
0x3c, 0x37, 0x89, 0xb5, 0xb3, 0x68, 0x4f, 0x00, 0x1d, 0xa0, 0x71, 0xcd, 0x4e, 0x6d, 0xb0, 0x9c},
c_chain,
'C'},
{{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
p_chain,
'P'}};
'P'},

};

static const uint32_t chain_lookup_len = sizeof(chain_lookup_table) / sizeof(chain_lookup_table[0]);

Expand Down
4 changes: 2 additions & 2 deletions app/src/parser_txdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ extern "C" {
#define ADD_VALIDATOR_TX 0x0000000c

#define MAINNET_ID 14
#define COSTON_ID 16
#define COSTON_ID 7
#define COSTON2_ID 114
#define SONGBIRD_ID 19
#define SONGBIRD_ID 5

#define MAX_OUTPUTS 64
#define MAX_INPUTS 64
Expand Down
2 changes: 1 addition & 1 deletion deps/ledger-zxlib
21 changes: 21 additions & 0 deletions tests/testvectors/testcases.json
Original file line number Diff line number Diff line change
Expand Up @@ -280,5 +280,26 @@
"4 | Hash [1/2] : 7eb6bdf75dccc487cca74adc1d5bf84b3d0edc",
"4 | Hash [2/2] : 51761c738cd02007490711c639",
]
},
{
"index": 13,
"name": "Export_Tx",
"blob": "00000000000100000007ffb119b404c1356b6bfdb80045e27ba13c3789b5b3684f001da071cd4e6db09c000000000000000000000000000000000000000000000000000000000000000000000001d4c3a7d8f6e0e189d39a5ef3ac46cbe6223c5f0f000000025423b79c725593977d114e0891a525263b1ed6bf830ae33ba23234b531bc5cae6d5cc777000000000000000900000001725593977d114e0891a525263b1ed6bf830ae33ba23234b531bc5cae6d5cc7770000000700000002541b2640000000000000000000000001000000014caa7b6aea91a08682d2dc5b7a5fe715e18e0ed6",
"output": [
"0 | Export : C to P chain",
"1 | Amount : 10.001 CFLR",
"2 | Address [1/2] : coston1fj48k6h2jxsgdqkjm3dh5hl8zhscurk",
"2 | Address [2/2] : kqr9eyd",
"3 | Fee : 0.0005615 CFLR"
],
"output_expert": [
"0 | Export : C to P chain",
"1 | Amount : 10.001 CFLR",
"2 | Address [1/2] : coston1fj48k6h2jxsgdqkjm3dh5hl8zhscurk",
"2 | Address [2/2] : kqr9eyd",
"3 | Fee : 0.0005615 CFLR",
"4 | Hash [1/2] : 38557d14d23be383b5bdfefd6783bda6153431",
"4 | Hash [2/2] : f9de86a4b953a41bf56bcddd83"
]
}
]
2 changes: 1 addition & 1 deletion tests_zemu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"dependencies": {
"@zondax/ledger-flare": "../js",
"@zondax/zemu": "^0.50.2"
"@zondax/zemu": "^0.51.0"
},
"devDependencies": {
"@ethereumjs/common": "^2.4.0",
Expand Down
Binary file modified tests_zemu/snapshots/f-mainmenu/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_zemu/snapshots/s-mainmenu/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_zemu/snapshots/s-mainmenu/00010.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_zemu/snapshots/sp-mainmenu/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_zemu/snapshots/sp-mainmenu/00010.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_zemu/snapshots/st-mainmenu/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_zemu/snapshots/x-mainmenu/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_zemu/snapshots/x-mainmenu/00010.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit aa98ba7

Please sign in to comment.