Skip to content

Commit

Permalink
iface: add ContractBuilder::with method
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Nov 14, 2023
1 parent c224669 commit 3955dcb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/interface/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,19 @@ pub struct ContractBuilder {
}

impl ContractBuilder {
pub fn with(
iface: Iface,
schema: SubSchema,
iimpl: IfaceImpl,
testnet: bool,
) -> Result<Self, BuilderError> {
Ok(Self {
builder: OperationBuilder::with(iface, schema, iimpl)?,
testnet,
alt_layers1: none!(),
})
}

pub fn mainnet(
iface: Iface,
schema: SubSchema,
Expand All @@ -107,6 +120,7 @@ impl ContractBuilder {
alt_layers1: none!(),
})
}

pub fn testnet(
iface: Iface,
schema: SubSchema,
Expand Down
1 change: 1 addition & 0 deletions src/interface/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ impl From<RevealedAttach> for AttachedState {
}
}

// TODO: Consider removing type in favour of `FungibleOutput`
#[derive(Copy, Clone, Eq, PartialEq, Debug)]
pub struct FungibleAllocation {
pub owner: Output,
Expand Down

0 comments on commit 3955dcb

Please sign in to comment.