Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update Call builder to not use default AccountId
  • Loading branch information
HCastano committed May 16, 2022
commit e3037a2f7a2569a7ae432abd710f0aae17e8d874
12 changes: 8 additions & 4 deletions crates/env/src/call/call_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ where
/// Returns the account ID of the called contract instance.
#[inline]
pub(crate) fn callee(&self) -> &E::AccountId {
&self.call_type.callee
&self
.call_type
.callee
.as_ref()
.expect("TODO, probably return Option here")
}

/// Returns the chosen gas limit for the called contract execution.
Expand Down Expand Up @@ -261,7 +265,7 @@ where
/// The default call type for cross-contract calls. Performs a cross-contract call to `callee`
/// with gas limit `gas_limit`, transferring `transferred_value` of currency.
pub struct Call<E: Environment> {
callee: E::AccountId,
callee: Option<E::AccountId>,
gas_limit: Gas,
transferred_value: E::Balance,
}
Expand Down Expand Up @@ -290,7 +294,7 @@ where
/// Sets the `callee` for the current cross-contract call.
pub fn callee(self, callee: E::AccountId) -> Self {
Call {
callee,
callee: Some(callee),
gas_limit: self.gas_limit,
transferred_value: self.transferred_value,
}
Expand Down Expand Up @@ -448,7 +452,7 @@ where
let call_type = self.call_type.value();
CallBuilder {
call_type: Set(Call {
callee,
callee: Some(callee),
gas_limit: call_type.gas_limit,
transferred_value: call_type.transferred_value,
}),
Expand Down