Skip to content

Commit

Permalink
Use instantiate instead of try_instantiate in delegator
Browse files Browse the repository at this point in the history
  • Loading branch information
ascjones committed Jan 20, 2023
1 parent 155d416 commit 22a924d
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions examples/delegator/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,29 +63,17 @@ mod delegator {
.endowment(total_balance / 4)
.code_hash(accumulator_code_hash)
.salt_bytes(salt)
.try_instantiate()
.unwrap_or_else(|error| {
panic!(
"failed at instantiating the Accumulator contract: {:?}",
error
)
});
.instantiate();
let adder = AdderRef::new(accumulator.clone())
.endowment(total_balance / 4)
.code_hash(adder_code_hash)
.salt_bytes(salt)
.try_instantiate()
.unwrap_or_else(|error| {
panic!("failed at instantiating the Adder contract: {:?}", error)
});
.instantiate();
let subber = SubberRef::new(accumulator.clone())
.endowment(total_balance / 4)
.code_hash(subber_code_hash)
.salt_bytes(salt)
.try_instantiate()
.unwrap_or_else(|error| {
panic!("failed at instantiating the Subber contract: {:?}", error)
});
.instantiate();
Self {
which: Which::Adder,
accumulator,
Expand Down

0 comments on commit 22a924d

Please sign in to comment.