@@ -28,7 +28,7 @@ pub extern "C" fn deploy() {}
2828#[ no_mangle]
2929#[ polkavm_derive:: polkavm_export]
3030pub extern "C" fn call ( ) {
31- input ! ( code_hash: [ u8 ; 32 ] , ) ;
31+ input ! ( code_hash: & [ u8 ; 32 ] , ) ;
3232
3333 // The value to transfer on instantiation and calls. Chosen to be greater than existential
3434 // deposit.
@@ -73,7 +73,6 @@ pub extern "C" fn call() {
7373
7474 // Deploy the contract successfully.
7575 let mut callee = [ 0u8 ; 20 ] ;
76- let callee = & mut & mut callee[ ..] ;
7776
7877 api:: instantiate (
7978 code_hash,
@@ -82,17 +81,16 @@ pub extern "C" fn call() {
8281 None , // No deposit limit.
8382 & value,
8483 & input,
85- Some ( callee) ,
84+ Some ( & mut callee) ,
8685 None ,
8786 & salt,
8887 )
8988 . unwrap ( ) ;
90- assert_eq ! ( callee. len( ) , 20 ) ;
9189
9290 // Call the new contract and expect it to return failing exit code.
9391 let res = api:: call (
9492 uapi:: CallFlags :: empty ( ) ,
95- callee,
93+ & callee,
9694 0u64 , // How much ref_time weight to devote for the execution. 0 = all.
9795 0u64 , // How much proof_size weight to devote for the execution. 0 = all.
9896 None , // No deposit limit.
@@ -105,7 +103,7 @@ pub extern "C" fn call() {
105103 // Fail to call the contract due to insufficient ref_time weight.
106104 let res = api:: call (
107105 uapi:: CallFlags :: empty ( ) ,
108- callee,
106+ & callee,
109107 1u64 , // Too little ref_time weight.
110108 0u64 , // How much proof_size weight to devote for the execution. 0 = all.
111109 None , // No deposit limit.
@@ -118,7 +116,7 @@ pub extern "C" fn call() {
118116 // Fail to call the contract due to insufficient proof_size weight.
119117 let res = api:: call (
120118 uapi:: CallFlags :: empty ( ) ,
121- callee,
119+ & callee,
122120 0u64 , // How much ref_time weight to devote for the execution. 0 = all.
123121 1u64 , // too little proof_size weight
124122 None , // No deposit limit.
@@ -132,7 +130,7 @@ pub extern "C" fn call() {
132130 let mut output = [ 0u8 ; 4 ] ;
133131 api:: call (
134132 uapi:: CallFlags :: empty ( ) ,
135- callee,
133+ & callee,
136134 0u64 , // How much ref_time weight to devote for the execution. 0 = all.
137135 0u64 , // How much proof_size weight to devote for the execution. 0 = all.
138136 None , // No deposit limit.
0 commit comments