Skip to content

Commit

Permalink
Merge commit 'refs/pull/1299/head' of https://github.com/BitBoxSwiss/…
Browse files Browse the repository at this point in the history
  • Loading branch information
benma committed Sep 18, 2024
2 parents 83cd6c8 + d0e3716 commit d966071
Show file tree
Hide file tree
Showing 9 changed files with 359 additions and 25 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ customers cannot upgrade their bootloader, its changes are recorded separately.
### [Unreleased]
- Bitcoin: add support for sending to silent payment (BIP-352) addresses
- Bitcoin: add support for regtest
- Cardano: add support for vote delegation

### 9.20.0
- Bitcoin: UX improvements for payment request confirmations
Expand Down
16 changes: 15 additions & 1 deletion messages/cardano.proto
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,30 @@ message CardanoSignTransactionRequest {
repeated AssetGroup asset_groups = 4;
}

// See https://github.com/input-output-hk/cardano-ledger-specs/blob/d0aa86ded0b973b09b629e5aa62aa1e71364d088/eras/alonzo/test-suite/cddl-files/alonzo.cddl#L150
// See https://github.com/IntersectMBO/cardano-ledger/blob/cardano-ledger-conway-1.12.0.0/eras/conway/impl/cddl-files/conway.cddl#L273
message Certificate {
message StakeDelegation {
repeated uint32 keypath = 1;
bytes pool_keyhash = 2;
}
message VoteDelegation {
enum CardanoDRepType {
KEY_HASH = 0;
SCRIPT_HASH = 1;
ALWAYS_ABSTAIN = 2;
ALWAYS_NO_CONFIDENCE = 3;
}

// keypath in this instance refers to stake credential
repeated uint32 keypath = 1;
CardanoDRepType type = 2;
optional bytes drep_credhash = 3;
}
oneof cert {
Keypath stake_registration = 1;
Keypath stake_deregistration = 2;
StakeDelegation stake_delegation = 3;
VoteDelegation vote_delegation = 10;
}
}

Expand Down
38 changes: 21 additions & 17 deletions py/bitbox02/bitbox02/communication/generated/cardano_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 46 additions & 4 deletions py/bitbox02/bitbox02/communication/generated/cardano_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class CardanoSignTransactionRequest(google.protobuf.message.Message):
def ClearField(self, field_name: typing_extensions.Literal["asset_groups",b"asset_groups","encoded_address",b"encoded_address","script_config",b"script_config","value",b"value"]) -> None: ...

class Certificate(google.protobuf.message.Message):
"""See https://github.com/input-output-hk/cardano-ledger-specs/blob/d0aa86ded0b973b09b629e5aa62aa1e71364d088/eras/alonzo/test-suite/cddl-files/alonzo.cddl#L150"""
"""See https://github.com/IntersectMBO/cardano-ledger/blob/cardano-ledger-conway-1.12.0.0/eras/conway/impl/cddl-files/conway.cddl#L273"""
DESCRIPTOR: google.protobuf.descriptor.Descriptor
class StakeDelegation(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor
Expand All @@ -198,24 +198,66 @@ class CardanoSignTransactionRequest(google.protobuf.message.Message):
) -> None: ...
def ClearField(self, field_name: typing_extensions.Literal["keypath",b"keypath","pool_keyhash",b"pool_keyhash"]) -> None: ...

class VoteDelegation(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor
class _CardanoDRepType:
ValueType = typing.NewType('ValueType', builtins.int)
V: typing_extensions.TypeAlias = ValueType
class _CardanoDRepTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[CardanoSignTransactionRequest.Certificate.VoteDelegation._CardanoDRepType.ValueType], builtins.type):
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
KEY_HASH: CardanoSignTransactionRequest.Certificate.VoteDelegation._CardanoDRepType.ValueType # 0
SCRIPT_HASH: CardanoSignTransactionRequest.Certificate.VoteDelegation._CardanoDRepType.ValueType # 1
ALWAYS_ABSTAIN: CardanoSignTransactionRequest.Certificate.VoteDelegation._CardanoDRepType.ValueType # 2
ALWAYS_NO_CONFIDENCE: CardanoSignTransactionRequest.Certificate.VoteDelegation._CardanoDRepType.ValueType # 3
class CardanoDRepType(_CardanoDRepType, metaclass=_CardanoDRepTypeEnumTypeWrapper):
pass

KEY_HASH: CardanoSignTransactionRequest.Certificate.VoteDelegation.CardanoDRepType.ValueType # 0
SCRIPT_HASH: CardanoSignTransactionRequest.Certificate.VoteDelegation.CardanoDRepType.ValueType # 1
ALWAYS_ABSTAIN: CardanoSignTransactionRequest.Certificate.VoteDelegation.CardanoDRepType.ValueType # 2
ALWAYS_NO_CONFIDENCE: CardanoSignTransactionRequest.Certificate.VoteDelegation.CardanoDRepType.ValueType # 3

KEYPATH_FIELD_NUMBER: builtins.int
TYPE_FIELD_NUMBER: builtins.int
DREP_CREDHASH_FIELD_NUMBER: builtins.int
@property
def keypath(self) -> google.protobuf.internal.containers.RepeatedScalarFieldContainer[builtins.int]:
"""keypath in this instance refers to stake credential"""
pass
type: global___CardanoSignTransactionRequest.Certificate.VoteDelegation.CardanoDRepType.ValueType
drep_credhash: builtins.bytes
def __init__(self,
*,
keypath: typing.Optional[typing.Iterable[builtins.int]] = ...,
type: global___CardanoSignTransactionRequest.Certificate.VoteDelegation.CardanoDRepType.ValueType = ...,
drep_credhash: typing.Optional[builtins.bytes] = ...,
) -> None: ...
def HasField(self, field_name: typing_extensions.Literal["_drep_credhash",b"_drep_credhash","drep_credhash",b"drep_credhash"]) -> builtins.bool: ...
def ClearField(self, field_name: typing_extensions.Literal["_drep_credhash",b"_drep_credhash","drep_credhash",b"drep_credhash","keypath",b"keypath","type",b"type"]) -> None: ...
def WhichOneof(self, oneof_group: typing_extensions.Literal["_drep_credhash",b"_drep_credhash"]) -> typing.Optional[typing_extensions.Literal["drep_credhash"]]: ...

STAKE_REGISTRATION_FIELD_NUMBER: builtins.int
STAKE_DEREGISTRATION_FIELD_NUMBER: builtins.int
STAKE_DELEGATION_FIELD_NUMBER: builtins.int
VOTE_DELEGATION_FIELD_NUMBER: builtins.int
@property
def stake_registration(self) -> common_pb2.Keypath: ...
@property
def stake_deregistration(self) -> common_pb2.Keypath: ...
@property
def stake_delegation(self) -> global___CardanoSignTransactionRequest.Certificate.StakeDelegation: ...
@property
def vote_delegation(self) -> global___CardanoSignTransactionRequest.Certificate.VoteDelegation: ...
def __init__(self,
*,
stake_registration: typing.Optional[common_pb2.Keypath] = ...,
stake_deregistration: typing.Optional[common_pb2.Keypath] = ...,
stake_delegation: typing.Optional[global___CardanoSignTransactionRequest.Certificate.StakeDelegation] = ...,
vote_delegation: typing.Optional[global___CardanoSignTransactionRequest.Certificate.VoteDelegation] = ...,
) -> None: ...
def HasField(self, field_name: typing_extensions.Literal["cert",b"cert","stake_delegation",b"stake_delegation","stake_deregistration",b"stake_deregistration","stake_registration",b"stake_registration"]) -> builtins.bool: ...
def ClearField(self, field_name: typing_extensions.Literal["cert",b"cert","stake_delegation",b"stake_delegation","stake_deregistration",b"stake_deregistration","stake_registration",b"stake_registration"]) -> None: ...
def WhichOneof(self, oneof_group: typing_extensions.Literal["cert",b"cert"]) -> typing.Optional[typing_extensions.Literal["stake_registration","stake_deregistration","stake_delegation"]]: ...
def HasField(self, field_name: typing_extensions.Literal["cert",b"cert","stake_delegation",b"stake_delegation","stake_deregistration",b"stake_deregistration","stake_registration",b"stake_registration","vote_delegation",b"vote_delegation"]) -> builtins.bool: ...
def ClearField(self, field_name: typing_extensions.Literal["cert",b"cert","stake_delegation",b"stake_delegation","stake_deregistration",b"stake_deregistration","stake_registration",b"stake_registration","vote_delegation",b"vote_delegation"]) -> None: ...
def WhichOneof(self, oneof_group: typing_extensions.Literal["cert",b"cert"]) -> typing.Optional[typing_extensions.Literal["stake_registration","stake_deregistration","stake_delegation","vote_delegation"]]: ...

class Withdrawal(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor
Expand Down
Loading

0 comments on commit d966071

Please sign in to comment.