Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
cmd committed Feb 19, 2024
1 parent de0d50e commit cf18032
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 33 deletions.
30 changes: 0 additions & 30 deletions test/scratch.ts
Original file line number Diff line number Diff line change
@@ -1,30 +0,0 @@
import { EscrowContract } from '@scrow/core'

import { client } from '@scrow/demo/01_create_client.js'
import { sleep } from './src/util.js'

const cid = 'b1587959853f7071bf4d69b940c85bdfa30d99ccccf19c1304fb44610961fb94'

const contract = new EscrowContract(cid, client, { verbose : true })

contract.on('error', (err) => {
console.log(err)
})

contract.on('ready', async (ct) => {
console.log('contract is ready')
console.log(ct.cid)
})

contract.on('status', (ct) => {
console.log('updating status')
console.log(ct.status)
})

let tries = 10

for (let i = 0; i < tries; i++) {
const data = await contract.data
console.log(data.status)
await sleep(4500)
}
6 changes: 3 additions & 3 deletions test/src/vm/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from '@scrow/core/witness'

import {
schema,
Schema,
MachineConfig,
ProgramTerms,
SignerAPI,
Expand Down Expand Up @@ -45,7 +45,7 @@ export function resolve_aliases (
programs : (string | number)[][]
) : ProgramTerms[] {
const mbrs = aliases.map(e => get_signer(e))
const progs = schema.proposal.terms.array().parse(programs)
const progs = Schema.proposal.terms.array().parse(programs)
for (let i = 0; i < progs.length; i++) {
const terms = progs[i]
for (let j = 0; j < terms.length; j++) {
Expand All @@ -61,7 +61,7 @@ export function resolve_aliases (
}

export function parse_config (config : unknown) : MachineConfig {
return schema.vm.config.parse(config)
return Schema.vm.config.parse(config)
}

export function compile_witness (
Expand Down

0 comments on commit cf18032

Please sign in to comment.