core

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: AGPL-3.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlsAggregateAndVerify added in v0.2.3

func BlsAggregateAndVerify(secondarySPBlsPubKeys []bls.PublicKey, signBz [32]byte, secondarySigs [][]byte) ([]byte, error)

func BlsSignAndVerify added in v0.2.3

func BlsSignAndVerify(sp *StorageProvider, signBz [32]byte) ([]byte, error)

func GenRandomAddr

func GenRandomAddr() sdk.AccAddress

func GenRandomHexString

func GenRandomHexString(len int) string

func GenRandomKeyManager

func GenRandomKeyManager() keys.KeyManager

func ParseChallengerMnemonic added in v0.0.10

func ParseChallengerMnemonic(i int) string

ParseChallengerMnemonic read the challenger mnemonic from file

func ParseMnemonicFromFile

func ParseMnemonicFromFile(fileName string) string

func ParseRelayerMnemonic added in v0.0.7

func ParseRelayerMnemonic(i int) string

ParseRelayerMnemonic read the relayer mnemonic from file

func ParseSPBLSMnemonics added in v0.2.3

func ParseSPBLSMnemonics(i int) string

ParseSPBLSMnemonics read the sp bls mnemonics from file

func ParseValidatorBlsMnemonic added in v0.0.10

func ParseValidatorBlsMnemonic(i int) string

ParseValidatorBlsMnemonic read the validator mnemonic of bls from file

func ParseValidatorHomeDir added in v0.2.4

func ParseValidatorHomeDir(i int) string

ParseValidatorHomeDir returns the home dir of the validator

func ParseValidatorMnemonic

func ParseValidatorMnemonic(i int) string

ParseValidatorMnemonic read the validator mnemonic from file

func ParseValidatorTmRPCAddrDir added in v0.2.4

func ParseValidatorTmRPCAddrDir(i int) string

ParseValidatorTmRPCAddrDir returns the home dir of the validator

func RandInt64 added in v0.0.7

func RandInt64(min, max int64) int64

RandInt64 generate random int64 between min and max

func YamlString added in v0.0.7

func YamlString(data interface{}) string

Types

type BaseSuite

type BaseSuite struct {
	suite.Suite
	Config           *Config
	Client           *client.GreenfieldClient
	TmClient         *client.TendermintClient
	Validator        keys.KeyManager
	ValidatorBLS     keys.KeyManager
	Relayer          keys.KeyManager
	Challenger       keys.KeyManager
	StorageProviders map[uint32]*StorageProvider
}

func (*BaseSuite) CheckTxCode added in v0.2.0

func (s *BaseSuite) CheckTxCode(txHash string, expectedCode uint32) error

func (*BaseSuite) CreateGlobalVirtualGroup added in v0.2.3

func (s *BaseSuite) CreateGlobalVirtualGroup(sp *StorageProvider, familyID uint32, secondarySPIDs []uint32, depositAmount int64) (uint32, uint32)

func (*BaseSuite) CreateNewStorageProvider added in v0.2.3

func (s *BaseSuite) CreateNewStorageProvider() *StorageProvider

func (*BaseSuite) CreateObject added in v0.2.3

func (s *BaseSuite) CreateObject(user keys.KeyManager, primarySP *StorageProvider, gvgID uint32, bucketName, objectName string) (secondarySps []*StorageProvider, familyID, resGVGID uint32, bucketInfo storagetypes.BucketInfo)

func (*BaseSuite) ExistsSPMaintenanceRecords added in v0.2.4

func (s *BaseSuite) ExistsSPMaintenanceRecords(addr string) (bool, error)

func (*BaseSuite) GenAndChargeAccounts

func (s *BaseSuite) GenAndChargeAccounts(n int, balance int64) (accounts []keys.KeyManager)

func (*BaseSuite) GenRandomBlsKeyManager added in v0.2.3

func (s *BaseSuite) GenRandomBlsKeyManager() keys.KeyManager

func (*BaseSuite) GetChainID added in v0.2.3

func (s *BaseSuite) GetChainID() string

func (*BaseSuite) InitChain added in v0.2.4

func (s *BaseSuite) InitChain()

func (*BaseSuite) LatestHeight added in v0.2.0

func (s *BaseSuite) LatestHeight() (int64, error)

func (*BaseSuite) NewSpAcc added in v0.2.3

func (s *BaseSuite) NewSpAcc() *StorageProvider

func (*BaseSuite) PickDifferentStorageProvider added in v0.2.3

func (s *BaseSuite) PickDifferentStorageProvider(spId uint32) *StorageProvider

func (*BaseSuite) PickStorageProvider added in v0.2.3

func (s *BaseSuite) PickStorageProvider() *StorageProvider

func (*BaseSuite) PickStorageProviderByBucketName added in v0.2.3

func (s *BaseSuite) PickStorageProviderByBucketName(bucketName string) *StorageProvider

func (*BaseSuite) PickStorageProviderByID added in v1.3.0

