From 789d1be0259bd795222137da05359826112927cf Mon Sep 17 00:00:00 2001 From: Aleksey Filippov Date: Mon, 18 Sep 2023 00:40:04 +0300 Subject: [PATCH] added script and mint handling --- packages/fuel-indexer/src/executor.rs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/fuel-indexer/src/executor.rs b/packages/fuel-indexer/src/executor.rs index ee97c84a1..02df80f4b 100644 --- a/packages/fuel-indexer/src/executor.rs +++ b/packages/fuel-indexer/src/executor.rs @@ -422,7 +422,23 @@ pub async fn retrieve_blocks_from_node( salt: <[u8; 32]>::from(*tx.salt()).into(), metadata: None, }), - _ => Transaction::default(), + ClientTransaction::Script(tx) => Transaction::Script(Script { + gas_price: *tx.gas_price(), + gas_limit: *tx.gas_limit(), + maturity: *tx.maturity(), + script: (*tx.script().clone()).to_vec(), + script_data: (*tx.script_data().clone()).to_vec(), + inputs: tx.inputs().iter().map(|i| i.to_owned().into()).collect(), + outputs: tx.outputs().iter().map(|o| o.to_owned().into()).collect(), + witnesses: tx.witnesses().to_vec(), + receipts_root: <[u8; 32]>::from(*tx.receipts_root()).into(), + metadata: None, + }), + ClientTransaction::Mint(tx) => Transaction::Mint(Mint { + tx_pointer: tx.tx_pointer().to_owned().into(), + outputs: tx.outputs().iter().map(|o| o.to_owned().into()).collect(), + metadata: None, + }), }; let tx_data = TransactionData {