Skip to content

Commit

Permalink
Make some argument strings shorter
Browse files Browse the repository at this point in the history
  • Loading branch information
relatko committed Aug 3, 2022
1 parent 2cce189 commit 4916e1b
Show file tree
Hide file tree
Showing 117 changed files with 70 additions and 53 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ When updating Build container/SDK/Speculos you want to change SDK parameter in s
To modify the list of transaction known by Ledger, do the following:

1. Add/modify the manifest files in `transaction_metadata` directory, modify the script to include new files.
2. Copy the resulting `txMerkleTree.js` file to `js/src`.
2. Copy the resulting `txMerkleTree.js` file to `js/src`. Re-build js and re-install speculos (to include newly build js).
3. Take the top level hash from `txMerkleTree.js` and move it to `merkleTreeRoot` variable of `app/src/tx_metadata.c` (you need to split the hex into C array of uint8_t's).
4. Copy the resulting `txMerkleTree.js` file to `test/generate-transaction-tests` and regenerate the tests (important for C++ unit tests).
4. Copy the resulting `txMerkleTree.js` file to `test/generate-transaction-tests` and regenerate the tests.
5. You may want to modify the manifest for integration testing to include newly added changes into integration tests.

This process will have to change slightly in the feature to support backward compatibility of JS.
Expand Down
2 changes: 1 addition & 1 deletion app/src/tx_metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct {
} txMetadataState;

static const uint8_t merkleTreeRoot[METADATA_HASH_SIZE] = {
0x71, 0xb3, 0xf3, 0x72, 0x5f, 0xbb, 0x0f, 0x2d, 0x59, 0x3d, 0xd6, 0x45, 0x70, 0xef, 0xe7, 0x5f, 0x55, 0x61, 0x87, 0x36, 0x6c, 0x19, 0xba, 0x94, 0x27, 0x24, 0x74, 0xe8, 0x0e, 0xea, 0x78, 0x5e,
0xfe, 0x82, 0x42, 0x09, 0x59, 0x87, 0x58, 0x26, 0xf6, 0xa6, 0x17, 0x95, 0x9b, 0x00, 0x6c, 0x31, 0xfa, 0x89, 0x75, 0xe4, 0x55, 0xdb, 0xf2, 0x49, 0x4f, 0x5f, 0xf3, 0x74, 0x0a, 0x1e, 0xce, 0x51,
};

parser_error_t _validateHash(const uint8_t scriptHash[METADATA_HASH_SIZE], const uint8_t *txMetadata, uint16_t txMetadataLength) {
Expand Down
30 changes: 15 additions & 15 deletions js/src/txMerkleTree.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
export const merkleTree = {
"hash": "71b3f3725fbb0f2d593dd64570efe75f556187366c19ba94272474e80eea785e",
"hash": "fe82420959875826f6a617959b006c31fa8975e455dbf2494f5ff3740a1ece51",
"children": [
{
"hash": "6edc3a498a77648f820dc3b2d563f74314480e8569c4efbcd69c600f59cec2d0",
"hash": "9053a0e87b7e66413b6552205fa31f3c2ed42cdb97bd3d543a130aebb29dda1e",
"children": [
{
"hash": "d6f168b2ac8da11c1a93cc44fd3126eeb7fbd7046a11cd664fd4eafb51502e77",
"hash": "07ea7f7407fda8657a35aeb24075cc654b9f06ae61d6cd1a772920ee3c6209a1",
"children": [
{
"hash": "aa44049d7eb26d667c3714b8fcf78380878e658e22268510ff9f72e69b29decd",
Expand Down Expand Up @@ -55,30 +55,30 @@ export const merkleTree = {
]
},
{
"hash": "969676717f03d5697f4d83eda34ad3ae02eb547ac971f0a0b4e118d32db6ef73",
"hash": "a0affd7f78688c482a5a5bc416fa49f5844288fc61b0ee1b40cd38e3c2fbeb36",
"children": [
{
"hash": "c599e4e4e494601f528d18cef04be3bc30bb11f4414fe8acf5f3d2c24c18ffa4",
"hash": "099d7e6cfa53ac9150cc79588f5282d3f7bb21a7fb0596ccfcf47bcb380b0fe1",
"children": [
"02f47efa834bc0559afae9a660b2efefddd0c6dc6e1bbcf9c3994e45ea9e5135ec99997236b6d76caa298331d5cef77cbdf83c1af64584ece537a780ba4ac468835265676973746572204e6f64650007014e6f64652049440000537472696e670003014e6f646520526f6c65000155496e74380003014e6574776f726b696e6720416464726573730002537472696e670003014e6574776f726b696e67204b65790003537472696e670003015374616b696e67204b65790004537472696e67000301416d6f756e74000555466978363400030400035075626c6963204b6579730006537472696e670003"
"02f47efa834bc0559afae9a660b2efefddd0c6dc6e1bbcf9c3994e45ea9e5135ec99997236b6d76caa298331d5cef77cbdf83c1af64584ece537a780ba4ac468835265676973746572204e6f64650007014e6f64652049440000537472696e670003014e6f646520526f6c65000155496e74380003014e6574772e20416464726573730002537472696e670003014e6574772e204b65790003537472696e670003015374616b696e67204b65790004537472696e67000301416d6f756e74000555466978363400030400035075622e204b65790006537472696e670003"
]
},
{
"hash": "126ade9922b615139acc57f8869d2a34da18f47282697e68d5464c0f2f477f04",
"hash": "2b5f06235697099c02556240d18fcad69e9a48594d75036edff5d0d875ec746e",
"children": [
"029246ec9b7a5c81151156e7c2f6d356f68b1b884f88728daca46b968d9a46cd5a79de7119aea61bdafb39cc3d1f4fa17ca802c2732726a86d2c636dbc19808b685265676973746572204e6f64650007014e6f64652049440000537472696e670003014e6f646520526f6c65000155496e74380003014e6574776f726b696e6720416464726573730002537472696e670003014e6574776f726b696e67204b65790003537472696e670003015374616b696e67204b65790004537472696e67000301416d6f756e74000555466978363400030400035075626c6963204b6579730006537472696e670003"
"029246ec9b7a5c81151156e7c2f6d356f68b1b884f88728daca46b968d9a46cd5a79de7119aea61bdafb39cc3d1f4fa17ca802c2732726a86d2c636dbc19808b685265676973746572204e6f64650007014e6f64652049440000537472696e670003014e6f646520526f6c65000155496e74380003014e6574772e20416464726573730002537472696e670003014e6574772e204b65790003537472696e670003015374616b696e67204b65790004537472696e67000301416d6f756e74000555466978363400030400035075622e204b65790006537472696e670003"
]
},
{
"hash": "0daf07bbd270140381727a86d2083b0ead03833dc89787dfa65eeafd83ec9ced",
"hash": "ae90b6bab2a077c5d5e3d052fc78908e251e97cfd9407c35bf49a8d284acd3c6",
"children": [
"02e79df145af42488e3da1d1b2e50a38a2084229896d670884f278a2119dc3bf9ec2442b498eea025099815ea613d6407407192dc12ad70e1a4f47936db804a841437265617465204d616368696e65204163636f756e740002014e6f64652049440000537472696e6700030300035075626c6963204b6579730001537472696e670003"
"02e79df145af42488e3da1d1b2e50a38a2084229896d670884f278a2119dc3bf9ec2442b498eea025099815ea613d6407407192dc12ad70e1a4f47936db804a841437265617465204d616368696e65204163636f756e740002014e6f64652049440000537472696e6700030300035075622e204b65790001537472696e670003"
]
},
{
"hash": "6f64fc0cb8fc46e800e170a6eb16d3a0ad1a148e374ed125b6888c2720331078",
"hash": "60232ddb87d93f0a82735425ae06661d752b45345ab36a2805147f02d86ab779",
"children": [
"0286c69d731560f3bff549c5f180eb4219bfe650ae4efec8e0c5b5ad3ebed54a92dd3b327b09087ea7f8e92a22a6b04a3c6ca33b868b430c4f15f251658c38c1b7437265617465204d616368696e65204163636f756e740002014e6f64652049440000537472696e6700030300035075626c6963204b6579730001537472696e670003"
"0286c69d731560f3bff549c5f180eb4219bfe650ae4efec8e0c5b5ad3ebed54a92dd3b327b09087ea7f8e92a22a6b04a3c6ca33b868b430c4f15f251658c38c1b7437265617465204d616368696e65204163636f756e740002014e6f64652049440000537472696e6700030300035075622e204b65790001537472696e670003"
]
},
{
Expand Down Expand Up @@ -149,7 +149,7 @@ export const merkleTree = {
]
},
{
"hash": "17009ee11f842f7783df52789f4ecaf8d689eb878a053167b43302678f4cd224",
"hash": "d0b4592fc4f996b16fea83ab8dede757ea8bc270f4e1fbf2301e02fd38d175e3",
"children": [
{
"hash": "08b2978dff804b0a39bb3b382a0d0e02fa7977297aab0cafcbcca6324fb7c97f",
Expand All @@ -176,9 +176,9 @@ export const merkleTree = {
]
},
{
"hash": "9f6ac055178275e9fabcba63ac9f9aa36cfb3e54221c8cda3c68a2f7832ea179",
"hash": "14b699e967e1fe928a4e3d49ceadbfad9f6a2bc84a8498cd0a643f2df8fd6ca5",
"children": [
"02b6a3502d2205eb05ec18772c13b91cc88a056b325c2617c57948d38cab8db600b64e0e3ed9eb28789198f2b0437f55f750bfa76da99450f63be6543bde66122a5265676973746572204e6f64650006014e6f64652049440000537472696e670003014e6f646520526f6c65000155496e74380003014e6574776f726b696e6720416464726573730002537472696e670003014e6574776f726b696e67204b65790003537472696e670003015374616b696e67204b65790004537472696e67000301416d6f756e7400055546697836340003"
"02b6a3502d2205eb05ec18772c13b91cc88a056b325c2617c57948d38cab8db600b64e0e3ed9eb28789198f2b0437f55f750bfa76da99450f63be6543bde66122a5265676973746572204e6f64650006014e6f64652049440000537472696e670003014e6f646520526f6c65000155496e74380003014e6574772e20416464726573730002537472696e670003014e6574772e204b65790003537472696e670003015374616b696e67204b65790004537472696e67000301416d6f756e7400055546697836340003"
]
},
{
Expand Down
30 changes: 15 additions & 15 deletions tests/generate-transaction-tests/txMerkleTree.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
export const merkleTree = {
"hash": "71b3f3725fbb0f2d593dd64570efe75f556187366c19ba94272474e80eea785e",
"hash": "fe82420959875826f6a617959b006c31fa8975e455dbf2494f5ff3740a1ece51",
"children": [
{
"hash": "6edc3a498a77648f820dc3b2d563f74314480e8569c4efbcd69c600f59cec2d0",
"hash": "9053a0e87b7e66413b6552205fa31f3c2ed42cdb97bd3d543a130aebb29dda1e",
"children": [
{
"hash": "d6f168b2ac8da11c1a93cc44fd3126eeb7fbd7046a11cd664fd4eafb51502e77",
"hash": "07ea7f7407fda8657a35aeb24075cc654b9f06ae61d6cd1a772920ee3c6209a1",
"children": [
{
"hash": "aa44049d7eb26d667c3714b8fcf78380878e658e22268510ff9f72e69b29decd",
Expand Down Expand Up @@ -55,30 +55,30 @@ export const merkleTree = {
]
},
{
"hash": "969676717f03d5697f4d83eda34ad3ae02eb547ac971f0a0b4e118d32db6ef73",
"hash": "a0affd7f78688c482a5a5bc416fa49f5844288fc61b0ee1b40cd38e3c2fbeb36",
"children": [
{
"hash": "c599e4e4e494601f528d18cef04be3bc30bb11f4414fe8acf5f3d2c24c18ffa4",
"hash": "099d7e6cfa53ac9150cc79588f5282d3f7bb21a7fb0596ccfcf47bcb380b0fe1",
"children": [
"02f47efa834bc0559afae9a660b2efefddd0c6dc6e1bbcf9c3994e45ea9e5135ec99997236b6d76caa298331d5cef77cbdf83c1af64584ece537a780ba4ac468835265676973746572204e6f64650007014e6f64652049440000537472696e670003014e6f646520526f6c65000155496e74380003014e6574776f726b696e6720416464726573730002537472696e670003014e6574776f726b696e67204b65790003537472696e670003015374616b696e67204b65790004537472696e67000301416d6f756e74000555466978363400030400035075626c6963204b6579730006537472696e670003"
"02f47efa834bc0559afae9a660b2efefddd0c6dc6e1bbcf9c3994e45ea9e5135ec99997236b6d76caa298331d5cef77cbdf83c1af64584ece537a780ba4ac468835265676973746572204e6f64650007014e6f64652049440000537472696e670003014e6f646520526f6c65000155496e74380003014e6574772e20416464726573730002537472696e670003014e6574772e204b65790003537472696e670003015374616b696e67204b65790004537472696e67000301416d6f756e74000555466978363400030400035075622e204b65790006537472696e670003"
]
},
{
"hash": "126ade9922b615139acc57f8869d2a34da18f47282697e68d5464c0f2f477f04",
"hash": "2b5f06235697099c02556240d18fcad69e9a48594d75036edff5d0d875ec746e",
"children": [
"029246ec9b7a5c81151156e7c2f6d356f68b1b884f88728daca46b968d9a46cd5a79de7119aea61bdafb39cc3d1f4fa17ca802c2732726a86d2c636dbc19808b685265676973746572204e6f64650007014e6f64652049440000537472696e670003014e6f646520526f6c65000155496e74380003014e6574776f726b696e6720416464726573730002537472696e670003014e6574776f726b696e67204b65790003537472696e670003015374616b696e67204b65790004537472696e67000301416d6f756e74000555466978363400030400035075626c6963204b6579730006537472696e670003"
"029246ec9b7a5c81151156e7c2f6d356f68b1b884f88728daca46b968d9a46cd5a79de7119aea61bdafb39cc3d1f4fa17ca802c2732726a86d2c636dbc19808b685265676973746572204e6f64650007014e6f64652049440000537472696e670003014e6f646520526f6c65000155496e74380003014e6574772e20416464726573730002537472696e670003014e6574772e204b65790003537472696e670003015374616b696e67204b65790004537472696e67000301416d6f756e74000555466978363400030400035075622e204b65790006537472696e670003"
]
},
{
"hash": "0daf07bbd270140381727a86d2083b0ead03833dc89787dfa65eeafd83ec9ced",
"hash": "ae90b6bab2a077c5d5e3d052fc78908e251e97cfd9407c35bf49a8d284acd3c6",
"children": [
"02e79df145af42488e3da1d1b2e50a38a2084229896d670884f278a2119dc3bf9ec2442b498eea025099815ea613d6407407192dc12ad70e1a4f47936db804a841437265617465204d616368696e65204163636f756e740002014e6f64652049440000537472696e6700030300035075626c6963204b6579730001537472696e670003"
"02e79df145af42488e3da1d1b2e50a38a2084229896d670884f278a2119dc3bf9ec2442b498eea025099815ea613d6407407192dc12ad70e1a4f47936db804a841437265617465204d616368696e65204163636f756e740002014e6f64652049440000537472696e6700030300035075622e204b65790001537472696e670003"
]
},
{
"hash": "6f64fc0cb8fc46e800e170a6eb16d3a0ad1a148e374ed125b6888c2720331078",
"hash": "60232ddb87d93f0a82735425ae06661d752b45345ab36a2805147f02d86ab779",
"children": [
"0286c69d731560f3bff549c5f180eb4219bfe650ae4efec8e0c5b5ad3ebed54a92dd3b327b09087ea7f8e92a22a6b04a3c6ca33b868b430c4f15f251658c38c1b7437265617465204d616368696e65204163636f756e740002014e6f64652049440000537472696e6700030300035075626c6963204b6579730001537472696e670003"
"0286c69d731560f3bff549c5f180eb4219bfe650ae4efec8e0c5b5ad3ebed54a92dd3b327b09087ea7f8e92a22a6b04a3c6ca33b868b430c4f15f251658c38c1b7437265617465204d616368696e65204163636f756e740002014e6f64652049440000537472696e6700030300035075622e204b65790001537472696e670003"
]
},
{
Expand Down Expand Up @@ -149,7 +149,7 @@ export const merkleTree = {
]
},
{
"hash": "17009ee11f842f7783df52789f4ecaf8d689eb878a053167b43302678f4cd224",
"hash": "d0b4592fc4f996b16fea83ab8dede757ea8bc270f4e1fbf2301e02fd38d175e3",
"children": [
{
"hash": "08b2978dff804b0a39bb3b382a0d0e02fa7977297aab0cafcbcca6324fb7c97f",
Expand All @@ -176,9 +176,9 @@ export const merkleTree = {
]
},
{
"hash": "9f6ac055178275e9fabcba63ac9f9aa36cfb3e54221c8cda3c68a2f7832ea179",
"hash": "14b699e967e1fe928a4e3d49ceadbfad9f6a2bc84a8498cd0a643f2df8fd6ca5",
"children": [
"02b6a3502d2205eb05ec18772c13b91cc88a056b325c2617c57948d38cab8db600b64e0e3ed9eb28789198f2b0437f55f750bfa76da99450f63be6543bde66122a5265676973746572204e6f64650006014e6f64652049440000537472696e670003014e6f646520526f6c65000155496e74380003014e6574776f726b696e6720416464726573730002537472696e670003014e6574776f726b696e67204b65790003537472696e670003015374616b696e67204b65790004537472696e67000301416d6f756e7400055546697836340003"
"02b6a3502d2205eb05ec18772c13b91cc88a056b325c2617c57948d38cab8db600b64e0e3ed9eb28789198f2b0437f55f750bfa76da99450f63be6543bde66122a5265676973746572204e6f64650006014e6f64652049440000537472696e670003014e6f646520526f6c65000155496e74380003014e6574772e20416464726573730002537472696e670003014e6574772e204b65790003537472696e670003015374616b696e67204b65790004537472696e67000301416d6f756e7400055546697836340003"
]
},
{
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 22 additions & 5 deletions transaction_metadata/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,23 @@ const uint8_to_buff = (n) => {
return buff;
}

//This is to implement custom rules to make the labels shorter
const legerifyTxName = (name) => {
const txNameTransforms = {
"":""
}
return txNameTransforms[name]?txNameTransforms[name]:name
}

const legerifyArgLabel = (name) => {
const txArgTransforms = {
"Networking Address":"Netw. Address",
"Networking Key":"Netw. Key",
"Public Keys":"Pub. Key",
}
return txArgTransforms[name]?txArgTransforms[name]:name
}

const readManifest = (testnetFile, mainnetFile) => {
const sortFun = (template1, template2) => template1.id > template2.id ? 1 : (template1.id < template2.id ? -1 : 0);
const testnetTemplates = [...JSON.parse(fs.readFileSync(testnetFile)).templates].sort(sortFun);
Expand All @@ -37,7 +54,7 @@ const readManifest = (testnetFile, mainnetFile) => {
if (arg.type[0] !== '[' && arg.type[arg.type.length-1] !== '?') {
return Buffer.concat([
uint8_to_buff(ARGUMENT_TYPE_NORMAL), //argument type
Buffer.from(arg.label), //argument label
Buffer.from(legerifyArgLabel(arg.label)), //argument label
Buffer.from("00", "hex"), //trailing 0
uint8_to_buff(idx), //order in which should arguments display
Buffer.from(arg.type), //argument type
Expand All @@ -48,7 +65,7 @@ const readManifest = (testnetFile, mainnetFile) => {
if (arg.type[0] !== '[' && arg.type[arg.type.length-1] === '?') {
return Buffer.concat([
uint8_to_buff(ARGUMENT_TYPE_OPTIONAL), //argument type
Buffer.from(arg.label), //argument label
Buffer.from(legerifyArgLabel(arg.label)), //argument label
Buffer.from("00", "hex"), //trailing 0
uint8_to_buff(idx), //order in which should arguments display
Buffer.from(arg.type.slice(0, -1)), //argument type
Expand All @@ -61,7 +78,7 @@ const readManifest = (testnetFile, mainnetFile) => {
uint8_to_buff(ARGUMENT_TYPE_ARRAY), //argument type
uint8_to_buff(MIN_ARRAY_LENGTH), //min array length
uint8_to_buff(MAX_ARRAY_LENGTH), //max array length
Buffer.from(arg.label), //argument label
Buffer.from(legerifyArgLabel(arg.label)), //argument label
Buffer.from("00", "hex"), //trailing 0
uint8_to_buff(idx), //order in which should arguments display
Buffer.from(arg.type.slice(1, -1)), //argument type
Expand All @@ -74,7 +91,7 @@ const readManifest = (testnetFile, mainnetFile) => {
uint8_to_buff(ARGUMENT_TYPE_OPTIONALARRAY), //argument type
uint8_to_buff(MIN_ARRAY_LENGTH), //min array length
uint8_to_buff(MAX_ARRAY_LENGTH), //max array length
Buffer.from(arg.label), //argument label
Buffer.from(legerifyArgLabel(arg.label)), //argument label
Buffer.from("00", "hex"), //trailing 0
uint8_to_buff(idx), //order in which should arguments display
Buffer.from(arg.type.slice(1, -2)), //argument type
Expand All @@ -88,7 +105,7 @@ const readManifest = (testnetFile, mainnetFile) => {
Buffer.from("02", "hex"), // number of hashes
Buffer.from(templateTestnet.hash, "hex"), // hash testnet
Buffer.from(templateMainnet.hash, "hex"), // hash mainnet
Buffer.from(templateMainnet.name), // transaction name
Buffer.from(legerifyTxName(templateMainnet.name)), // transaction name
Buffer.from("00", "hex"), // trailing 0 after name
uint8_to_buff(templateMainnet.arguments.length), // number of arguments
Buffer.concat(templateMainnet.arguments.map((arg, idx) => processArg(arg, idx))),
Expand Down
Loading

0 comments on commit 4916e1b

Please sign in to comment.