Repository navigation
Conversation
22aaf65 to
abcd7f4
Compare
| | { | ||
| voteDelegation: { | ||
| keypath: Keypath | ||
| type: number |
There was a problem hiding this comment.
number is a bit too generic, wouldn't it be possible to narrow the values down with some enum? That would potentially allow for making this a union of different object shapes, making it clear when is drep hash required and when it isn't
Moreover, if possible, instead of null, I'd consider making the drepCredHash optional, at least from a typescript perspective it would feel more "natural"
There was a problem hiding this comment.
I agree, this type should be something like
CardanoDRepType = 'keyHash' | 'scriptHash' | 'alwaysAbstain' | 'alwaysNoConfidence'
if it doesn't work out of the box like this, check other enums (e.g. in btc.proto/btc.rs) and scripts/build-protos.rs for reference,
| | { | ||
| voteDelegation: { | ||
| keypath: Keypath | ||
| type: number |
There was a problem hiding this comment.
I agree, this type should be something like
CardanoDRepType = 'keyHash' | 'scriptHash' | 'alwaysAbstain' | 'alwaysNoConfidence'
if it doesn't work out of the box like this, check other enums (e.g. in btc.proto/btc.rs) and scripts/build-protos.rs for reference,
| voteDelegation: { | ||
| keypath: Keypath | ||
| type: number | ||
| drepCredhash: Uint8Array | undefined | null |
There was a problem hiding this comment.
why undefined or null? Seems like drepCredhash?: Uint8Array should be enough.
in scripts/build-protos.rs, you could rename this to drepCredHash (proper camelCase)
| ); | ||
| } | ||
|
|
||
| export function Cardano({ bb02 } : Props) { |
There was a problem hiding this comment.
please keep the same style (spaces, indent level, ...)
00d5d6a to
eb4173a
Compare
| ( | ||
| "shiftcrypto.bitbox02.CardanoSignTransactionRequest.Certificate.VoteDelegation.CardanoDRepType.KEY_HASH", | ||
| "serde(rename = \"keyHash\")", | ||
| ), | ||
| ( | ||
| "shiftcrypto.bitbox02.CardanoSignTransactionRequest.Certificate.VoteDelegation.CardanoDRepType.SCRIPT_HASH", | ||
| "serde(rename = \"scriptHash\")", | ||
| ), | ||
| ( | ||
| "shiftcrypto.bitbox02.CardanoSignTransactionRequest.Certificate.VoteDelegation.CardanoDRepType.ALWAYS_ABSTAIN", | ||
| "serde(rename = \"alwaysAbstain\")", | ||
| ), | ||
| ( | ||
| "shiftcrypto.bitbox02.CardanoSignTransactionRequest.Certificate.VoteDelegation.CardanoDRepType.ALWAYS_NO_CONFIDENCE", | ||
| "serde(rename = \"alwaysNoConfidence\")", | ||
| ), |
There was a problem hiding this comment.
These are not needed because camelCase is the default - the dRepType enum has this attribute already:
#[cfg_attr(feature = "wasm", serde(rename_all = "camelCase"))]
Could you remove these?
There was a problem hiding this comment.
I think you missed make build-protos afterwards, as these tags are still in the generated protobuf file. Please run make build-protos again.
| voteDelegation: { | ||
| keypath: Keypath | ||
| type: CardanoDrepType | ||
| drepCredHash?: Uint8Array |
There was a problem hiding this comment.
you changed the name here but the deserialization still uses drepCredhash, so if you tried to use drepCredHash, it would not actually show the hash and error after confirmation.
| ['zero-ttl', 'Transaction with TTL=0'], | ||
| ['tokens', 'Transaction sending tokens'], | ||
| ['delegate', 'Delegate staking to a pool'], | ||
| ['vote-delegation', 'Delegate vote to a dRep'], |
There was a problem hiding this comment.
Please add another one that delegates to a keyHash or scriptHash, or add a dropdown to the existing one to switch the mode so all of them can be tested in the sandbox. The hash ones don't work right now (see other comment).
|
In the meantime we released v0.7.0 to npmjs. Please rebase and change NPM_VERSION to 0.8.0. Thanks. |
f211ed6 to
18b8237
Compare
|
|
||
| ## Unreleased | ||
|
|
||
| ## 0.8.0 |
There was a problem hiding this comment.
please also change NPM_VERSION - https://github.com/BitBoxSwiss/bitbox-api-rs/blob/master/NPM_VERSION
| ( | ||
| "shiftcrypto.bitbox02.CardanoSignTransactionRequest.Certificate.VoteDelegation.CardanoDRepType.KEY_HASH", | ||
| "serde(rename = \"keyHash\")", | ||
| ), | ||
| ( | ||
| "shiftcrypto.bitbox02.CardanoSignTransactionRequest.Certificate.VoteDelegation.CardanoDRepType.SCRIPT_HASH", | ||
| "serde(rename = \"scriptHash\")", | ||
| ), | ||
| ( | ||
| "shiftcrypto.bitbox02.CardanoSignTransactionRequest.Certificate.VoteDelegation.CardanoDRepType.ALWAYS_ABSTAIN", | ||
| "serde(rename = \"alwaysAbstain\")", | ||
| ), | ||
| ( | ||
| "shiftcrypto.bitbox02.CardanoSignTransactionRequest.Certificate.VoteDelegation.CardanoDRepType.ALWAYS_NO_CONFIDENCE", | ||
| "serde(rename = \"alwaysNoConfidence\")", | ||
| ), |
There was a problem hiding this comment.
I think you missed make build-protos afterwards, as these tags are still in the generated protobuf file. Please run make build-protos again.
Added vote delegation to node api and wasm generation. Signed-off-by: RostarMarek <rostarmarek@gmail.com>
18b8237 to
afe26fd
Compare
Added vote delegation to node api and wasm generation.
I still have the issue where I can't build that I mentioned here so I wasn't able to load firmware to my dev device to properly test it out.