provider

package
v0.52.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2025 License: MIT Imports: 20 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccountGenPrivateKey

func AccountGenPrivateKey(privateKey string) *accountGenPrivateKey

AccountGenPrivateKey creates a new instance of accountGenPrivateKey with the provided private key.

Types

type AccountGenerator

type AccountGenerator interface {
	Generate() (sui.SuiSigner, error)
}

AccountGenerator is an interface for generating Sui accounts.

type CTFChainProvider

type CTFChainProvider struct {
	// contains filtered or unexported fields
}

CTFChainProvider manages a Sui chain instance running inside a Chainlink Testing Framework (CTF) Docker container.

This provider requires Docker to be installed and operational. Spinning up a new container can be slow, so it is recommended to initialize the provider only once per test suite or parent test to optimize performance.

func NewCTFChainProvider

func NewCTFChainProvider(
	t *testing.T, selector uint64, config CTFChainProviderConfig,
) *CTFChainProvider

NewCTFChainProvider creates a new CTFChainProvider with the given selector and configuration.

func (*CTFChainProvider) BlockChain

func (p *CTFChainProvider) BlockChain() chain.BlockChain

BlockChain returns the Sui chain instance managed by this provider. You must call Initialize before using this method to ensure the chain is properly set up.

func (*CTFChainProvider) ChainSelector

func (p *CTFChainProvider) ChainSelector() uint64

ChainSelector returns the chain selector of the Sui chain managed by this provider.

func (*CTFChainProvider) Initialize

func (p *CTFChainProvider) Initialize(_ context.Context) (chain.BlockChain, error)

Initialize sets up the Sui chain by validating the configuration, starting a CTF container, generating a deployer signer account, and constructing the chain instance.

func (*CTFChainProvider) Name

func (*CTFChainProvider) Name() string

Name returns the name of the CTFChainProvider.

type CTFChainProviderConfig

type CTFChainProviderConfig struct {
	// Required: A generator for the deployer signer account. Use AccountGenPrivateKey to
	// create a deployer signer from a hex private key.
	DeployerSignerGen AccountGenerator

	// Required: A sync.Once instance to ensure that the CTF framework only sets up the new
	// DefaultNetwork once
	Once *sync.Once

	// Optional: A specification of the image to use for the CTF container.
	// Default: mysten/sui-tools:devnet
	Image *string

	// Optional: A specification of the platform to use for the CTF container.
	// Default: linux/amd64
	Platform *string
}

CTFChainProviderConfig holds the configuration to initialize the CTFChainProvider.

type RPCChainProvider

type RPCChainProvider struct {
	// contains filtered or unexported fields
}

RPCChainProvider is a chain provider that provides a chain that connects to an Sui node via RPC

func NewRPCChainProvider

func NewRPCChainProvider(selector uint64, config RPCChainProviderConfig) *RPCChainProvider

NewRPCChainProvider creates a new RPCChainProvider with the given selector and configuration.

func (*RPCChainProvider) BlockChain

func (p *RPCChainProvider) BlockChain() chain.BlockChain

BlockChain returns the Aptos chain instance managed by this provider. You must call Initialize before using this method to ensure the chain is properly set up.

func (*RPCChainProvider) ChainSelector

func (p *RPCChainProvider) ChainSelector() uint64

ChainSelector returns the chain selector of the Aptos chain managed by this provider.

func (*RPCChainProvider) Initialize

func (p *RPCChainProvider) Initialize(_ context.Context) (chain.BlockChain, error)

Initialize initializes the RPCChainProvider, validating the configuration and setting up the Aptos chain client.

func (*RPCChainProvider) Name

func (*RPCChainProvider) Name() string

Name returns the name of the RPCChainProvider.

type RPCChainProviderConfig

type RPCChainProviderConfig struct {
	// Required: The RPC URL to connect to the Sui node
	RPCURL string

	DeployerSignerGen AccountGenerator
}

RPCChainProviderConfig holds the configuration to initialize the RPCChainProvider.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL