Skip to content

Should networkID and chainID be different? #863

Open
@Jonas1024

Description

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

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions