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

provider_test.go upgraded to Sepolia #563

Merged
merged 5 commits into from May 8, 2024

Conversation

thiagodeev
Copy link
Contributor

Started upgrading the RPC tests to Sepolia network instead of Goerli.
This PR upgrades the provider_test.go tests to Sepolia.
Partially resolves the issue #551.

@thiagodeev thiagodeev marked this pull request as draft May 3, 2024 14:00
@thiagodeev
Copy link
Contributor Author

The fixed test is breaking with the 'devnet' param, the devnet is returning 'goerli' as the chainId. I didn't test with devnet, my bad.
I will switch the current legacy devnet container to the new recommended devnet-rs container.

@thiagodeev thiagodeev marked this pull request as ready for review May 3, 2024 14:39
@rianhughes
Copy link
Contributor

Hey, the PR looks good, you just need to fix the TestCall that is failing on devnet

@@ -107,8 +112,9 @@ func (devnet *DevNet) IsAlive() bool {
}

type MintResponse struct {
NewBalance *big.Int `json:"new_balance"`
Unit string `json:"unit"`
NewBalance string `json:"new_balance"`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The new devnet version returns a string instead a number, and a new field. The compiler was unable to convert to bigInt

@@ -44,26 +48,6 @@ func TestDevnet_Accounts(t *testing.T) {
}
}

// TestDevnet_FeeToken tests the FeeToken function of the Devnet struct.
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was this removed? I think we can add it back in without breaking tests

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed this tests because the new devnet doesn't have the "/fee_token" endpoint anymore. That being said, I believe the "Mint" and "TestCall" tests are enough to prove the token existing, address correctness, and functionalities.

@@ -38,12 +38,12 @@ func TestCall(t *testing.T) {
{
FunctionCall: FunctionCall{
// ContractAddress of predeployed devnet Feetoken
ContractAddress: utils.TestHexToFelt(t, "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"),
EntryPointSelector: utils.GetSelectorFromNameFelt("name"),
ContractAddress: utils.TestHexToFelt(t, DevNetETHAddress),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using an existing variable instead of hardcoding the address

ContractAddress: utils.TestHexToFelt(t, "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7"),
EntryPointSelector: utils.GetSelectorFromNameFelt("name"),
ContractAddress: utils.TestHexToFelt(t, DevNetETHAddress),
EntryPointSelector: utils.GetSelectorFromNameFelt("decimals"),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had some issues related to felt.Felt comparison using the "name" method. Using "decimals" was simpler to compare

@rianhughes rianhughes merged commit 177f00e into NethermindEth:main May 8, 2024
2 checks passed
@thiagodeev thiagodeev deleted the thiagodeev/fix-rpc-tests branch May 8, 2024 14:28
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.

None yet

2 participants