Skip to content

Commit f17bbf2

Browse files
authored
cleanup (#15)
* Update build commands and clean node-env script * fix node-envv * clean up * update doc * fixes * rm tests files * rm * fix example
1 parent 67af94a commit f17bbf2

File tree

2 files changed

+15
-25
lines changed

2 files changed

+15
-25
lines changed

cli/playground.ts

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,27 @@
22

33
import { env } from '../tools/lib/index.ts'
44
import { 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
}

tools/deploy.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,7 @@ import { deploy } from './lib/index.ts'
2323
// })
2424

2525
await 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
})

0 commit comments

Comments
 (0)