diff --git a/mm2src/coins/utxo/utxo_tests.rs b/mm2src/coins/utxo/utxo_tests.rs index 6e9d3a3915..0eaaf704ca 100644 --- a/mm2src/coins/utxo/utxo_tests.rs +++ b/mm2src/coins/utxo/utxo_tests.rs @@ -2435,6 +2435,18 @@ fn firo_verbose_block_deserialize() { let _block: VerboseBlock = json::from_value(json).unwrap(); } +#[test] +fn firo_lelantus_tx() { + // https://explorer.firo.org/tx/06ed4b75010edcf404a315be70903473f44050c978bc37fbcee90e0b49114ba8 + let tx_hash = "06ed4b75010edcf404a315be70903473f44050c978bc37fbcee90e0b49114ba8".into(); + let electrum = electrum_client_for_test(&[ + "electrumx01.firo.org:50001", + "electrumx02.firo.org:50001", + "electrumx03.firo.org:50001", + ]); + let _tx = electrum.get_verbose_transaction(tx_hash).wait().unwrap(); +} + #[test] fn test_generate_tx_doge_fee() { // A tx below 1kb is always 1 doge fee yes. diff --git a/mm2src/mm2_bitcoin/rpc/src/v1/types/script.rs b/mm2src/mm2_bitcoin/rpc/src/v1/types/script.rs index 66481f22bb..d01d8980f2 100644 --- a/mm2src/mm2_bitcoin/rpc/src/v1/types/script.rs +++ b/mm2src/mm2_bitcoin/rpc/src/v1/types/script.rs @@ -18,6 +18,7 @@ pub enum ScriptType { CreateSender, Call, Create, + LelantusMint, } impl From for ScriptType { @@ -57,6 +58,7 @@ impl Serialize for ScriptType { ScriptType::CreateSender => "create_sender".serialize(serializer), ScriptType::Call => "call".serialize(serializer), ScriptType::Create => "create".serialize(serializer), + ScriptType::LelantusMint => "lelantusmint".serialize(serializer), } } } @@ -92,6 +94,7 @@ impl<'a> Deserialize<'a> for ScriptType { "create_sender" => Ok(ScriptType::CreateSender), "call" => Ok(ScriptType::Call), "create" => Ok(ScriptType::Create), + "lelantusmint" => Ok(ScriptType::LelantusMint), _ => Err(E::invalid_value(Unexpected::Str(value), &self)), } } diff --git a/mm2src/mm2_bitcoin/rpc/src/v1/types/transaction.rs b/mm2src/mm2_bitcoin/rpc/src/v1/types/transaction.rs index 7b2ac28e3c..7a8525eca0 100644 --- a/mm2src/mm2_bitcoin/rpc/src/v1/types/transaction.rs +++ b/mm2src/mm2_bitcoin/rpc/src/v1/types/transaction.rs @@ -92,6 +92,8 @@ pub enum TransactionInputEnum { Coinbase(CoinbaseTransactionInput), /// FIRO specific Sigma(SigmaInput), + /// FIRO specific + Lelantus(LelantusInput), } #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] @@ -106,6 +108,16 @@ pub struct SigmaInput { sequence: u32, } +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +pub struct LelantusInput { + #[serde(rename = "scriptSig")] + pub script_sig: TransactionInputScript, + #[serde(rename = "nFees")] + n_fees: f64, + serials: Vec, + sequence: u32, +} + impl TransactionInputEnum { pub fn is_coinbase(&self) -> bool { matches!(self, TransactionInputEnum::Coinbase(_)) } }