Skip to content

Instantly share code, notes, and snippets.

View qianbin's full-sized avatar

Qian Bin qianbin

View GitHub Profile
const ticker = connex.thor.ticker()
let receipt = null
do {
await ticker.next()
// need to catch exception
receipt = await transaction.getReceipt()
} while(!receipt)
@qianbin
qianbin / demo.ts
Last active March 6, 2019 06:27
deployment data for contract with constructor arguments
import { abi } from 'thor-devkit'
// assume we have a demo contract
// contract DemoContract {
// constructor(int arg) public {
// }
// }
const byteCode = '0x....'
const constructorABI = {
@qianbin
qianbin / demo.ts
Created March 6, 2019 06:13
deployment data for contract with constructor arguments
import { abi } from 'thor-devkit'
// assume we have a demo contract
// contract DemoContract {
// constructor(int arg) public {
// }
// }
const byteCode = '0x....'
const constructorABI = {
import Deferred from '@/base/deferred'
class PromiseTracker {
private readonly deferred = new Deferred()
constructor() {
this.deferred.catch()
}
public track<T extends object>(obj: T): T {
return this._track(obj)