Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { ETHClientAddress string ETHClient EthClient ChainID *big.Int RegistryContract RegistryContract RLNContract RLNContract // contains filtered or unexported fields }
Config is a helper struct that contains attributes for interaction with RLN smart contracts
func BuildConfig ¶
func BuildConfig(ctx context.Context, ethClientAddress string, registryAddress common.Address) (*Config, error)
BuildConfig returns an instance of Web3Config with all the required elements for interaction with the RLN smart contracts
type EthClient ¶
type EthClient interface { bind.ContractBackend SyncProgress(ctx context.Context) (*ethereum.SyncProgress, error) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error) BlockByNumber(ctx context.Context, number *big.Int) (*types.Block, error) SubscribeNewHead(ctx context.Context, ch chan<- *types.Header) (ethereum.Subscription, error) Close() }
EthClient is an interface for the ethclient.Client, so that we can pass mock client for testing
type RLNContract ¶
type RLNContract struct { *contracts.RLN Address common.Address StorageIndex uint16 DeployedBlockNumber uint64 }
RLNContract contains an instance of the RLN contract, its address and the storage index within the registry that represents this contract
type RegistryContract ¶
type RegistryContract struct { *contracts.RLNRegistry Address common.Address }
RegistryContract contains an instance of the RLN Registry contract and its address
Click to show internal directories.
Click to hide internal directories.