func (s *BaseSuite) PickStorageProviderByID(id uint32) *StorageProvider

func (*BaseSuite) RefreshGVGFamilies added in v0.2.3

func (s *BaseSuite) RefreshGVGFamilies()

func (*BaseSuite) SendTxBlock

func (s *BaseSuite) SendTxBlock(from keys.KeyManager, msg ...sdk.Msg) *sdk.TxResponse

func (*BaseSuite) SendTxBlockWithExpectErrorString added in v0.0.10

func (s *BaseSuite) SendTxBlockWithExpectErrorString(msg sdk.Msg, from keys.KeyManager, expectErrorString string)

func (*BaseSuite) SendTxBlockWithoutCheck added in v0.0.10

func (s *BaseSuite) SendTxBlockWithoutCheck(msg sdk.Msg, from keys.KeyManager) (*tx.BroadcastTxResponse, error)

func (*BaseSuite) SendTxBlockWithoutCheckWithTxOpt added in v0.2.3

func (s *BaseSuite) SendTxBlockWithoutCheckWithTxOpt(msg sdk.Msg, from keys.KeyManager, txOpt *types.TxOption) (*tx.BroadcastTxResponse, error)

func (*BaseSuite) SendTxWithTxOpt added in v0.2.0

func (s *BaseSuite) SendTxWithTxOpt(msg sdk.Msg, from keys.KeyManager, txOpt types.TxOption)

func (*BaseSuite) SetupSuite

func (s *BaseSuite) SetupSuite()

func (*BaseSuite) SimulateTx added in v0.1.2

func (s *BaseSuite) SimulateTx(msg sdk.Msg, from keys.KeyManager) (txRes *tx.SimulateResponse)

func (*BaseSuite) WaitForHeightWithTimeout added in v0.2.0

func (s *BaseSuite) WaitForHeightWithTimeout(h int64, t time.Duration) (int64, error)

func (*BaseSuite) WaitForNextBlock added in v0.2.0

func (s *BaseSuite) WaitForNextBlock() error

func (*BaseSuite) WaitForTx added in v0.2.3

func (s *BaseSuite) WaitForTx(hash string) (*sdk.TxResponse, error)

type Config

type Config struct {
	GrpcAddr             string        `yaml:"GrpcAddr"`
	TendermintAddr       string        `yaml:"TendermintAddr"`
	ChainId              string        `yaml:"ChainId"`
	ValidatorMnemonic    string        `yaml:"Mnemonic"`           // validator operator account mnemonic with enough balance
	ValidatorBlsMnemonic string        `yaml:"BLSMnemonic"`        // validator's mnemonic for bls key
	RelayerMnemonic      string        `yaml:"RelayerMnemonic"`    // relayer mnemonic
	ChallengerMnemonic   string        `yaml:"ChallengerMnemonic"` // challenger mnemonic
	SPMnemonics          []SPMnemonics `yaml:"SPMnemonics"`
	SPBLSMnemonic        []string      `yaml:"SPBLSMnemonic"`
	Denom                string        `yaml:"Denom"`
	ValidatorHomeDir     string        `yaml:"ValidatorHomeDir"`
	ValidatorTmRPCAddr   string        `yaml:"ValidatorTmRPCAddr"`
}

func InitConfig

func InitConfig() *Config

func InitE2eConfig

func InitE2eConfig() *Config

type SPMnemonics

type SPMnemonics struct {
	OperatorMnemonic    string `yaml:"OperatorMnemonic"`    // operator account mnemonic with enough balance
	SealMnemonic        string `yaml:"SealMnemonic"`        // seal account mnemonic with enough balance
	FundingMnemonic     string `yaml:"FundingMnemonic"`     // funding account mnemonic with enough balance
	ApprovalMnemonic    string `yaml:"ApprovalMnemonic"`    // approval account mnemonic with enough balance
	GcMnemonic          string `yaml:"GcMnemonic"`          // gc account mnemonic with enough balance
	MaintenanceMnemonic string `yaml:"MaintenanceMnemonic"` // maintenance account mnemonic with enough balance
}

func ParseSPMnemonics

func ParseSPMnemonics(i int) SPMnemonics

ParseSPMnemonics read the sp mnemonics from file

type StorageProvider added in v0.2.3

type StorageProvider struct {
	OperatorKey                keys.KeyManager
	SealKey                    keys.KeyManager
	FundingKey                 keys.KeyManager
	ApprovalKey                keys.KeyManager
	GcKey                      keys.KeyManager
	MaintenanceKey             keys.KeyManager
	BlsKey                     keys.KeyManager
	Info                       *sptypes.StorageProvider
	GlobalVirtualGroupFamilies map[uint32][]*virtualgroupmoduletypes.GlobalVirtualGroup
}

func (*StorageProvider) GetFirstGlobalVirtualGroup added in v0.2.3

func (sp *StorageProvider) GetFirstGlobalVirtualGroup() (*virtualgroupmoduletypes.GlobalVirtualGroup, bool)

Jump to

Keyboard shortcuts

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