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
fixes
  • Loading branch information
pgherveou committed Feb 19, 2024
commit 643b86c93a282612cf9cd68ca9cb5531524307e9
5 changes: 3 additions & 2 deletions substrate/frame/contracts/fixtures/contracts/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ pub extern "C" fn call() {
);

// Call the callee
api::call_v1(
api::call_v2(
uapi::CallFlags::empty(),
callee_addr,
0u64, // How much gas to devote for the execution. 0 = all.
0u64, // How much ref_time to devote for the execution. 0 = all.
0u64, // How much proof_size to devote for the execution. 0 = all.
&0u64.to_le_bytes(), // value transferred to the contract.
callee_input,
None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,11 @@ pub extern "C" fn call() {
);

// Call the callee
let err_code = match api::call_v1(
let err_code = match api::call_v2(
uapi::CallFlags::empty(),
callee_addr,
0u64, // How much gas to devote for the execution. 0 = all.
0u64, // How much ref_time to devote for the execution. 0 = all.
0u64, // How much proof_size to devote for the execution. 0 = all.
&100u64.to_le_bytes(), // value transferred to the contract.
input,
None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ pub extern "C" fn call() {
api::call_runtime(call).unwrap();

// Call the callee
api::call_v1(
api::call_v2(
uapi::CallFlags::empty(),
callee_addr,
0u64, // How much gas to devote for the execution. 0 = all.
0u64, // How much ref_time to devote for the execution. 0 = all.
0u64, // How much proof_size to devote for the execution. 0 = all.
&0u64.to_le_bytes(), // value transferred to the contract.
callee_input,
None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,11 @@ pub extern "C" fn call() {
output!(addr, [0u8; 32], api::address,);

// call self
api::call_v1(
api::call_v2(
uapi::CallFlags::ALLOW_REENTRY,
addr,
0u64, // How much gas to devote for the execution. 0 = all.
0u64, // How much ref_time to devote for the execution. 0 = all.
0u64, // How much proof_size to devote for the execution. 0 = all.
&0u64.to_le_bytes(), // value transferred to the contract.
input,
None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ pub extern "C" fn call() {
if expected_reentrance_count != 5 {
let count = (expected_reentrance_count + 1).to_le_bytes();

api::call_v1(
api::call_v2(
uapi::CallFlags::ALLOW_REENTRY,
addr,
0u64, // How much gas to devote for the execution. 0 = all.
0u64, // How much ref_time to devote for the execution. 0 = all.
0u64, // How much proof_size to devote for the execution. 0 = all.
&0u64.to_le_bytes(), // value transferred to the contract.
&count,
None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ pub extern "C" fn call() {

if !input.is_empty() {
output!(addr, [0u8; 32], api::address,);
api::call_v1(
api::call_v2(
uapi::CallFlags::ALLOW_REENTRY,
addr,
0u64, // How much gas to devote for the execution. 0 = all.
0u64, // How much ref_time to devote for the execution. 0 = all.
0u64, // How much proof_size to devote for the execution. 0 = all.
&0u64.to_le_bytes(), // Value to transfer.
&[0u8; 0],
None,
Expand Down