Lilypad-Tech / lilypad

Run AI workloads easily in a decentralized GPU network. https://www.youtube.com/watch?v=yQnB2Yxia4Y
https://lilypad.tech
Apache License 2.0
53 stars 17 forks source link

Investigate broken web3 SDK unit tests #385

Open bgins opened 2 months ago

bgins commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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

Rodebrechtd commented 1 month ago

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 commented 1 month ago

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.

https://github.com/Lilypad-Tech/lilypad/blob/90a248d4ad12d5f49d6518917537f45db989674f/.github/workflows/test.yml#L23 https://github.com/Lilypad-Tech/lilypad/blob/90a248d4ad12d5f49d6518917537f45db989674f/stack#L337-L340

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.