Skip to content

Commit

Permalink
Revert "Remove catalyst voting unit test"
Browse files Browse the repository at this point in the history
This reverts commit f076330.
  • Loading branch information
DavidTranDucVL committed May 27, 2021
1 parent 76ba287 commit f65827f
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions test/unit/commandParser/commandParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,55 @@ describe('Command parser', () => {
}
assert.deepStrictEqual(parsedArgs, expectedResult)
})
it('Should parse sign catalyst voting registration', () => {
const args = pad([
'catalyst',
'voting-key-registration-metadata',
'--testnet-magic',
'42',
'--vote-public-key',
prefix('vote.pub'),
'--reward-address',
'adr_test1qq2vzmtlgvjrhkq50rngh8d482zj3l20kyrc6kx4ffl3zfqayfawlf9hwv2fzuygt2km5v92kvf8e3s3mk7ynxw77cwq2glhm4',
'--stake-signing-key',
prefix('stake.hwsfile'),
'--nonce',
'165564',
'--reward-address-signing-key',
prefix('payment.hwsfile'),
'--reward-address-signing-key',
prefix('stake.hwsfile'),
'--metadata-cbor-out-file',
'voting_registration.cbor',
])
const { parsedArgs } = parse(args)
const expectedResult = {
command: CommandType.CATALYST_VOTING_KEY_REGISTRATION_METADATA,
network: NETWORKS.TESTNET,
rewardAddressSigningKeyData: [
{
type: 0,
path: [2147485463, 2147485500, 2147483648, 2, 1],
cborXPubKeyHex: '5880e0d9c2e5b...7277e7db',
},
{
type: 1,
path: [2147485500, 2147485463, 2147483648, 2, 0],
cborXPubKeyHex: '584066610efd336e1137c525937b76511fbcf2a0e6bcf0d340a67bcb39bc870d85e8e977e956d29810dbfbda9c8ea667585982454e401c68578623d4b86bc7eb7b58',
},
],
hwStakeSigningFileData: {
type: 1,
path: [2147485500, 2147485463, 2147483648, 2, 0],
cborXPubKeyHex: '584066610efd336e1137c525937b76511fbcf2a0e6bcf0d340a67bcb39bc870d85e8e977e956d29810dbfbda9c8ea667585982454e401c68578623d4b86bc7eb7b58',
},
nonce: 165564n,
outFile: 'voting_registration.cbor',
rewardAddress: 'adr_test1qq2vzmtlgvjrhkq50rngh8d482zj3l20kyrc6kx4ffl3zfqayfawlf9hwv2fzuygt2km5v92kvf8e3s3mk7ynxw77cwq2glhm4',
votePublicKey: '3b40265111d8bb3c3c608d95b3a0bf83461ace32d79336579a1939b3aad1c0b7',
}
assert.deepStrictEqual(parsedArgs, expectedResult)
})
})

// TODO add something for op certs (node ...)

0 comments on commit f65827f

Please sign in to comment.