1

I have create this test:

const { expectEvent } = require('@openzeppelin/test-helpers');

const MyContract = artifacts.require('MyContract');

contract('MyContract', function (accounts) {
    const [owner] = accounts;

    beforeEach(async function () {
        this.myContract = await MyContract.new({from: owner});
    });

    describe('construction', function () {
        let txHash = this.myContract.transactionHash

    });
});

txHash contains the hash of the deployment transaction. How can i access to all transaction fields (especially "from" field)

Thanks

1 Answer 1

0

Once you have the transaction hash, you can do this:

You can specify the network you want to debug on with the --network option:

$ truffle debug [<transaction hash>] --network <network>

Reference from: debugging-your-contracts

1
  • Thanks a lot but i want to do that in javascript...
    – Bob5421
    Apr 5, 2021 at 11:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.