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
Fix Tests
  • Loading branch information
pgherveou committed Feb 20, 2024
commit bac4e6df7e2244b83e68c87a3b2b3b2c077d8f0d
3 changes: 2 additions & 1 deletion substrate/frame/contracts/fixtures/contracts/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ pub extern "C" fn call() {
callee_addr,
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.
None, // No deposit limit.
&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 @@ -43,7 +43,8 @@ pub extern "C" fn call() {
callee_addr,
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.
None, // No deposit limit.
&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 @@ -44,7 +44,8 @@ pub extern "C" fn call() {
callee_addr,
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.
None, // No deposit limit.
&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 @@ -106,7 +106,7 @@ pub extern "C" fn call() {
let res = api::call_v2(
uapi::CallFlags::empty(),
callee,
1u64, // too little ref_time weight
1u64, // Too little ref_time weight.
0u64, // How much proof_size weight to devote for the execution. 0 = all.
None, // No deposit limit.
&value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ pub extern "C" fn call() {
addr,
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.
None, // No deposit limit.
&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 @@ -46,7 +46,7 @@ pub extern "C" fn call() {
0u64, // How much ref_time weight to devote for the execution. 0 = all.
0u64, // How much proof_size weight to devote for the execution. 0 = all.
Some(deposit_limit),
&0u64.to_le_bytes(), // value transferred to the contract.
&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 @@ -47,7 +47,8 @@ pub extern "C" fn call() {
addr,
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.
None, // No deposit limit.
&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 @@ -42,6 +42,7 @@ pub extern "C" fn call() {
addr,
0u64, // How much ref_time to devote for the execution. 0 = all.
0u64, // How much proof_size to devote for the execution. 0 = all.
None, // No deposit limit.
&0u64.to_le_bytes(), // Value to transfer.
&[0u8; 0],
None,
Expand Down
6 changes: 3 additions & 3 deletions substrate/frame/contracts/src/wasm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3399,8 +3399,8 @@ mod tests {
}

#[test]
fn add_unlock_delegate_dependency() {
const CODE_ADD_unlock_delegate_dependency: &str = r#"
fn lock_unlock_delegate_dependency() {
const CODE_LOCK_UNLOCK_DELEGATE_DEPENDENCY: &str = r#"
(module
(import "seal0" "lock_delegate_dependency" (func $lock_delegate_dependency (param i32)))
(import "seal0" "unlock_delegate_dependency" (func $unlock_delegate_dependency (param i32)))
Expand All @@ -3426,7 +3426,7 @@ mod tests {
)
"#;
let mut mock_ext = MockExt::default();
assert_ok!(execute(&CODE_ADD_unlock_delegate_dependency, vec![], &mut mock_ext));
assert_ok!(execute(&CODE_LOCK_UNLOCK_DELEGATE_DEPENDENCY, vec![], &mut mock_ext));
let delegate_dependencies: Vec<_> =
mock_ext.delegate_dependencies.into_inner().into_iter().collect();
assert_eq!(delegate_dependencies.len(), 1);
Expand Down