1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 07:28:10 +00:00

Add voting support

This commit is contained in:
Adrian Nagy 2019-04-16 11:17:16 +02:00
commit c0e5a32dec
2 changed files with 20 additions and 24 deletions

View File

@ -55,6 +55,8 @@ message TezosSignTx {
optional TezosTransactionOp transaction = 4; // Tezos transaction operation
optional TezosOriginationOp origination = 5; // Tezos origination operation
optional TezosDelegationOp delegation = 6; // Tezos delegation operation
optional TezosProposalOp proposal = 7; // Tezos proposal operation
optional TezosBallotOp ballot = 8; // Tezos ballot operation
/*
* Tezos contract ID
*/
@ -120,6 +122,24 @@ message TezosSignTx {
optional uint64 storage_limit = 5;
optional bytes delegate = 6;
}
/**
* Structure representing information for proposal
*/
message TezosProposalOp {
optional bytes source = 1;
optional uint64 period = 2;
optional uint64 bytes_in_next_field = 3;
optional bytes proposals = 4;
}
/**
* Structure representing information for ballot
*/
message TezosBallotOp {
optional bytes source = 1;
optional uint64 period = 2;
optional bytes proposal = 3;
optional bytes ballot = 4;
}
}
/**

View File

@ -1,24 +0,0 @@
from apps.common.writers import (
write_bytes,
write_uint8,
write_uint32_be,
write_uint64_be,
)
write_uint8 = write_uint8
write_uint32 = write_uint32_be
write_uint64 = write_uint64_be
write_bytes = write_bytes
def write_bool(w: bytearray, boolean: bool):
if boolean:
write_uint8(w, 255)
else:
write_uint8(w, 0)
# write uint16 in be
def write_uint16(w: bytearray, n: int):
w.append((n >> 8) & 0xFF)
w.append(n & 0xFF)