e2e

package module
v0.0.0-...-3186b2b Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

README

Testing

We utilize the interchaintest testing suite.

All tests are located in the interchaintest folder.

How to Run tests:

Requirements:
  • Docker (running)
  • Golang
  1. If you don't already have heighliner installed, install it. Otherwise, skip this step.

Heighliner is a tool used to help streamline the creation of the docker image we'll create in step 2.

make get-heighliner

  1. Create local docker image that contains the noble binary. If you make any code changes, you'll want to re-make the image before running tests.

make local-image

  1. Now we can run the tests. There are two ways to run the test.

    a. If you are using VS Code you can simply click the run test button above each test. For this to work, you may need to install the Go extension to VS Code.

    vsCode_runTest

    b. Or you can run it from the command line:

    cd interchaintest
    go test -v -run <NAME_OF_TEST>
    
    # Example
    go test -timeout 10m -v -run TestCCTP_DepForBurnWithCallerOnEth
    

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LocalImages = []ibc.DockerImage{
		{
			Repository: "noble",
			Version:    "local",
			UIDGID:     "1025:1025",
		},
	}

	DenomMetadataUsdc = banktypes.Metadata{
		Description: "USD Coin",
		DenomUnits: []*banktypes.DenomUnit{
			{
				Denom:    "uusdc",
				Exponent: 0,
				Aliases: []string{
					"microusdc",
				},
			},
			{
				Denom:    "usdc",
				Exponent: 6,
				Aliases:  []string{},
			},
		},
		Base:    "uusdc",
		Display: "usdc",
		Name:    "usdc",
		Symbol:  "USDC",
	}
)

Functions

func BlacklistAccount

func BlacklistAccount(t *testing.T, ctx context.Context, val *cosmos.ChainNode, blacklister ibc.Wallet, toBlacklist ibc.Wallet)

BlacklistAccount blacklists an account and then runs the `show-blacklisted` query to ensure the account was successfully blacklisted on chain

func ConfigureMinter

func ConfigureMinter(t *testing.T, ctx context.Context, val *cosmos.ChainNode, minterController, minter ibc.Wallet, allowance int64)

ConfigureMinter configures a minter with a specified allowance of `uusdc`. It then runs the `show-minters` query to ensure the minter was properly configured

func NobleChainSpec

func NobleChainSpec(
	ctx context.Context,
	nw *NobleWrapper,
	chainID string,
	version []ibc.DockerImage,
	nv, nf int,
	setupAllCircleRoles bool,
) *interchaintest.ChainSpec

func NobleEncoding

func NobleEncoding() *testutil.TestEncodingConfig

func PauseFiatTF

func PauseFiatTF(t *testing.T, ctx context.Context, val *cosmos.ChainNode, pauser ibc.Wallet)

PauseFiatTF pauses the fiat tokenfactory. It then runs the `show-paused` query to ensure the the tokenfactory was successfully paused

func SetupMinterAndController

func SetupMinterAndController(t *testing.T, ctx context.Context, noble *cosmos.CosmosChain, val *cosmos.ChainNode, masterMinter ibc.Wallet, allowance int64) (minter ibc.Wallet, minterController ibc.Wallet)

SetupMinterAndController creates a minter controller and minter. It also sets up a minter with an specified allowance of `uusdc`

func ShowBlacklisted

func ShowBlacklisted(ctx context.Context, val *cosmos.ChainNode, blacklistedWallet ibc.Wallet) (fiattokenfactorytypes.QueryGetBlacklistedResponse, error)

ShowBlacklisted queries for a specific blacklisted address by running: `query fiat-tokenfactory show-blacklisted <address>`. An error is returned if the address is not blacklisted

func ShowBlacklister

ShowBlacklister queries for the token factory Blacklister by running: `query fiat-tokenfactory show-blacklister`.

func ShowMasterMinter

ShowMasterMinter queries for the token factory Master Minter by running: `query fiat-tokenfactory show-master-minter`.

