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

fixing blocknumber issue #100

Merged
merged 5 commits into from
Aug 8, 2024
Merged

Conversation

HadiEsna
Copy link
Contributor

#99

@HadiEsna
Copy link
Contributor Author

Hi @joshstevens19
Can you review this PR?

@joshstevens19
Copy link
Owner

Thanks for the PR - have you tested this out? can you add a description in this also

@HadiEsna
Copy link
Contributor Author

yes I've tested it on all evm chains (We are getting historical data for multiple protocols and I've used it for that)

@HadiEsna
Copy link
Contributor Author

Issue:
The blocknumber in the call wasn't changing the block number that the request was executing. After some digging, I noticed that the implementation of calling the multicall contract on an specific block is not correct.

 const callParams = [];
 callParams.push(options.blockNumber);
 const contractResponse = (await contract.methods
        .aggregate(this.mapCallContextToMatchContractFormat(calls))
        .call(...callParams)) as AggregateContractResponse;

After I changed it to this, it worked normally

const contractResponse = (await contract.methods
        .aggregate(this.mapCallContextToMatchContractFormat(calls))
        .call(...callParams)) as AggregateContractResponse;
        .call({}, blockNumber)) as AggregateContractResponse;

@HadiEsna
Copy link
Contributor Author

HadiEsna commented Aug 2, 2024

@joshstevens19 Can you check this PR please?
Is there anything else that I need to add?

@joshstevens19 joshstevens19 merged commit 94c7898 into joshstevens19:master Aug 8, 2024
@joshstevens19
Copy link
Owner

joshstevens19 commented Aug 8, 2024

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

Successfully merging this pull request may close these issues.

2 participants