database

package
v0.0.0-...-a4031b1 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2022 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestChainName  = "cosmos-hub"
	CreateDB       = `CREATE DATABASE IF NOT EXISTS cns`
	CreateCNSTable = `` /* 444-byte string literal not displayed */

)

Variables

View Source
var (
	TestDBMigrations = []string{
		CreateDB,
		CreateCNSTable,
		`
	INSERT INTO cns.chains 
		(
		id, enabled, chain_name, valid_block_thresh, logo, display_name, primary_channel, denoms, demeris_addresses, 
		genesis_hash, node_info, derivation_path
		) 
		VALUES (
			1, true, '` + TestChainName + `', '10s', 'logo url', 'Cosmos Hub', 
			'{"cosmos-hub": "channel-0", "akash": "channel-1"}',
			'[
				{"display_name":"USD","name":"uusd","verified":true,"fee_token":true,"fetch_price":true,"fee_levels":{"low":1,"average":22,"high":42},"precision":6},
				{"display_name":"ATOM","name":"uatom","verified":true,"fetch_price":true,"fee_token":true,"fee_levels":{"low":1,"average":22,"high":42},"precision":6}
			]', 
			ARRAY['feeaddress'], 'genesis_hash', 
			'{"endpoint":"endpoint","chain_id":"chainid","bech32_config":{"main_prefix":"main_prefix","prefix_account":"prefix_account","prefix_validator":"prefix_validator",
			"prefix_consensus":"prefix_consensus","prefix_public":"prefix_public","prefix_operator":"prefix_operator"}}', 
			'm/44''/118''/0''/0/0')
	`,
	}
)

Functions

This section is empty.

Types

type Instance

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

func New

func New(connString string) (*Instance, error)

func SetupTestDB

func SetupTestDB(migrations []string) (testserver.TestServer, *Instance)

func (*Instance) Chain

func (i *Instance) Chain(chain string) (cnsmodels.Chain, error)

func (*Instance) Chains

func (i *Instance) Chains() ([]cnsmodels.Chain, error)

func (*Instance) GetCounterParty

func (i *Instance) GetCounterParty(chain, srcChannel string) ([]cnsmodels.ChannelQuery, error)

func (*Instance) UpdateDenoms

func (i *Instance) UpdateDenoms(chain cnsmodels.Chain) error

Jump to

Keyboard shortcuts

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