Skip to content
Merged
Show file tree
Hide file tree
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
docs and nitty gritties
  • Loading branch information
agryaznov committed Sep 6, 2022
commit cd9ca7f34e243308ab5f2646e8cd8fea9433a41f
2 changes: 2 additions & 0 deletions crates/env/src/engine/off_chain/test_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ where
}

/// Sets the value transferred from the caller to the callee as part of the call.
/// Please note that the actioning accounts should be set with [`set_caller()`] and [`set_callee()`] beforehand.
pub fn set_value_transferred<T>(value: T::Balance)
where
T: Environment<Balance = u128>, // Just temporary for the MVP!
Expand All @@ -210,6 +211,7 @@ where
}

/// Transfers value from the caller account to the contract.
/// Please note that the actioning accounts should be set with [`set_caller()`] and [`set_callee()`] beforehand.
pub fn transfer_in<T>(value: T::Balance)
where
T: Environment<Balance = u128>, // Just temporary for the MVP!
Expand Down
2 changes: 1 addition & 1 deletion examples/contract-transfer/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ pub mod give_me {
mod tests {
use super::*;
use ink_lang as ink;
use ink_lang::codegen::Env;

#[ink::test]
fn transfer_works() {
Expand Down Expand Up @@ -102,6 +101,7 @@ pub mod give_me {

#[ink::test]
fn test_transferred_value() {
use ink_lang::codegen::Env;
// given
let accounts = default_accounts();
let give_me = create_contract(100);
Expand Down