fix: subscription error on call

This commit is contained in:
Richard Ramos 2019-08-28 15:26:06 -04:00
parent 011637f3cb
commit c9db388565
2 changed files with 1 additions and 3 deletions

View File

@ -85,12 +85,11 @@ class EventSyncer {
// TODO: use call args from user // TODO: use call args from user
let method = contractInstance.methods[propName].apply(contractInstance.methods[propName], []) let method = contractInstance.methods[propName].apply(contractInstance.methods[propName], [])
method.call.apply(method.call, [{}, (err, result) => { method.call.apply(method.call, [{}, (err, result) => {
sub.next(result) sub.next(result)
}]) }])
this.web3.eth.subscribe('newBlockHeaders', (error, result) => { this.web3.subscribe('newBlockHeaders', (error, result) => {
method.call.apply(method.call, [({}), (err, result) => { method.call.apply(method.call, [({}), (err, result) => {
sub.next(result) sub.next(result)
}]) }])

View File

@ -128,7 +128,6 @@ async function deployContract() {
async function run() { async function run() {
let accounts = await eth.getAccounts(); let accounts = await eth.getAccounts();
var SimpleStorageContract = await deployContract() var SimpleStorageContract = await deployContract()
console.dir(SimpleStorageContract)
console.dir(SimpleStorageContract.options.address) console.dir(SimpleStorageContract.options.address)
// var subscription = web3.eth.subscribe('logs', { // var subscription = web3.eth.subscribe('logs', {