From 8c20395264c01e25b3b34368c1d22022143c926e Mon Sep 17 00:00:00 2001 From: Boyu Yang Date: Mon, 18 Mar 2024 15:17:28 +0800 Subject: [PATCH] chore: change visibility of default change builder to be public --- src/transaction/builder/mod.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/transaction/builder/mod.rs b/src/transaction/builder/mod.rs index 9bd959df..8e942a06 100644 --- a/src/transaction/builder/mod.rs +++ b/src/transaction/builder/mod.rs @@ -29,7 +29,7 @@ pub trait CkbTransactionBuilder { } /// Change output builder trait. -trait ChangeBuilder { +pub trait ChangeBuilder { /// Initialize the change output and data, and add it to the transaction builder. fn init(&self, tx: &mut TransactionBuilder); @@ -40,14 +40,15 @@ trait ChangeBuilder { fn finalize(&self, tx: TransactionBuilder) -> TransactionView; } -struct DefaultChangeBuilder<'a> { +/// A simple implementation for the chhange output builder trait. +pub struct DefaultChangeBuilder<'a> { configuration: &'a TransactionBuilderConfiguration, change_lock: Script, inputs: Vec, } impl<'a> DefaultChangeBuilder<'a> { - fn get_change(&self) -> (CellOutput, packed::Bytes) { + pub fn get_change(&self) -> (CellOutput, packed::Bytes) { let change_output = CellOutput::new_builder() .lock(self.change_lock.clone()) .build();