-
Notifications
You must be signed in to change notification settings - Fork 88
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
Conversation
rpc/contract_test.go
Outdated
BlockID: WithBlockTag("pending"), | ||
ClassHash: utils.TestHexToFelt(t, "0x493af3546940eb96471cf95ae3a5aa1286217b07edd1e12d00143010ca904b1"), | ||
BlockID: WithBlockNumber(15329), | ||
ClassHash: utils.TestHexToFelt(t, "0x079b7ec8fdf40a4ff6ed47123049dfe36b5c02db93aa77832682344775ef70c6"), |
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.
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)
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.
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
Call and Contract tests passing on mock, sepolia, devnet, and mainnet. |
Partially resolves #544