parent
c049e63059
commit
b75ce45006
@ -0,0 +1,44 @@
|
||||
// ButtonRequestType from messages-common.proto
|
||||
// Eventually this should be generated
|
||||
#[derive(Clone, Copy)]
|
||||
#[repr(u16)]
|
||||
pub enum ButtonRequestCode {
|
||||
Other = 1,
|
||||
FeeOverThreshold = 2,
|
||||
ConfirmOutput = 3,
|
||||
ResetDevice = 4,
|
||||
ConfirmWord = 5,
|
||||
WipeDevice = 6,
|
||||
ProtectCall = 7,
|
||||
SignTx = 8,
|
||||
FirmwareCheck = 9,
|
||||
Address = 10,
|
||||
PublicKey = 11,
|
||||
MnemonicWordCount = 12,
|
||||
MnemonicInput = 13,
|
||||
UnknownDerivationPath = 15,
|
||||
RecoveryHomepage = 16,
|
||||
Success = 17,
|
||||
Warning = 18,
|
||||
PassphraseEntry = 19,
|
||||
PinEntry = 20,
|
||||
}
|
||||
|
||||
impl ButtonRequestCode {
|
||||
pub fn num(&self) -> u16 {
|
||||
*self as u16
|
||||
}
|
||||
|
||||
pub fn with_type(self, br_type: &'static str) -> Option<ButtonRequest> {
|
||||
Some(ButtonRequest {
|
||||
code: self,
|
||||
br_type,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct ButtonRequest {
|
||||
pub code: ButtonRequestCode,
|
||||
pub br_type: &'static str,
|
||||
}
|
Loading…
Reference in new issue