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

Should networkID and chainID be different? #863

Open
Jonas1024 opened this issue Aug 1, 2024 · 0 comments
Open

Should networkID and chainID be different? #863

Jonas1024 opened this issue Aug 1, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Jonas1024
Copy link

What happened?

let httpProvider = try await Web3HttpProvider(url: URL(string: url)!, network: nil, keystoreManager: keystoreManager)
self.web3 = Web3(provider: httpProvider)

When I created WEB3, the network field was empty and the url was my locally deployed server.

Later, the NetworkID was requested through this method.

let response: String = try await APIRequest.send(APIRequest.getNetwork.call, parameters: [], with: self).result

Some methods require chainID, but return networkID

    public var chainID: BigUInt {
        switch self {
        case .Custom(let networkID): return networkID
        case .Mainnet: return BigUInt(1)
        case .Ropsten: return BigUInt(3)
        case .Rinkeby: return BigUInt(4)
        case .Goerli: return BigUInt(5)
        case .Kovan: return BigUInt(42)
        }
    }

What are the steps to reproduce?

What is the expected behavior?

What is the error thrown?

What's the stack trace said?

OS version

Library version

3.2.1

@Jonas1024 Jonas1024 added the bug Something isn't working label Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant