Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

callback in web3 #2809

Closed
ghost opened this issue May 10, 2019 · 2 comments
Closed

callback in web3 #2809

ghost opened this issue May 10, 2019 · 2 comments

Comments

@ghost
Copy link

ghost commented May 10, 2019

Description

callback in for call() myMethod function call doesn't work when for a truffle contract in the test-bed.
What the issue is, in broad strokes.

Expected behavior

A set function using the newTransact() function which is fine in working condition
2 a call function using getTransactionCount() to show the result using the callback.

Actual behavior

1 sucessfully executed.
2. no response the callback it does not execute.

Steps to reproduce the behavior

var Web3 = require('web3')
var assert = require('assert');

const web3 = new Web3('http://127.0.0.1:8545')

json = require('./../../../build/contracts/permission.json');

const interface = json['abi'];
const bytecode = json['bytecode'];

var accounts;
var contract =  new web3.eth.Contract(interface,'0xBcf2D22144C11C20B31A7Aa84875414B252a92DB');

web3.eth.getAccounts().then(async function(res){

    var admin = res[9];
    var receiver = res[1];
    var sender = res[3];
    accounts = res;
    
    contract.deploy({
        data:bytecode
    }).send({
        from : admin,
        gas: 4712388,
        gasPrice: 100000000000
    }, (error,transactionHash) => {
      console.log(error,transactionHash)
                        
    }).on('receipt',(receipt) =>{
        
    }).then((instance)=>{

    })
    const receipt = await contract.methods.newTransact(receiver,'dob').send({from:sender},(error,transactionHash)=>{console.log(error,transactionHash)});
    const rec = contract.getTransactionCount.call().then((resu)=>{
        console.log(resu);

    });

    });
    ```

#### Error Logs 


#### Gists
<!---------------------------------------------------------------------
    Including links to gists with:
    * ABI JSON,
    * working Solidity code, etc.

    gist tutorial: https://help.github.com/en/articles/creating-gists
----------------------------------------------------------------------->


### Versions 
* web3.js:
* nodejs:
* browser:
* ethereum node:


<!---------------------------------------------------------------------
                    Thanks for your cooperation!
----------------------------------------------------------------------->
@nivida
Copy link
Contributor

nivida commented May 10, 2019

I've closed this issue because we have a discussion with the truffle team here.

@nivida nivida closed this as completed May 10, 2019
@c3rf1g
Copy link

c3rf1g commented Jan 9, 2022

РУССКИЕ ВПЕРЕД

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants