Skip to content

Commit 8d5433c

Browse files
committed
Remove compose and decompose transaction
1 parent 96f7f94 commit 8d5433c

File tree

13 files changed

+28
-1301
lines changed

13 files changed

+28
-1301
lines changed

core/src/codechain_machine.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,6 @@ impl CodeChainMachine {
203203
Action::IncreaseAssetSupply {
204204
..
205205
} => params.min_asset_supply_increase_cost(),
206-
Action::ComposeAsset {
207-
..
208-
} => params.min_asset_compose_cost(),
209-
Action::DecomposeAsset {
210-
..
211-
} => params.min_asset_decompose_cost(),
212206
Action::UnwrapCCC {
213207
..
214208
} => params.min_asset_unwrap_ccc_cost(),

rpc/src/v1/impls/chain.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,6 @@ where
288288
"store" => Some(common_parameters.min_store_transaction_cost()),
289289
"remove" => Some(common_parameters.min_remove_transaction_cost()),
290290
"custom" => Some(common_parameters.min_custom_transaction_cost()),
291-
"composeAsset" => Some(common_parameters.min_asset_compose_cost()),
292-
"decomposeAsset" => Some(common_parameters.min_asset_decompose_cost()),
293291

294292
_ => None,
295293
})

rpc/src/v1/types/action.rs

Lines changed: 0 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -78,27 +78,6 @@ pub enum Action {
7878
approvals: Vec<Signature>,
7979
},
8080
#[serde(rename_all = "camelCase")]
81-
ComposeAsset {
82-
network_id: NetworkId,
83-
shard_id: ShardId,
84-
metadata: String,
85-
approver: Option<PlatformAddress>,
86-
registrar: Option<PlatformAddress>,
87-
allowed_script_hashes: Vec<H160>,
88-
inputs: Vec<AssetTransferInput>,
89-
output: Box<AssetMintOutput>,
90-
91-
approvals: Vec<Signature>,
92-
},
93-
#[serde(rename_all = "camelCase")]
94-
DecomposeAsset {
95-
network_id: NetworkId,
96-
input: Box<AssetTransferInput>,
97-
outputs: Vec<AssetTransferOutput>,
98-
99-
approvals: Vec<Signature>,
100-
},
101-
#[serde(rename_all = "camelCase")]
10281
UnwrapCCC {
10382
network_id: NetworkId,
10483
burn: AssetTransferInput,
@@ -207,31 +186,7 @@ pub enum ActionWithTracker {
207186

208187
tracker: H256,
209188
},
210-
#[serde(rename_all = "camelCase")]
211-
ComposeAsset {
212-
network_id: NetworkId,
213-
shard_id: ShardId,
214-
metadata: String,
215-
approver: Option<PlatformAddress>,
216-
registrar: Option<PlatformAddress>,
217-
allowed_script_hashes: Vec<H160>,
218-
inputs: Vec<AssetTransferInput>,
219-
output: Box<AssetMintOutput>,
220189

221-
approvals: Vec<Signature>,
222-
223-
tracker: H256,
224-
},
225-
#[serde(rename_all = "camelCase")]
226-
DecomposeAsset {
227-
network_id: NetworkId,
228-
input: Box<AssetTransferInput>,
229-
outputs: Vec<AssetTransferOutput>,
230-
231-
approvals: Vec<Signature>,
232-
233-
tracker: H256,
234-
},
235190
#[serde(rename_all = "camelCase")]
236191
UnwrapCCC {
237192
network_id: NetworkId,
@@ -367,40 +322,6 @@ impl ActionWithTracker {
367322
approvals,
368323
tracker: tracker.unwrap(),
369324
},
370-
ActionType::ComposeAsset {
371-
network_id,
372-
shard_id,
373-
metadata,
374-
approver,
375-
registrar,
376-
allowed_script_hashes,
377-
inputs,
378-
output,
379-
approvals,
380-
} => ActionWithTracker::ComposeAsset {
381-
network_id,
382-
shard_id,
383-
metadata,
384-
approver: approver.map(|approver| PlatformAddress::new_v1(network_id, approver)),
385-
registrar: registrar.map(|registrar| PlatformAddress::new_v1(network_id, registrar)),
386-
allowed_script_hashes,
387-
inputs: inputs.into_iter().map(From::from).collect(),
388-
output: Box::new((*output).into()),
389-
approvals,
390-
tracker: tracker.unwrap(),
391-
},
392-
ActionType::DecomposeAsset {
393-
network_id,
394-
input,
395-
outputs,
396-
approvals,
397-
} => ActionWithTracker::DecomposeAsset {
398-
network_id,
399-
input: Box::new(input.into()),
400-
outputs: outputs.into_iter().map(From::from).collect(),
401-
approvals,
402-
tracker: tracker.unwrap(),
403-
},
404325
ActionType::UnwrapCCC {
405326
network_id,
406327
burn,
@@ -597,54 +518,6 @@ impl TryFrom<Action> for ActionType {
597518
approvals,
598519
}
599520
}
600-
Action::ComposeAsset {
601-
network_id,
602-
shard_id,
603-
metadata,
604-
approver,
605-
registrar,
606-
allowed_script_hashes,
607-
inputs,
608-
output,
609-
610-
approvals,
611-
} => {
612-
let approver = match approver {
613-
Some(approver) => Some(approver.try_into_address()?),
614-
None => None,
615-
};
616-
let registrar = match registrar {
617-
Some(registrar) => Some(registrar.try_into_address()?),
618-
None => None,
619-
};
620-
let output_content = AssetMintOutputType::try_from(*output)?;
621-
ActionType::ComposeAsset {
622-
network_id,
623-
shard_id,
624-
metadata,
625-
approver,
626-
registrar,
627-
allowed_script_hashes,
628-
inputs: inputs.into_iter().map(From::from).collect(),
629-
output: Box::new(output_content),
630-
approvals,
631-
}
632-
}
633-
Action::DecomposeAsset {
634-
network_id,
635-
input,
636-
outputs,
637-
638-
approvals,
639-
} => {
640-
let outputs = outputs.into_iter().map(TryFrom::try_from).collect::<Result<_, _>>()?;
641-
ActionType::DecomposeAsset {
642-
network_id,
643-
input: (*input).into(),
644-
outputs,
645-
approvals,
646-
}
647-
}
648521
Action::UnwrapCCC {
649522
network_id,
650523
burn,

0 commit comments

Comments
 (0)