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

Investigate broken web3 SDK unit tests #385

Open
bgins opened this issue Sep 24, 2024 · 4 comments
Open

Investigate broken web3 SDK unit tests #385

bgins opened this issue Sep 24, 2024 · 4 comments

Comments

@bgins
Copy link
Contributor

bgins commented Sep 24, 2024

Our web3 SDK unit tests currently fail with an invalid length, need 256 bits error:

$ go test ./pkg/web3/sdk_test.go
--- FAIL: TestGetBalance (0.35s)
    sdk_test.go:63: Failed to create Web3SDK: invalid length, need 256 bits
--- FAIL: TestGetBlockNumber (0.42s)
    sdk_test.go:76: Failed to create Web3SDK: invalid length, need 256 bits
FAIL
FAIL	command-line-arguments	1.154s
FAIL

Let's investigate why these tests are failing. We may need to update the tests or fixtures, but this could indicate a bug in the code base.

@alvin-reyes
Copy link
Contributor

Quick check: Possibly related to private key being set. The invalid length, need 256 bits error is from the ECDSA key conversation of the private key.

@alvin-reyes
Copy link
Contributor

We don't have a private key set on the configuration so we need to inject this on the github action.

@Rodebrechtd
Copy link
Contributor

I confirm what @alvin-reyes said. I also ran it locally and managed to run it with a private key:
❯ go test ./web3/sdk_test.go
ok command-line-arguments 1.884s

@bgins, where exactly does this test run, is it a github action?

@bgins
Copy link
Contributor Author

bgins commented Oct 8, 2024

I confirm what @alvin-reyes said. I also ran it locally and managed to run it with a private key: ❯ go test ./web3/sdk_test.go ok command-line-arguments 1.884s

@bgins, where exactly does this test run, is it a github action?

At the moment, we are only running the web3 tests in CI.

run: ./stack unit-tests

lilypad/stack

Lines 337 to 340 in 90a248d

function unit-tests() {
cd hardhat
npx hardhat test --network hardhat
}

We should run the Go unit tests there as well once we fix any broken tests.

For the moment, we can run these tests from the root of the project with go test ./pkg/web3/sdk_test.go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants