Skip to content

Commit c7feb4b

Browse files
OBorceazarovh
authored andcommitted
fix additional tx data for CreateOrder in API Server
1 parent 7e3abd8 commit c7feb4b

File tree

1 file changed

+36
-0
lines changed
  • api-server/scanner-lib/src/blockchain_state

1 file changed

+36
-0
lines changed

api-server/scanner-lib/src/blockchain_state/mod.rs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,42 @@ async fn calculate_tx_fee_and_collect_token_info<T: ApiServerStorageWrite>(
649649
},
650650
};
651651
}
652+
for out in tx.outputs().iter() {
653+
match out {
654+
TxOutput::Transfer(v, _)
655+
| TxOutput::Burn(v)
656+
| TxOutput::LockThenTransfer(v, _, _)
657+
| TxOutput::Htlc(v, _) => match v {
658+
OutputValue::TokenV1(token_id, _) => {
659+
token_ids.insert(*token_id);
660+
}
661+
OutputValue::Coin(_) | OutputValue::TokenV0(_) => {}
662+
},
663+
TxOutput::IssueNft(token_id, _, _) => {
664+
token_ids.insert(*token_id);
665+
}
666+
TxOutput::CreateOrder(data) => {
667+
match data.ask() {
668+
OutputValue::TokenV1(token_id, _) => {
669+
token_ids.insert(*token_id);
670+
}
671+
OutputValue::Coin(_) | OutputValue::TokenV0(_) => {}
672+
};
673+
match data.give() {
674+
OutputValue::TokenV1(token_id, _) => {
675+
token_ids.insert(*token_id);
676+
}
677+
OutputValue::Coin(_) | OutputValue::TokenV0(_) => {}
678+
};
679+
}
680+
TxOutput::CreateStakePool(_, _)
681+
| TxOutput::DataDeposit(_)
682+
| TxOutput::DelegateStaking(_, _)
683+
| TxOutput::CreateDelegationId(_, _)
684+
| TxOutput::IssueFungibleToken(_)
685+
| TxOutput::ProduceBlockFromStake(_, _) => {}
686+
};
687+
}
652688
token_ids
653689
};
654690

0 commit comments

Comments
 (0)