Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
14 changes: 7 additions & 7 deletions smart_contracts/vm2/sdk/src/casper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,10 @@ pub fn create(
None => Err(CallError::InvalidOutput),
},
other_status => {
// #TODO! fix this wrap
Err(CallError::try_from(other_status).expect("Couldn't interpret error from host"))
let Ok(error) = CallError::try_from(other_status) else {
panic!("Couldn't interpret error from host: {}", other_status);
};
Err(error)
}
}
}
Expand Down Expand Up @@ -527,11 +529,9 @@ pub fn transferred_value() -> u64 {
}

/// Transfer tokens from the current contract to another account or contract.
pub fn transfer(target_account: &EntityAddr, amount: u64) -> Result<(), CallError> {
// TODO: the variable name is called target_account, but
// logic would call it with misc addresses. need to confer w/ michal
log!("transfer entity_addr {:?}", target_account);
let bytes = match borsh::to_vec(&(target_account, amount)) {
pub fn transfer(target: &EntityAddr, amount: u64) -> Result<(), CallError> {
log!("transfer entity_addr {:?}", target);
let bytes = match borsh::to_vec(&(target, amount)) {
Ok(bytes) => bytes,
Err(_err) => return Err(CallError::CalleeTrapped),
};
Expand Down
Loading