Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

setConfig doesnt working as expected #6557

@Zahar44

Description

@Zahar44

I checked code of web3-eth-contract/lib/commonjs/contract.js and from what I see it looks like this.config.contractDataInputFill used only to set it to this._dataInputFill and when called setConfig with contractDataInputFill it doesnt override this._dataInputFill.

Expected behavior

this code should override transaction input/data behavior

const token = new this.web3.eth.Contract(ERC20Abi);
token.setConfig({ contractDataInputFill: 'both' });

Actual behavior

Transaction sent with behavior of initial contractDataInputFill value

Steps to reproduce the behavior

this should throw exception if used in local hardhat node

const token = new this.web3.eth.Contract(ERC20Abi);
token.setConfig({ contractDataInputFill: 'both' });
token.methods.decimals().call();

Logs

this will log 'input'

const token = new this.web3.eth.Contract(ERC20Abi);
token.setConfig({ contractDataInputFill: 'both' });
console.log(token['_dataInputFill']);

Environment

"web3": "^4.2.1"

Metadata

Metadata

Assignees

No one assigned

    Labels

    4.x4.0 relatedBugAddressing a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions