Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PLA-1774] Enjin relaychain support #1

Open
wants to merge 43 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
7285f6c
Add Balance Support
leonardocustodio May 16, 2024
fe71e43
Some changes
leonardocustodio May 17, 2024
060b52b
More changes
leonardocustodio May 17, 2024
50f0028
More changes
leonardocustodio May 18, 2024
d800d48
Adds multiTokens
leonardocustodio May 18, 2024
29bbce6
Removed polkadot nomination pools
leonardocustodio May 18, 2024
0206b4d
Removed more stuff
leonardocustodio May 18, 2024
1d7301a
Adds nomination pools
leonardocustodio May 19, 2024
90ced70
More things
leonardocustodio May 19, 2024
ed2fc48
remove not used pallets
leonardocustodio May 20, 2024
4ff3563
More changes
leonardocustodio May 20, 2024
a76f843
Changes
leonardocustodio May 20, 2024
fe8caf3
More nomination pools changes
leonardocustodio May 21, 2024
d34820c
Finishes nomination pools
leonardocustodio May 21, 2024
05ac632
Adds master repo
leonardocustodio May 21, 2024
cf254b3
A few more adjust for multiTokens
leonardocustodio May 22, 2024
1d7add6
Finished multiTokens
leonardocustodio May 22, 2024
ab24aae
more changes
leonardocustodio May 22, 2024
85cccca
Some fuel tanks changes
leonardocustodio May 23, 2024
12fecf0
More changes
leonardocustodio May 23, 2024
ad8476f
Fix screenshots
leonardocustodio May 24, 2024
f0b32c8
More changes
leonardocustodio May 24, 2024
150fe66
More test fixes
leonardocustodio May 24, 2024
ec14f9e
More changes
leonardocustodio May 24, 2024
67a2330
Classic
leonardocustodio May 24, 2024
775cc44
Some fixing
leonardocustodio May 24, 2024
f942d3d
lint
leonardocustodio May 24, 2024
eff8390
Fixes app path
leonardocustodio May 24, 2024
60fe899
Some improves
leonardocustodio May 27, 2024
73f5da5
fix
leonardocustodio May 29, 2024
501c04c
Adds new extrinsics
leonardocustodio Jun 6, 2024
33c4574
More fixes
leonardocustodio Jun 8, 2024
25c16fc
Fixes
leonardocustodio Jun 8, 2024
f45f4ee
PLA-1832
leonardocustodio Jun 12, 2024
24eb0f6
Fixes
leonardocustodio Jun 12, 2024
028687b
Fixes splitAbstain
leonardocustodio Jun 12, 2024
dd9f84e
Changes
leonardocustodio Jun 12, 2024
a74a4ed
Some fixes
leonardocustodio Jun 12, 2024
37820d3
Fixes
leonardocustodio Jun 12, 2024
402aa5f
Fix batchMint
leonardocustodio Jun 13, 2024
30fdf52
More fixes
leonardocustodio Jun 13, 2024
1229b06
Fixes
leonardocustodio Jun 13, 2024
6a145ba
fix timestamp
leonardocustodio Jun 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/check_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
pull_request:
branches:
- main
- master
- develop

jobs:
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@ on:
push:
pull_request:
branches:
- main
- master
- develop

jobs:
analyse:
name: Analyse

permissions:
contents: read
security-events: write
pull-requests: read

strategy:
matrix:
sdk: ["$NANOS_SDK", "$NANOX_SDK", "$NANOSP_SDK", "$STAX_SDK"]
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
pull_request:
branches:
- main
- master
- develop

jobs:
Expand Down Expand Up @@ -118,6 +118,9 @@ jobs:
make test_all

build_package_nanos:
permissions:
contents: write

needs: [configure, build, build_ledger, test_zemu]
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
Expand Down Expand Up @@ -154,6 +157,9 @@ jobs:
prerelease: false

build_package_nanos_xl:
permissions:
contents: write

needs: [configure, build, build_ledger, test_zemu]
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
Expand Down Expand Up @@ -190,6 +196,9 @@ jobs:
prerelease: false

build_package_nanosp:
permissions:
contents: write

needs: [configure, build, build_ledger, test_zemu]
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
Expand Down Expand Up @@ -226,6 +235,9 @@ jobs:
prerelease: false

build_package_stax:
permissions:
contents: write

needs: [configure, build, build_ledger, test_zemu]
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
Expand Down
18 changes: 9 additions & 9 deletions app/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,27 +47,27 @@ $(info ************ FULL PARSER ENABLED ************)
endif

ifndef COIN
COIN=DOT
COIN=ENJ
endif

include $(CURDIR)/Makefile.version

$(info COIN = [$(COIN)])

ifeq ($(COIN),DOT)
ifeq ($(COIN),ENJ)
# Main app configuration
DEFINES += APP_STANDARD
ifneq ($(TARGET_NAME),TARGET_NANOS)
DEFINES += SUBSTRATE_PARSER_FULL
endif
APPNAME = "Polkadot"
APPPATH = "44'/354'" --path "44'/434'"
APPNAME = "Enjin"
APPPATH = "44'/1155'" --path "44'/354'"

else ifeq ($(COIN),DOT_XL)
else ifeq ($(COIN),ENJ_XL)
# XL app configuration
DEFINES += APP_STANDARD SUBSTRATE_PARSER_FULL
APPNAME = "Polkadot XL"
APPPATH = "44'/354'" --path "44'/434'"
APPNAME = "Enjin XL"
APPPATH = "44'/1155'" --path "44'/354'"

else
define error_message
Expand Down Expand Up @@ -119,9 +119,9 @@ dep/%.d: %.c Makefile
.PHONY: listvariants
listvariants:
ifeq ($(TARGET_NAME),TARGET_NANOS)
@echo VARIANTS COIN DOT DOT_XL
@echo VARIANTS COIN ENJ ENJ_XL
else
@echo VARIANTS COIN DOT
@echo VARIANTS COIN ENJ
endif

.PHONY: version
Expand Down
6 changes: 3 additions & 3 deletions app/Makefile.version
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This is the `transaction_version` field of `Runtime`
APPVERSION_M=25
APPVERSION_M=7
# This is the `spec_version` field of `Runtime`
APPVERSION_N=10100
APPVERSION_N=1026
# This is the patch version of this release
APPVERSION_P=1
APPVERSION_P=0
Binary file modified app/glyphs/icon_app.gif
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 app/glyphs/icon_stax_32.gif
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 app/glyphs/icon_stax_64.gif
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 app/nanos_icon.gif
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 app/nanox_icon.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 11 additions & 11 deletions app/src/substrate/substrate_coin.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
extern "C" {
#endif

#define COIN_ADDR_TYPE 0
#define CLA 0x90
#define COIN_ADDR_TYPE 2135
#define CLA 0xb9

#define INS_SIGN_RAW 0x03

#define HDPATH_LEN_DEFAULT 5
#define HDPATH_0_DEFAULT (0x80000000 | 0x2c)
#define HDPATH_1_DEFAULT (0x80000000 | 0x162)
#define HDPATH_1_DEFAULT (0x80000000 | 0x483)
#define HDPATH_1_RECOVERY (0x80000000 | 0x1b2)

#define HDPATH_2_DEFAULT (0x80000000u | 0u)
Expand Down Expand Up @@ -55,20 +55,20 @@ typedef enum {
#define SUPPORTED_TX_VERSION_CURRENT LEDGER_MAJOR_VERSION
#define SUPPORTED_TX_VERSION_PREVIOUS (LEDGER_MAJOR_VERSION - 1)
#define SUPPORTED_SPEC_VERSION (LEDGER_MINOR_VERSION + 0)
#define SUPPORTED_MINIMUM_SPEC_VERSION 9300
#define SUPPORTED_MINIMUM_SPEC_VERSION 1026

#define COIN_AMOUNT_DECIMAL_PLACES 10
#define COIN_AMOUNT_DECIMAL_PLACES 18

#define COIN_GENESIS_HASH "91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3"
#define COIN_NAME "Polkadot"
#define COIN_TICKER "DOT "
#define COIN_GENESIS_HASH "d8761d3c88f26dc12875c00d3165f7d67243d56fc85b4cf19937601a7916e5a9"
#define COIN_NAME "Enjin"
#define COIN_TICKER "ENJ "

#define COIN_SECRET_REQUIRED_CLICKS 10

#define MENU_MAIN_APP_LINE1 "Polkadot"
#define MENU_MAIN_APP_LINE1 "Enjin"
#define MENU_MAIN_APP_LINE2 "Ready"
#define MENU_MAIN_APP_LINE2_SECRET "DOT RECOVERY"
#define APPVERSION_LINE1 "Polkadot"
#define MENU_MAIN_APP_LINE2_SECRET "ENJ RECOVERY"
#define APPVERSION_LINE1 "Enjin"
#define APPVERSION_LINE2 "v" APPVERSION

#ifdef __cplusplus
Expand Down
32 changes: 16 additions & 16 deletions app/src/substrate/substrate_dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ parser_error_t _readMethod(
pd_Method_t* method)
{
switch (c->tx_obj->transactionVersion) {
case 25:
return _readMethod_V25(c, moduleIdx, callIdx, &method->V25);
case 7:
return _readMethod_V7(c, moduleIdx, callIdx, &method->V7);
default:
return parser_tx_version_not_supported;
}
Expand All @@ -36,8 +36,8 @@ parser_error_t _readMethod(
uint8_t _getMethod_NumItems(uint32_t transactionVersion, uint8_t moduleIdx, uint8_t callIdx)
{
switch (transactionVersion) {
case 25:
return _getMethod_NumItems_V25(moduleIdx, callIdx);
case 7:
return _getMethod_NumItems_V7(moduleIdx, callIdx);
default:
return 0;
}
Expand All @@ -46,8 +46,8 @@ uint8_t _getMethod_NumItems(uint32_t transactionVersion, uint8_t moduleIdx, uint
const char* _getMethod_ModuleName(uint32_t transactionVersion, uint8_t moduleIdx)
{
switch (transactionVersion) {
case 25:
return _getMethod_ModuleName_V25(moduleIdx);
case 7:
return _getMethod_ModuleName_V7(moduleIdx);
default:
return NULL;
}
Expand All @@ -56,8 +56,8 @@ const char* _getMethod_ModuleName(uint32_t transactionVersion, uint8_t moduleIdx
const char* _getMethod_Name(uint32_t transactionVersion, uint8_t moduleIdx, uint8_t callIdx)
{
switch (transactionVersion) {
case 25:
return _getMethod_Name_V25(moduleIdx, callIdx);
case 7:
return _getMethod_Name_V7(moduleIdx, callIdx);
default:
return NULL;
}
Expand All @@ -66,8 +66,8 @@ const char* _getMethod_Name(uint32_t transactionVersion, uint8_t moduleIdx, uint
const char* _getMethod_ItemName(uint32_t transactionVersion, uint8_t moduleIdx, uint8_t callIdx, uint8_t itemIdx)
{
switch (transactionVersion) {
case 25:
return _getMethod_ItemName_V25(moduleIdx, callIdx, itemIdx);
case 7:
return _getMethod_ItemName_V7(moduleIdx, callIdx, itemIdx);
default:
return NULL;
}
Expand All @@ -78,8 +78,8 @@ parser_error_t _getMethod_ItemValue(uint32_t transactionVersion, pd_Method_t* m,
uint8_t pageIdx, uint8_t* pageCount)
{
switch (transactionVersion) {
case 25:
return _getMethod_ItemValue_V25(&m->V25, moduleIdx, callIdx, itemIdx, outValue,
case 7:
return _getMethod_ItemValue_V7(&m->V7, moduleIdx, callIdx, itemIdx, outValue,
outValueLen, pageIdx, pageCount);
default:
return parser_tx_version_not_supported;
Expand All @@ -89,8 +89,8 @@ parser_error_t _getMethod_ItemValue(uint32_t transactionVersion, pd_Method_t* m,
bool _getMethod_ItemIsExpert(uint32_t transactionVersion, uint8_t moduleIdx, uint8_t callIdx, uint8_t itemIdx)
{
switch (transactionVersion) {
case 25:
return _getMethod_ItemIsExpert_V25(moduleIdx, callIdx, itemIdx);
case 7:
return _getMethod_ItemIsExpert_V7(moduleIdx, callIdx, itemIdx);
default:
return false;
}
Expand All @@ -99,8 +99,8 @@ bool _getMethod_ItemIsExpert(uint32_t transactionVersion, uint8_t moduleIdx, uin
bool _getMethod_IsNestingSupported(uint32_t transactionVersion, uint8_t moduleIdx, uint8_t callIdx)
{
switch (transactionVersion) {
case 25:
return _getMethod_IsNestingSupported_V25(moduleIdx, callIdx);
case 7:
return _getMethod_IsNestingSupported_V7(moduleIdx, callIdx);
default:
return false;
}
Expand Down
6 changes: 3 additions & 3 deletions app/src/substrate/substrate_dispatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ extern "C" {

#include "parser_common.h"
#include "stdbool.h"
#include "substrate_dispatch_V25.h"
#include "substrate_dispatch_V7.h"
#include <stddef.h>
#include <stdint.h>

Expand All @@ -32,8 +32,8 @@ extern "C" {
{ \
switch (txVersion) { \
\
case 25: \
return PD_CALL_##CALL##_V25; \
case 7: \
return PD_CALL_##CALL##_V7; \
\
default: \
return 0; \
Expand Down
Loading
Loading