mirror of
https://github.com/alexgo-io/stacks-puppet-node.git
synced 2026-05-25 10:12:40 +08:00
feat: ProblematicTransaction error variant
This commit is contained in:
@@ -118,6 +118,7 @@ pub enum Error {
|
||||
PoxAlreadyLocked,
|
||||
PoxInsufficientBalance,
|
||||
PoxNoRewardCycle,
|
||||
ProblematicTransaction(Txid),
|
||||
}
|
||||
|
||||
impl From<marf_error> for Error {
|
||||
@@ -188,6 +189,11 @@ impl fmt::Display for Error {
|
||||
r
|
||||
)
|
||||
}
|
||||
Error::ProblematicTransaction(ref txid) => write!(
|
||||
f,
|
||||
"Transaction {} is problematic and will not be mined again",
|
||||
txid
|
||||
),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -221,6 +227,7 @@ impl error::Error for Error {
|
||||
Error::PoxInsufficientBalance => None,
|
||||
Error::PoxNoRewardCycle => None,
|
||||
Error::StacksTransactionSkipped(ref _r) => None,
|
||||
Error::ProblematicTransaction(ref _txid) => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -254,6 +261,7 @@ impl Error {
|
||||
Error::PoxInsufficientBalance => "PoxInsufficientBalance",
|
||||
Error::PoxNoRewardCycle => "PoxNoRewardCycle",
|
||||
Error::StacksTransactionSkipped(ref _r) => "StacksTransactionSkipped",
|
||||
Error::ProblematicTransaction(ref _txid) => "ProblematicTransaction",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -543,6 +551,14 @@ pub struct TransactionContractCall {
|
||||
pub function_args: Vec<Value>,
|
||||
}
|
||||
|
||||
impl TransactionContractCall {
|
||||
pub fn contract_identifier(&self) -> QualifiedContractIdentifier {
|
||||
let standard_principal =
|
||||
StandardPrincipalData(self.address.version, self.address.bytes.0.clone());
|
||||
QualifiedContractIdentifier::new(standard_principal, self.contract_name.clone())
|
||||
}
|
||||
}
|
||||
|
||||
/// A transaction that instantiates a smart contract
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct TransactionSmartContract {
|
||||
|
||||
Reference in New Issue
Block a user