Skip to content

Commit 68f4692

Browse files
committed
Change tracker function considering WrapCCC
1 parent fd0294f commit 68f4692

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

types/src/transaction/transaction.rs

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use primitives::H256;
2020
use rlp::RlpStream;
2121

2222
use super::Action;
23-
use super::ShardTransaction;
23+
use super::{AssetWrapCCCOutput, ShardTransaction};
2424

2525
#[derive(Debug, Clone, PartialEq, Eq)]
2626
pub struct Transaction {
@@ -52,8 +52,26 @@ impl Transaction {
5252
}
5353

5454
pub fn tracker(&self) -> Option<H256> {
55-
let t: Option<ShardTransaction> = self.action.clone().into();
56-
t.map(|t| t.tracker())
55+
let shard_tx = match self.action.clone() {
56+
Action::WrapCCC {
57+
shard_id,
58+
lock_script_hash,
59+
parameters,
60+
quantity,
61+
..
62+
} => Some(ShardTransaction::WrapCCC {
63+
network_id: self.network_id,
64+
shard_id,
65+
tx_hash: self.hash(),
66+
output: AssetWrapCCCOutput {
67+
lock_script_hash,
68+
parameters,
69+
quantity,
70+
},
71+
}),
72+
other_actions => other_actions.into(),
73+
};
74+
shard_tx.map(|t| t.tracker())
5775
}
5876
pub fn is_master_key_allowed(&self) -> bool {
5977
match self.action {

0 commit comments

Comments
 (0)