testshield

package
v2.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Helper

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

Helper is a structure which wraps the staking handler and provides methods useful in tests

func NewHelper

func NewHelper(t *testing.T, ctx sdk.Context, k keeper.Keeper, denom string) *Helper

NewHelper creates staking Handler wrapper for tests

func (*Helper) CreatePool

func (sh *Helper) CreatePool(addr, sponsorAddr sdk.AccAddress, deposit, shield, shieldLimit int64, sponsor, description string)

func (*Helper) DecCoinsI64 added in v2.7.0

func (sh *Helper) DecCoinsI64(amt int64) sdk.DecCoins

func (*Helper) DepositCollateral

func (sh *Helper) DepositCollateral(addr sdk.AccAddress, amount int64, ok bool)

func (*Helper) GetFundedAcc added in v2.7.0

func (sh *Helper) GetFundedAcc(bk bankkeeper.Keeper, pk cryptotypes.PubKey, amt int64) sdk.AccAddress

func (*Helper) Handle

func (sh *Helper) Handle(msg sdk.Msg, ok bool) *sdk.Result

Handle calls shield handler on a given message

func (*Helper) HandleProposal

func (sh *Helper) HandleProposal(content govtypes.Content, ok bool)

HandleProposal calls shield proposal handler on a given proposal.

func (*Helper) PurchaseShield

func (sh *Helper) PurchaseShield(purchaser sdk.AccAddress, shield int64, poolID uint64, ok bool)

func (*Helper) ShieldClaimProposal

func (sh *Helper) ShieldClaimProposal(proposer sdk.AccAddress, loss int64, poolID, purchaseID uint64, ok bool)

func (*Helper) StakeForShield added in v2.7.0

func (sh *Helper) StakeForShield(poolID uint64, shield int64, desc string, from sdk.AccAddress)

func (*Helper) TurnBlock

func (sh *Helper) TurnBlock(ctx sdk.Context)

TurnBlock updates context and calls endblocker.

func (*Helper) UpdatePool added in v2.7.0

func (sh *Helper) UpdatePool(poolID uint64, fromAddr sdk.AccAddress, serviceFee, shield, shieldLimit int64, desc string)

func (*Helper) WithdrawCollateral

func (sh *Helper) WithdrawCollateral(addr sdk.AccAddress, amount int64, ok bool)

func (*Helper) WithdrawReimbursement

func (sh *Helper) WithdrawReimbursement(purchaser sdk.AccAddress, proposalID uint64, ok bool)

Jump to

Keyboard shortcuts

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