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

Update rpc: Call, Contract, Event and mock tests #555

Merged
merged 17 commits into from
May 29, 2024

Conversation

AryanGodara
Copy link
Member

Partially resolves #544

rpc/contract_test.go Outdated Show resolved Hide resolved
BlockID: WithBlockTag("pending"),
ClassHash: utils.TestHexToFelt(t, "0x493af3546940eb96471cf95ae3a5aa1286217b07edd1e12d00143010ca904b1"),
BlockID: WithBlockNumber(15329),
ClassHash: utils.TestHexToFelt(t, "0x079b7ec8fdf40a4ff6ed47123049dfe36b5c02db93aa77832682344775ef70c6"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we update this test? Currently it seems to imply that we expect v0 Contracts, but the class you are returning in this test is actually a v2. They have different field types (see DeprecatedContractClass and ContractClass), so it would be great if we could handle both of these cases, and assert equality on some of the fields (eg the first few felts in SierraProgram if it's a ContractClass type)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added testcases with v2 contract and classes for this function, TestClassHash and TestClassAt, and the return type seems to be working properly (currently checking if contract_class_version field is present to check the type of the returned result (depcreatedContractClass or contractClass)

ssert equality on some of the fields (eg the first few felts in SierraProgram if it's a ContractClass type) Just need to add this check now.

And also TestClassAt is pending in implementation

@thiagodeev
Copy link
Contributor

Call and Contract tests passing on mock, sepolia, devnet, and mainnet.

rpc/call_test.go Outdated Show resolved Hide resolved
rpc/contract_test.go Outdated Show resolved Hide resolved
rpc/contract_test.go Outdated Show resolved Hide resolved
rpc/contract_test.go Outdated Show resolved Hide resolved
rpc/contract_test.go Outdated Show resolved Hide resolved
@rianhughes rianhughes merged commit f7b4bfd into NethermindEth:main May 29, 2024
2 checks passed
@thiagodeev thiagodeev deleted the call-update branch May 29, 2024 14:40
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.

goerli depreceation
3 participants