add: display for Instructions

This commit is contained in:
realaltffour 2020-07-29 12:20:55 +03:00
parent f129da45ac
commit 7125a7572d
No known key found for this signature in database
GPG Key ID: C1265D839D44DCB1

View File

@ -9,6 +9,11 @@ pub enum CommandInst {
PurchaseAsset = 4,
SellAsset = 5
}
impl std::fmt::Display for CommandInst {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:#?}", self)
}
}
#[allow(dead_code)]
static INST_COMMAND_MAX_ID: isize = CommandInst::SellAsset as isize;
@ -26,6 +31,11 @@ pub enum DataTransferInst {
GetUserPortfolio = 14,
GetUserTransactionHist = 15,
}
impl std::fmt::Display for DataTransferInst {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:#?}", self)
}
}
#[allow(dead_code)]
static INST_DATA_MAX_ID: isize = DataTransferInst::GetUserTransactionHist as isize;