Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

Commit

Permalink
fix split change (#240)
Browse files Browse the repository at this point in the history
  • Loading branch information
rev-chaos authored Sep 21, 2021
1 parent 7c806a9 commit d81dafe
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions core/rpc/src/rpc_impl/build_tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1471,17 +1471,19 @@ impl<C: CkbRpc> MercuryRpcImpl<C> {
let secp_address = self.get_secp_address_by_item(item)?;

if let Some(udt_info) = udt_change_info {
let type_script = self
.build_sudt_type_script(blake2b_256_to_160(&udt_info.asset_info.udt_hash))
.await?;
self.build_cell_for_output(
STANDARD_SUDT_CAPACITY,
secp_address.payload().into(),
Some(type_script),
Some(udt_info.amount),
outputs,
cells_data,
)?;
if udt_info.amount != 0 {
let type_script = self
.build_sudt_type_script(blake2b_256_to_160(&udt_info.asset_info.udt_hash))
.await?;
self.build_cell_for_output(
STANDARD_SUDT_CAPACITY,
secp_address.payload().into(),
Some(type_script),
Some(udt_info.amount),
outputs,
cells_data,
)?;
}
}

let change_cell_capacity = pool_capacity - required_ckb + MIN_CKB_CAPACITY;
Expand Down

0 comments on commit d81dafe

Please sign in to comment.