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 account tests to sepolia #558

Merged
merged 19 commits into from
May 21, 2024

Conversation

AryanGodara
Copy link
Member

Partially resolves #544

account/account_test.go Outdated Show resolved Hide resolved
account/account_test.go Outdated Show resolved Hide resolved
account/account_test.go Outdated Show resolved Hide resolved
account/account_test.go Outdated Show resolved Hide resolved
account/account_test.go Outdated Show resolved Hide resolved
account/account_test.go Outdated Show resolved Hide resolved
@rianhughes
Copy link
Contributor

rianhughes commented Apr 12, 2024

Just two general points:

  1. You need to replace the test data that was gathered from the Goerli network, with new test data from the Sepolia network. This will go for the other PRs as well.

  2. I would suggest running the tests in the account package against a Sepolia network endpoint, ie running "go test ./... -env testnet -v" from the accounts pacakge. You will probably need to put a .env.tesnet file in the account package, with a URL of a Seploia full node. https://data.voyager.online/

@AryanGodara
Copy link
Member Author

Just two general points:

  1. You need to replace the test data that was gathered from the Goerli network, with new test data from the Sepolia network. This will go for the other PRs as well.
  2. I would suggest running the tests in the account package against a Sepolia network endpoint, ie running "go test ./... -env testnet -v" from the accounts pacakge. You will probably need to put a .env.tesnet file in the account package, with a URL of a Seploia full node. https://data.voyager.online/

I used existing transactions which were similar to the goerli ones. So these were real transactions I found on the block-explorer. But some of them don't seem to exist anymore. (I'd picked the most recent ones that matched) For the other tests also, I've used real sepolia data.

But you're right. I need to create new transactions here, with a test wallet. I'll get to this asap!

account/account_test.go Outdated Show resolved Hide resolved
account/account_test.go Outdated Show resolved Hide resolved
@@ -795,7 +729,7 @@ func TestTransactionHashInvokeV3(t *testing.T) {
testSet := map[string][]testSetType{
"mock": {
{
// https://external.integration.starknet.io/feeder_gateway/get_transaction?transactionHash=0x49728601e0bb2f48ce506b0cbd9c0e2a9e50d95858aa41463f46386dca489fd
// https://external.integration.starknet.io/feeder_gateway/get_transaction?transactionHash=0x473e7d9dcaf02b5bbc2f89486fb2e23241f645cd55f70ff02576b79541befe7
Copy link
Contributor

Choose a reason for hiding this comment

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

and this

Copy link
Contributor

Choose a reason for hiding this comment

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

Didn't find this line in the code. Hence, considered fixed.

account/account_test.go Outdated Show resolved Hide resolved
account/account_test.go Outdated Show resolved Hide resolved
account/account_test.go Outdated Show resolved Hide resolved
account/account_test.go Outdated Show resolved Hide resolved
account/account_test.go Outdated Show resolved Hide resolved
{
CairoVersion: 0,
ChainID: "SN_GOERLI",
ChainID: "SN_SEPOLIA",
Copy link
Contributor

Choose a reason for hiding this comment

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

this testdata is from goerli, we can just remove this

require.NoError(t, err)

var casmClass contracts.CasmClass
err = json.Unmarshal(content2, &casmClass)
require.NoError(t, err)
compClassHash := hash.CompiledClassHash(casmClass)

nonce, err := acnt.Nonce(context.Background(), rpc.BlockID{Tag: "latest"}, acnt.AccountAddress)
require.NoError(t, err)
// nonce, err := acnt.Nonce(context.Background(), rpc.BlockID{Tag: "latest"}, acnt.AccountAddress)
Copy link
Contributor

Choose a reason for hiding this comment

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

we can remove this if it's not being used

@rianhughes rianhughes merged commit 3e3f332 into NethermindEth:main May 21, 2024
2 checks passed
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