Skip to content

Commit

Permalink
chore: change visibility of default change builder to be public
Browse files Browse the repository at this point in the history
  • Loading branch information
yangby-cryptape committed Mar 18, 2024
1 parent 49f8a97 commit 8c20395
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/transaction/builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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<TransactionInput>,
}

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();
Expand Down

0 comments on commit 8c20395

Please sign in to comment.