Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mm2src/coins/utxo/utxo_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3335,7 +3335,6 @@ where
match coin.tx_details_by_hash(&txid.0, &mut input_transactions).await {
Ok(mut tx_details) => {
mm_counter!(ctx.metrics, "tx.history.response.count", 1, "coin" => coin.as_ref().conf.ticker.clone(), "method" => "tx_detail_by_hash");

if tx_details.block_height == 0 && height > 0 {
tx_details.block_height = height;
}
Expand Down Expand Up @@ -3628,6 +3627,7 @@ pub async fn tx_details_by_hash<T: UtxoCommonOps>(
let fee = verbose_tx.vin.iter().fold(0., |cur, input| {
let fee = match input {
TransactionInputEnum::Lelantus(lelantus) => lelantus.n_fees,
TransactionInputEnum::Spark(spark) => spark.n_fees,
_ => 0.,
};
cur + fee
Expand Down
1 change: 1 addition & 0 deletions mm2src/coins/utxo/utxo_common/utxo_tx_history_v2_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ where
let fee = verbose_tx.vin.iter().fold(0., |cur, input| {
let fee = match input {
TransactionInputEnum::Lelantus(lelantus) => lelantus.n_fees,
TransactionInputEnum::Spark(spark) => spark.n_fees,
_ => 0.,
};
cur + fee
Expand Down
3 changes: 3 additions & 0 deletions mm2src/mm2_bitcoin/rpc/src/v1/types/script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub enum ScriptType {
Call,
Create,
LelantusMint,
SparkMint,
ColdStaking,
// Komodo smart chains specific
CryptoCondition,
Expand Down Expand Up @@ -64,6 +65,7 @@ impl Serialize for ScriptType {
ScriptType::Call => "call".serialize(serializer),
ScriptType::Create => "create".serialize(serializer),
ScriptType::LelantusMint => "lelantusmint".serialize(serializer),
ScriptType::SparkMint => "sparksmint".serialize(serializer),
ScriptType::ColdStaking => "cold_staking".serialize(serializer),
ScriptType::CryptoCondition => "cryptocondition".serialize(serializer),
}
Expand Down Expand Up @@ -102,6 +104,7 @@ impl<'a> Deserialize<'a> for ScriptType {
"call" => Ok(ScriptType::Call),
"create" => Ok(ScriptType::Create),
"lelantusmint" => Ok(ScriptType::LelantusMint),
"sparksmint" => Ok(ScriptType::SparkMint),
"cold_staking" => Ok(ScriptType::ColdStaking),
"cryptocondition" => Ok(ScriptType::CryptoCondition),
_ => Err(E::invalid_value(Unexpected::Str(value), &self)),
Expand Down
12 changes: 12 additions & 0 deletions mm2src/mm2_bitcoin/rpc/src/v1/types/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ pub enum TransactionInputEnum {
Sigma(SigmaInput),
/// FIRO specific
Lelantus(LelantusInput),
/// FIRO specific
Spark(SparkInput),
}

#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
Expand All @@ -99,6 +101,16 @@ pub struct LelantusInput {
sequence: u32,
}

#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
pub struct SparkInput {
#[serde(rename = "scriptSig")]
pub script_sig: TransactionInputScript,
#[serde(rename = "nFees")]
pub n_fees: f64,
lTags: Vec<String>,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
lTags: Vec<String>,
#[serde(rename = "lTags")]
l_tags: Vec<String>,

sequence: u32,
}

impl TransactionInputEnum {
pub fn is_coinbase(&self) -> bool { matches!(self, TransactionInputEnum::Coinbase(_)) }
}
Expand Down
Loading