File tree Expand file tree Collapse file tree 2 files changed +15
-25
lines changed
Expand file tree Collapse file tree 2 files changed +15
-25
lines changed Original file line number Diff line number Diff line change 22
33import { env } from '../tools/lib/index.ts'
44import { abis } from '../codegen/abis.ts'
5- import { Caller } from '../codegen/addresses.ts'
6- import { encodeFunctionData } from 'viem'
5+ import { Storage } from '../codegen/addresses.ts'
76
87{
9- const result = await env . wallet . readContract ( {
10- address : Caller ,
11- abi : abis . Caller ,
12- functionName : 'staticCall ' ,
13- args : [ ] ,
8+ const { request } = await env . wallet . simulateContract ( {
9+ address : Storage ,
10+ abi : abis . Storage ,
11+ functionName : 'store ' ,
12+ args : [ 42n ] ,
1413 } )
15- console . log ( { result } )
14+
15+ const result = await env . wallet . writeContract ( request )
16+ console . log ( 'store tx' , result )
1617}
1718
1819{
19- const result = await env . debugClient . traceCall (
20+ const result = await env . wallet . readContract (
2021 {
21- to : Caller ,
22- data : encodeFunctionData ( {
23- abi : abis . Caller ,
24- functionName : 'staticCall' ,
25- args : [ ] ,
26- } ) ,
22+ address : Storage ,
23+ abi : abis . Storage ,
24+ functionName : 'retrieve' ,
2725 } ,
28- 'callTracer' ,
2926 )
30-
31- console . log ( result )
27+ console . log ( 'retrieve:' , result )
3228}
Original file line number Diff line number Diff line change @@ -23,13 +23,7 @@ import { deploy } from './lib/index.ts'
2323// })
2424
2525await deploy ( {
26- name : 'Caller' ,
27- args : [ ] ,
28- // bytecodeType: 'polkavm', // Specify `pvm` for PVM bytecode deployment
29- } )
30-
31- await deploy ( {
32- name : 'HostEvmOnly' ,
26+ name : 'Storage' ,
3327 args : [ ] ,
3428 // bytecodeType: 'polkavm', // Specify `pvm` for PVM bytecode deployment
3529} )
You can’t perform that action at this time.
0 commit comments