Skip to content

Commit

Permalink
update SCO.17 name
Browse files Browse the repository at this point in the history
  • Loading branch information
tarakby committed Jan 7, 2025
1 parent 68f842b commit 0905871
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/go/templates/cmd/manifest/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ func generateManifest(env templates.Environment) *manifest {
))

m.addTemplate(generateTemplate(
"SCO.17", "Register Node with PoP",
"SCO.17", "Register Node",
env,
templates.GenerateCollectionRegisterNode,
[]argument{
Expand Down
2 changes: 1 addition & 1 deletion lib/go/templates/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 lib/go/templates/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

0 comments on commit 0905871

Please # to comment.