test.ts (576B)
1 import { AccountRegistry } from './src/registry'; 2 3 const fs = require('fs'); 4 5 const Web3 = require('web3'); 6 7 const w3 = new Web3('http://localhost:8545'); 8 9 const d = fs.readFileSync('../solidity/registry.abi.json'); 10 const abi = JSON.parse(d); 11 12 const address = process.argv[2]; 13 14 const r = new AccountRegistry(w3, abi, address); 15 16 async function main() { 17 console.log(await r.count()); 18 19 console.log(await r.have('0xe3C4db5947409Aff0FF8D643047EA41515cA4B8e')); 20 console.log(await r.have('0x34C85E47f45b0bea09F37c83e2fb02ECBC3a395d')); 21 22 console.log(await r.last(3)); 23 } 24 25 main();