-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Nikos/5603/some default properties cannot set from contract class #5756
Nikos/5603/some default properties cannot set from contract class #5756
Conversation
Deploying with
|
Latest commit: |
6c75f77
|
Status: | ✅ Deploy successful! |
Preview URL: | https://db5c845c.web3-js-docs.pages.dev |
Branch Preview URL: | https://nikos-5603-some-default-prop.web3-js-docs.pages.dev |
…-from-Contract-class
@nikoulai const web3Context = new Web3Context('http://127.0.0.1:8545');
web3Context.defaultBlock = 'pending';
const contract = new Contract([], { syncWithContext: true }, web3Context);
console.log(contract.defaultBlock); // latest
web3Context.defaultBlock = 'earliest';
console.log(contract.defaultBlock); // earliest (the The above code works as expected, but only if the following if (contractContext !== undefined) {
this.suscribeToGlobalEvents(contractContext);
} occurs after the new line: this.syncWithContext = (options as ContractInitOptions)?.syncWithContext ?? false; |
…-from-Contract-class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
G2g after above comment is addressed
…ract-class' of https://github.com/web3/web3.js into nikos/5603/some-default-properties-cannot-set-from-Contract-class
Description
closes #5603
Checklist for 4.x:
yarn
successfullyyarn lint
successfullyyarn build:web
successfullyyarn test:unit
successfullyyarn test:integration
successfullycompile:contracts
successfullyCHANGELOG.md
file in the packages I have edited.