func ShowMinterController

func ShowMinterController(ctx context.Context, val *cosmos.ChainNode, minterController ibc.Wallet) (fiattokenfactorytypes.QueryGetMinterControllerResponse, error)

ShowMinterController queries for a specific minter controller by running: `query fiat-tokenfactory show-minter-controller <address>`. An error is returned if the minter controller does not exist

func ShowMinters

ShowMinters queries for a specific minter by running: `query fiat-tokenfactory show-minters <address>`. An error is returned if the minter does not exist

func ShowOwner

ShowOwner queries for the token factory Owner by running: `query fiat-tokenfactory show-owner`.

func ShowPaused

ShowPaused queries the paused state of the token factory by running: `query fiat-tokenfactory show-paused`.

func ShowPauser

ShowPauser queries for the token factory Pauser by running: `query fiat-tokenfactory show-pauser`.

func TestChainUpgrade

func TestChainUpgrade(
	t *testing.T,
	genesisVersion string,
	upgrades []ChainUpgrade,
)

func UnblacklistAccount

func UnblacklistAccount(t *testing.T, ctx context.Context, val *cosmos.ChainNode, blacklister ibc.Wallet, unBlacklist ibc.Wallet)

UnblacklistAccount unblacklists an account and then runs the `show-blacklisted` query to ensure the account was successfully unblacklisted on chain

func UnpauseFiatTF

func UnpauseFiatTF(t *testing.T, ctx context.Context, val *cosmos.ChainNode, pauser ibc.Wallet)

UnpauseFiatTF pauses the fiat tokenfactory. It then runs the `show-paused` query to ensure the the tokenfactory was successfully unpaused

Types

type CCTPRoles

type CCTPRoles struct {
	Owner           ibc.Wallet
	AttesterManager ibc.Wallet
	TokenController ibc.Wallet
}

type ChainUpgrade

type ChainUpgrade struct {
	Image       ibc.DockerImage
	UpgradeName string // if upgradeName is empty, assumes patch/rolling update
	Emergency   bool
	PreUpgrade  func(t *testing.T, ctx context.Context, noble *cosmos.CosmosChain, authority ibc.Wallet)
	PostUpgrade func(t *testing.T, ctx context.Context, noble *cosmos.CosmosChain, authority ibc.Wallet)
}

type FiatTfRoles

type FiatTfRoles struct {
	Owner            ibc.Wallet
	MasterMinter     ibc.Wallet
	MinterController ibc.Wallet
	Minter           ibc.Wallet
	Blacklister      ibc.Wallet
	Pauser           ibc.Wallet
}

type NobleWrapper

type NobleWrapper struct {
	Chain       *cosmos.CosmosChain
	FiatTfRoles FiatTfRoles
	CCTPRoles   CCTPRoles
	Authority   ibc.Wallet
}

func NobleSpinUp

func NobleSpinUp(t *testing.T, ctx context.Context, version []ibc.DockerImage, setupAllCircleRoles bool) (nw NobleWrapper, client *client.Client)

NobleSpinUp starts noble chain

setupAllCircleRoles: if true, all Tokenfactory and CCTP roles will be created and setup at genesis, if false, only the Owner role will be created

func NobleSpinUpIBC

func NobleSpinUpIBC(t *testing.T, ctx context.Context, version []ibc.DockerImage, setupAllCircleRoles bool) (
	nw NobleWrapper,
	ibcSimd *cosmos.CosmosChain,
	rf interchaintest.RelayerFactory,
	r ibc.Relayer,
	ibcPathName string,
	rep *testreporter.Reporter,
	eRep *testreporter.RelayerExecReporter,
	client *client.Client,
	network string,
)

NobleSpinUpIBC is the same as nobleSpinUp but it also spins up a ibcSimd chain and creates an IBC path between them

setupAllCircleRoles: if true, all Tokenfactory and CCTP roles will be created and setup at genesis, if false, only the Owner role will be created

Jump to

Keyboard shortcuts

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