Skip to content

Commit

Permalink
update node registration name to fix display
Browse files Browse the repository at this point in the history
  • Loading branch information
tarakby committed Dec 9, 2024
1 parent b775eab commit 2aea834
Show file tree
Hide file tree
Showing 15 changed files with 37 additions and 37 deletions.
12 changes: 6 additions & 6 deletions js/src/txMerkleTree.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
export const merkleTree = {
"hash": "a24800ec9955cf169da4c3ef336f941fc523a7689ac320c4da663b5cd73a4b1b",
"hash": "66fb7db3d9d76c4fe0636cbc359fabdab14833cfebbd4db5c69b82386c405e93",
"children": [
{
"hash": "1fd37e660815f3527dd9416bd654244f0b1c801df4c9a831c35b629d90d7f18c",
"hash": "ba559f70a6e87a271b82c28e27cba128ed323ad04dccf06b496832abf64ac150",
"children": [
{
"hash": "c2321ad4bc3dc064a443dddc4aff55056786688958ab73057b1abd87791221d4",
"hash": "a9ab356c56aeb81498872e7ae7127b6ddf31d9faf55e1a63d2bd5cb572dcfb19",
"children": [
{
"hash": "4f7c6cc135c8aa32426d5303a93685b67e7088d862f3cf1ed1d827abcdfd544c",
Expand Down Expand Up @@ -149,7 +149,7 @@ export const merkleTree = {
]
},
{
"hash": "33737e594611ca0f0ea3b028b75089560fe9a4d85f432b9e2e6d94ab947326b4",
"hash": "4bd93aff8e534c10cc45e7ad7097e675283b5dbcf7cf25a390d9dd161aa18dd0",
"children": [
{
"hash": "16e1958afb20d53eddddc48645038e2d42890a2505c0b9807bf2f8ce6a2b6695",
Expand All @@ -176,9 +176,9 @@ export const merkleTree = {
]
},
{
"hash": "d889ca7789f024e470d65b49ac79ac32d01bb1d2c42329262cc58005c807b5f0",
"hash": "e7446ff049434c776551d14da776aefeb9860205149ae10b193589472f079ac0",
"children": [
"0215face232abba7795997f06ec6f07a4e7d14743e6ed4f33d9e26ad02017b917f88bdc9bb28ce734d1edc4b64ae5adf99ff3ac572dbe0d09090795bf78c7c31a65265676973746572204e6f6465207769746820506f50000a044e6f64652049440000074e6f646520526f6c650001044e6574772e20416464726573730002044e6574772e204b65790003045374616b696e67204b65790004045374616b696e67204b657920506f50000501416d6f756e7400065546697836340003044d41205075622e204b65790007064d41205369676e2e20416c672e0008054d41204861736820416c672e0009"
"0215face232abba7795997f06ec6f07a4e7d14743e6ed4f33d9e26ad02017b917f88bdc9bb28ce734d1edc4b64ae5adf99ff3ac572dbe0d09090795bf78c7c31a65265676973746572204e6f6465000a044e6f64652049440000074e6f646520526f6c650001044e6574772e20416464726573730002044e6574772e204b65790003045374616b696e67204b65790004045374616b696e67204b657920506f50000501416d6f756e7400065546697836340003044d41205075622e204b65790007064d41205369676e2e20416c672e0008054d41204861736820416c672e0009"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions js/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ async function runTest() {
["3302010002f904","9000"],
["330203007b029e46752d27947cc85e5fb62f4deecb12bd7b2a721211ef944acf528bd648dcd79e46752d27947cc85e5fb62f4deecb12bd7b2a721211ef944acf528bd648dcd7437265617465204163636f756e740003045075626c6963204b65790000065369676e617475726520416c672e0001054861736820416c672e0002", "9000"],
["33020400e023b0dd67bd651dd2ae5c318486bf96f170173d6eb52bbb8867fc4b9914be7caac44d21aa30fcd3c717c02151cb60275dd84e97ab0f6e03f3b8b67c8701ce0e0066f2970da5775dece3467df9268d5f5349c57ba0cb5016bc3a4412eb9b1bd4b609e42bcf86c1357d31d8ed3d2569596e58f44efeef4a7aa2c89adc30242f2d6e589eb34bbae9b1da9ecddca7fd3d2e03d6a383b9b7c0209ef2711a657e7dedc5779cf5bedad006f073e50ac176159dfb9e020957d29b81947dbfe07d9136b1fa932bebc831854a61bc79fd527ce161c0fc279a6dce5d326499f0215356337bdf", "9000"],
["33020400e04f7c6cc135c8aa32426d5303a93685b67e7088d862f3cf1ed1d827abcdfd544c742d6e0015520cf3206f04bd73d312f1d20d767b28b5932e157f16d77369d5b0700b87fc1343839e67f28a65b58dc091282cde796ef16d069a3b60f6ee3f8c2033737e594611ca0f0ea3b028b75089560fe9a4d85f432b9e2e6d94ab947326b463981575be94aaa4f14daa9f27c6c2fd72b46de3994ed71abaec45aa4b40615a63981575be94aaa4f14daa9f27c6c2fd72b46de3994ed71abaec45aa4b40615a63981575be94aaa4f14daa9f27c6c2fd72b46de3994ed71abaec45aa4b40615a", "9000"],
["33020400e0c2321ad4bc3dc064a443dddc4aff55056786688958ab73057b1abd87791221d488bd487007bf1a5be47cea944d797895181258aba33c77e8c75fe7e38ad9192988bd487007bf1a5be47cea944d797895181258aba33c77e8c75fe7e38ad9192988bd487007bf1a5be47cea944d797895181258aba33c77e8c75fe7e38ad9192988bd487007bf1a5be47cea944d797895181258aba33c77e8c75fe7e38ad9192988bd487007bf1a5be47cea944d797895181258aba33c77e8c75fe7e38ad9192988bd487007bf1a5be47cea944d797895181258aba33c77e8c75fe7e38ad91929", "9000"],
["33020500e01fd37e660815f3527dd9416bd654244f0b1c801df4c9a831c35b629d90d7f18c94a4bf5f458f2def50f807bf419501bfd5e77a084c30592aa3803a522a3c272e94a4bf5f458f2def50f807bf419501bfd5e77a084c30592aa3803a522a3c272e94a4bf5f458f2def50f807bf419501bfd5e77a084c30592aa3803a522a3c272e94a4bf5f458f2def50f807bf419501bfd5e77a084c30592aa3803a522a3c272e94a4bf5f458f2def50f807bf419501bfd5e77a084c30592aa3803a522a3c272e94a4bf5f458f2def50f807bf419501bfd5e77a084c30592aa3803a522a3c272e", "47fba63d87cac1a4d3d6345eb9ad4a8197d15cad816326675b950dc084fc90eb09a4c529640f92a5f07c4f54221f26f08a09c3d635cac6cc633050e0dff9e844003044022047fba63d87cac1a4d3d6345eb9ad4a8197d15cad816326675b950dc084fc90eb022009a4c529640f92a5f07c4f54221f26f08a09c3d635cac6cc633050e0dff9e8449000"],
["33020400e04f7c6cc135c8aa32426d5303a93685b67e7088d862f3cf1ed1d827abcdfd544c742d6e0015520cf3206f04bd73d312f1d20d767b28b5932e157f16d77369d5b0700b87fc1343839e67f28a65b58dc091282cde796ef16d069a3b60f6ee3f8c204bd93aff8e534c10cc45e7ad7097e675283b5dbcf7cf25a390d9dd161aa18dd063981575be94aaa4f14daa9f27c6c2fd72b46de3994ed71abaec45aa4b40615a63981575be94aaa4f14daa9f27c6c2fd72b46de3994ed71abaec45aa4b40615a63981575be94aaa4f14daa9f27c6c2fd72b46de3994ed71abaec45aa4b40615a", "9000"],
["33020400e0a9ab356c56aeb81498872e7ae7127b6ddf31d9faf55e1a63d2bd5cb572dcfb1988bd487007bf1a5be47cea944d797895181258aba33c77e8c75fe7e38ad9192988bd487007bf1a5be47cea944d797895181258aba33c77e8c75fe7e38ad9192988bd487007bf1a5be47cea944d797895181258aba33c77e8c75fe7e38ad9192988bd487007bf1a5be47cea944d797895181258aba33c77e8c75fe7e38ad9192988bd487007bf1a5be47cea944d797895181258aba33c77e8c75fe7e38ad9192988bd487007bf1a5be47cea944d797895181258aba33c77e8c75fe7e38ad91929", "9000"],
["33020500e0ba559f70a6e87a271b82c28e27cba128ed323ad04dccf06b496832abf64ac15094a4bf5f458f2def50f807bf419501bfd5e77a084c30592aa3803a522a3c272e94a4bf5f458f2def50f807bf419501bfd5e77a084c30592aa3803a522a3c272e94a4bf5f458f2def50f807bf419501bfd5e77a084c30592aa3803a522a3c272e94a4bf5f458f2def50f807bf419501bfd5e77a084c30592aa3803a522a3c272e94a4bf5f458f2def50f807bf419501bfd5e77a084c30592aa3803a522a3c272e94a4bf5f458f2def50f807bf419501bfd5e77a084c30592aa3803a522a3c272e", "47fba63d87cac1a4d3d6345eb9ad4a8197d15cad816326675b950dc084fc90eb09a4c529640f92a5f07c4f54221f26f08a09c3d635cac6cc633050e0dff9e844003044022047fba63d87cac1a4d3d6345eb9ad4a8197d15cad816326675b950dc084fc90eb022009a4c529640f92a5f07c4f54221f26f08a09c3d635cac6cc633050e0dff9e8449000"],
]

tx2 = "f904"
Expand Down
4 changes: 2 additions & 2 deletions src/tx_metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ struct {
} txMetadataState;

static const uint8_t merkleTreeRoot[METADATA_HASH_SIZE] = {
0xa2, 0x48, 0x00, 0xec, 0x99, 0x55, 0xcf, 0x16, 0x9d, 0xa4, 0xc3, 0xef, 0x33, 0x6f, 0x94, 0x1f,
0xc5, 0x23, 0xa7, 0x68, 0x9a, 0xc3, 0x20, 0xc4, 0xda, 0x66, 0x3b, 0x5c, 0xd7, 0x3a, 0x4b, 0x1b};
0x66, 0xfb, 0x7d, 0xb3, 0xd9, 0xd7, 0x6c, 0x4f, 0xe0, 0x63, 0x6c, 0xbc, 0x35, 0x9f, 0xab, 0xda,
0xb1, 0x48, 0x33, 0xcf, 0xeb, 0xbd, 0x4d, 0xb5, 0xc6, 0x9b, 0x82, 0x38, 0x6c, 0x40, 0x5e, 0x93};

static const char *STRING_TYPE_STRING = "String";
static const char *UINT8_TYPE_STRING = "UInt8";
Expand Down
12 changes: 6 additions & 6 deletions tests/application_client/txMerkleTree.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# pylint: skip-file
merkleTree = {
"hash": "a24800ec9955cf169da4c3ef336f941fc523a7689ac320c4da663b5cd73a4b1b",
"hash": "66fb7db3d9d76c4fe0636cbc359fabdab14833cfebbd4db5c69b82386c405e93",
"children": [
{
"hash": "1fd37e660815f3527dd9416bd654244f0b1c801df4c9a831c35b629d90d7f18c",
"hash": "ba559f70a6e87a271b82c28e27cba128ed323ad04dccf06b496832abf64ac150",
"children": [
{
"hash": "c2321ad4bc3dc064a443dddc4aff55056786688958ab73057b1abd87791221d4",
"hash": "a9ab356c56aeb81498872e7ae7127b6ddf31d9faf55e1a63d2bd5cb572dcfb19",
"children": [
{
"hash": "4f7c6cc135c8aa32426d5303a93685b67e7088d862f3cf1ed1d827abcdfd544c",
Expand Down Expand Up @@ -150,7 +150,7 @@
]
},
{
"hash": "33737e594611ca0f0ea3b028b75089560fe9a4d85f432b9e2e6d94ab947326b4",
"hash": "4bd93aff8e534c10cc45e7ad7097e675283b5dbcf7cf25a390d9dd161aa18dd0",
"children": [
{
"hash": "16e1958afb20d53eddddc48645038e2d42890a2505c0b9807bf2f8ce6a2b6695",
Expand All @@ -177,9 +177,9 @@
]
},
{
"hash": "d889ca7789f024e470d65b49ac79ac32d01bb1d2c42329262cc58005c807b5f0",
"hash": "e7446ff049434c776551d14da776aefeb9860205149ae10b193589472f079ac0",
"children": [
"0215face232abba7795997f06ec6f07a4e7d14743e6ed4f33d9e26ad02017b917f88bdc9bb28ce734d1edc4b64ae5adf99ff3ac572dbe0d09090795bf78c7c31a65265676973746572204e6f6465207769746820506f50000a044e6f64652049440000074e6f646520526f6c650001044e6574772e20416464726573730002044e6574772e204b65790003045374616b696e67204b65790004045374616b696e67204b657920506f50000501416d6f756e7400065546697836340003044d41205075622e204b65790007064d41205369676e2e20416c672e0008054d41204861736820416c672e0009"
"0215face232abba7795997f06ec6f07a4e7d14743e6ed4f33d9e26ad02017b917f88bdc9bb28ce734d1edc4b64ae5adf99ff3ac572dbe0d09090795bf78c7c31a65265676973746572204e6f6465000a044e6f64652049440000074e6f646520526f6c650001044e6574772e20416464726573730002044e6574772e204b65790003045374616b696e67204b65790004045374616b696e67204b657920506f50000501416d6f756e7400065546697836340003044d41205075622e204b65790007064d41205369676e2e20416c672e0008054d41204861736820416c672e0009"
]
},
{
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.
2 changes: 1 addition & 1 deletion transaction_metadata/manifest.mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,7 @@
},
{
"id": "SCO.17",
"name": "Register Node with PoP",
"name": "Register Node",
"source": "import Crypto\nimport FlowStakingCollection from 0x8d0e87b65159ae63\n\n/// Registers a delegator in the staking collection resource\n/// for the specified node information and the amount of tokens to commit\n\ntransaction(id: String,\n role: UInt8,\n networkingAddress: String,\n networkingKey: String,\n stakingKey: String,\n stakingKeyPoP: String,\n amount: UFix64,\n machineAccountKey: String, \n machineAccountKeySignatureAlgorithm: UInt8, \n machineAccountKeyHashAlgorithm: UInt8) {\n\n let stakingCollectionRef: auth(FlowStakingCollection.CollectionOwner) \u0026FlowStakingCollection.StakingCollection\n\n prepare(account: auth(BorrowValue) \u0026Account) {\n pre {\n\t\t\tmachineAccountKeySignatureAlgorithm == 1 || machineAccountKeySignatureAlgorithm == 2:\n \"Cannot register node with provided machine account key: Must provide a signature algorithm raw value that corresponds to \"\n .concat(\"one of the available signature algorithms for Flow keys.\")\n .concat(\"You provided \").concat(machineAccountKeySignatureAlgorithm.toString())\n .concat(\" but the options are either 1 (ECDSA_P256) or 2 (ECDSA_secp256k1).\")\n\t\t\tmachineAccountKeyHashAlgorithm == 1 || machineAccountKeyHashAlgorithm == 3:\n \"Cannot register node with provided machine account key: Must provide a hash algorithm raw value that corresponds to \"\n .concat(\"one of of the available hash algorithms for Flow keys.\")\n .concat(\"You provided \").concat(machineAccountKeyHashAlgorithm.toString())\n .concat(\" but the options are either 1 (SHA2_256) or 3 (SHA3_256).\")\n\t\t}\n\n self.stakingCollectionRef = account.storage.borrow\u003cauth(FlowStakingCollection.CollectionOwner) \u0026FlowStakingCollection.StakingCollection\u003e(from: FlowStakingCollection.StakingCollectionStoragePath)\n ?? panic(FlowStakingCollection.getCollectionMissingError(nil))\n\n if let machineAccount = self.stakingCollectionRef.registerNode(\n id: id,\n role: role,\n networkingAddress: networkingAddress,\n networkingKey: networkingKey,\n stakingKey: stakingKey,\n stakingKeyPoP: stakingKeyPoP,\n amount: amount,\n payer: account\n ) {\n let sigAlgo = SignatureAlgorithm(rawValue: machineAccountKeySignatureAlgorithm)!\n\n let hashAlgo = HashAlgorithm(rawValue: machineAccountKeyHashAlgorithm)!\n \n let publicKey = PublicKey(\n\t\t\t publicKey: machineAccountKey.decodeHex(),\n\t\t\t signatureAlgorithm: sigAlgo\n\t\t )\n machineAccount.keys.add(publicKey: publicKey, hashAlgorithm: hashAlgo, weight: 1000.0)\n }\n }\n}\n",
"arguments": [
{
Expand Down
2 changes: 1 addition & 1 deletion transaction_metadata/manifest.testnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -1119,7 +1119,7 @@
},
{
"id": "SCO.17",
"name": "Register Node with PoP",
"name": "Register Node",
"source": "import Crypto\nimport FlowStakingCollection from 0x95e019a17d0e23d7\n\n/// Registers a delegator in the staking collection resource\n/// for the specified node information and the amount of tokens to commit\n\ntransaction(id: String,\n role: UInt8,\n networkingAddress: String,\n networkingKey: String,\n stakingKey: String,\n stakingKeyPoP: String,\n amount: UFix64,\n machineAccountKey: String, \n machineAccountKeySignatureAlgorithm: UInt8, \n machineAccountKeyHashAlgorithm: UInt8) {\n\n let stakingCollectionRef: auth(FlowStakingCollection.CollectionOwner) \u0026FlowStakingCollection.StakingCollection\n\n prepare(account: auth(BorrowValue) \u0026Account) {\n pre {\n\t\t\tmachineAccountKeySignatureAlgorithm == 1 || machineAccountKeySignatureAlgorithm == 2:\n \"Cannot register node with provided machine account key: Must provide a signature algorithm raw value that corresponds to \"\n .concat(\"one of the available signature algorithms for Flow keys.\")\n .concat(\"You provided \").concat(machineAccountKeySignatureAlgorithm.toString())\n .concat(\" but the options are either 1 (ECDSA_P256) or 2 (ECDSA_secp256k1).\")\n\t\t\tmachineAccountKeyHashAlgorithm == 1 || machineAccountKeyHashAlgorithm == 3:\n \"Cannot register node with provided machine account key: Must provide a hash algorithm raw value that corresponds to \"\n .concat(\"one of of the available hash algorithms for Flow keys.\")\n .concat(\"You provided \").concat(machineAccountKeyHashAlgorithm.toString())\n .concat(\" but the options are either 1 (SHA2_256) or 3 (SHA3_256).\")\n\t\t}\n\n self.stakingCollectionRef = account.storage.borrow\u003cauth(FlowStakingCollection.CollectionOwner) \u0026FlowStakingCollection.StakingCollection\u003e(from: FlowStakingCollection.StakingCollectionStoragePath)\n ?? panic(FlowStakingCollection.getCollectionMissingError(nil))\n\n if let machineAccount = self.stakingCollectionRef.registerNode(\n id: id,\n role: role,\n networkingAddress: networkingAddress,\n networkingKey: networkingKey,\n stakingKey: stakingKey,\n stakingKeyPoP: stakingKeyPoP,\n amount: amount,\n payer: account\n ) {\n let sigAlgo = SignatureAlgorithm(rawValue: machineAccountKeySignatureAlgorithm)!\n\n let hashAlgo = HashAlgorithm(rawValue: machineAccountKeyHashAlgorithm)!\n \n let publicKey = PublicKey(\n\t\t\t publicKey: machineAccountKey.decodeHex(),\n\t\t\t signatureAlgorithm: sigAlgo\n\t\t )\n machineAccount.keys.add(publicKey: publicKey, hashAlgorithm: hashAlgo, weight: 1000.0)\n }\n }\n}\n",
"arguments": [
{
Expand Down
12 changes: 6 additions & 6 deletions transaction_metadata/txMerkleTree.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
export const merkleTree = {
"hash": "a24800ec9955cf169da4c3ef336f941fc523a7689ac320c4da663b5cd73a4b1b",
"hash": "66fb7db3d9d76c4fe0636cbc359fabdab14833cfebbd4db5c69b82386c405e93",
"children": [
{
"hash": "1fd37e660815f3527dd9416bd654244f0b1c801df4c9a831c35b629d90d7f18c",
"hash": "ba559f70a6e87a271b82c28e27cba128ed323ad04dccf06b496832abf64ac150",
"children": [
{
"hash": "c2321ad4bc3dc064a443dddc4aff55056786688958ab73057b1abd87791221d4",
"hash": "a9ab356c56aeb81498872e7ae7127b6ddf31d9faf55e1a63d2bd5cb572dcfb19",
"children": [
{
"hash": "4f7c6cc135c8aa32426d5303a93685b67e7088d862f3cf1ed1d827abcdfd544c",
Expand Down Expand Up @@ -149,7 +149,7 @@ export const merkleTree = {
]
},
{
"hash": "33737e594611ca0f0ea3b028b75089560fe9a4d85f432b9e2e6d94ab947326b4",
"hash": "4bd93aff8e534c10cc45e7ad7097e675283b5dbcf7cf25a390d9dd161aa18dd0",
"children": [
{
"hash": "16e1958afb20d53eddddc48645038e2d42890a2505c0b9807bf2f8ce6a2b6695",
Expand All @@ -176,9 +176,9 @@ export const merkleTree = {
]
},
{
"hash": "d889ca7789f024e470d65b49ac79ac32d01bb1d2c42329262cc58005c807b5f0",
"hash": "e7446ff049434c776551d14da776aefeb9860205149ae10b193589472f079ac0",
"children": [
"0215face232abba7795997f06ec6f07a4e7d14743e6ed4f33d9e26ad02017b917f88bdc9bb28ce734d1edc4b64ae5adf99ff3ac572dbe0d09090795bf78c7c31a65265676973746572204e6f6465207769746820506f50000a044e6f64652049440000074e6f646520526f6c650001044e6574772e20416464726573730002044e6574772e204b65790003045374616b696e67204b65790004045374616b696e67204b657920506f50000501416d6f756e7400065546697836340003044d41205075622e204b65790007064d41205369676e2e20416c672e0008054d41204861736820416c672e0009"
"0215face232abba7795997f06ec6f07a4e7d14743e6ed4f33d9e26ad02017b917f88bdc9bb28ce734d1edc4b64ae5adf99ff3ac572dbe0d09090795bf78c7c31a65265676973746572204e6f6465000a044e6f64652049440000074e6f646520526f6c650001044e6574772e20416464726573730002044e6574772e204b65790003045374616b696e67204b65790004045374616b696e67204b657920506f50000501416d6f756e7400065546697836340003044d41205075622e204b65790007064d41205369676e2e20416c672e0008054d41204861736820416c672e0009"
]
},
{
Expand Down
Loading

0 comments on commit 2aea834

Please sign in to comment.