Documentation ¶
Index ¶
- func Has(fixed, toCheck FailureFlag) bool
- type ApproveOn
- type FailureFlag
- type LatestCalls
- type MaxAmountAuthenticator
- func (m MaxAmountAuthenticator) Authenticate(ctx sdk.Context, request authenticator.AuthenticationRequest) error
- func (m MaxAmountAuthenticator) ConfirmExecution(ctx sdk.Context, request authenticator.AuthenticationRequest) error
- func (m MaxAmountAuthenticator) GetAmount(ctx sdk.Context) osmomath.Int
- func (m MaxAmountAuthenticator) Initialize(config []byte) (authenticator.Authenticator, error)
- func (m MaxAmountAuthenticator) OnAuthenticatorAdded(ctx sdk.Context, account sdk.AccAddress, config []byte, authenticatorId string) error
- func (m MaxAmountAuthenticator) OnAuthenticatorRemoved(ctx sdk.Context, account sdk.AccAddress, config []byte, authenticatorId string) error
- func (m MaxAmountAuthenticator) SetAmount(ctx sdk.Context, amount osmomath.Int)
- func (m MaxAmountAuthenticator) StaticGas() uint64
- func (m MaxAmountAuthenticator) Track(ctx sdk.Context, request authenticator.AuthenticationRequest) error
- func (m MaxAmountAuthenticator) Type() string
- type MaxAmountAuthenticatorData
- type SpyAddRequest
- type SpyAuthenticator
- func (s SpyAuthenticator) Authenticate(ctx sdk.Context, request authenticator.AuthenticationRequest) error
- func (s SpyAuthenticator) ConfirmExecution(ctx sdk.Context, request authenticator.AuthenticationRequest) error
- func (s SpyAuthenticator) GetLatestCalls(ctx sdk.Context) LatestCalls
- func (s SpyAuthenticator) Initialize(config []byte) (authenticator.Authenticator, error)
- func (s SpyAuthenticator) OnAuthenticatorAdded(ctx sdk.Context, account sdk.AccAddress, config []byte, authenticatorId string) error
- func (s SpyAuthenticator) OnAuthenticatorRemoved(ctx sdk.Context, account sdk.AccAddress, config []byte, authenticatorId string) error
- func (s SpyAuthenticator) ResetLatestCalls(ctx sdk.Context)
- func (s SpyAuthenticator) StaticGas() uint64
- func (s SpyAuthenticator) Track(ctx sdk.Context, request authenticator.AuthenticationRequest) error
- func (s SpyAuthenticator) Type() string
- func (s SpyAuthenticator) UpdateLatestCalls(ctx sdk.Context, f func(calls LatestCalls) LatestCalls) LatestCalls
- type SpyAuthenticatorData
- type SpyRemoveRequest
- type SpyTrackRequest
- type StatefulAuthenticator
- func (s StatefulAuthenticator) Authenticate(ctx sdk.Context, request authenticator.AuthenticationRequest) error
- func (s StatefulAuthenticator) ConfirmExecution(ctx sdk.Context, request authenticator.AuthenticationRequest) error
- func (s StatefulAuthenticator) GetValue(ctx sdk.Context) int
- func (s StatefulAuthenticator) Initialize(config []byte) (authenticator.Authenticator, error)
- func (s StatefulAuthenticator) OnAuthenticatorAdded(ctx sdk.Context, account sdk.AccAddress, config []byte, authenticatorId string) error
- func (s StatefulAuthenticator) OnAuthenticatorRemoved(ctx sdk.Context, account sdk.AccAddress, config []byte, authenticatorId string) error
- func (s StatefulAuthenticator) SetValue(ctx sdk.Context, value int)
- func (s StatefulAuthenticator) StaticGas() uint64
- func (s StatefulAuthenticator) Track(ctx sdk.Context, request authenticator.AuthenticationRequest) error
- func (s StatefulAuthenticator) Type() string
- type StatefulAuthenticatorData
- type TestingAuthenticator
- func (t TestingAuthenticator) Authenticate(ctx sdk.Context, request authenticator.AuthenticationRequest) error
- func (t TestingAuthenticator) ConfirmExecution(ctx sdk.Context, request authenticator.AuthenticationRequest) error
- func (t TestingAuthenticator) Initialize(config []byte) (authenticator.Authenticator, error)
- func (t TestingAuthenticator) OnAuthenticatorAdded(ctx sdk.Context, account sdk.AccAddress, config []byte, authenticatorId string) error
- func (t TestingAuthenticator) OnAuthenticatorRemoved(ctx sdk.Context, account sdk.AccAddress, config []byte, authenticatorId string) error
- func (t TestingAuthenticator) StaticGas() uint64
- func (t TestingAuthenticator) Track(ctx sdk.Context, request authenticator.AuthenticationRequest) error
- func (t TestingAuthenticator) Type() string
- type TestingAuthenticatorData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Has ¶
func Has(fixed, toCheck FailureFlag) bool
Types ¶
type FailureFlag ¶
type FailureFlag = uint8
const ( AUTHENTICATE_FAIL FailureFlag = 1 << iota CONFIRM_EXECUTION_FAIL )
type LatestCalls ¶
type LatestCalls struct { Authenticate authenticator.AuthenticationRequest Track SpyTrackRequest ConfirmExecution authenticator.AuthenticationRequest OnAuthenticatorAdded SpyAddRequest OnAuthenticatorRemoved SpyRemoveRequest }
type MaxAmountAuthenticator ¶
type MaxAmountAuthenticator struct {
KvStoreKey storetypes.StoreKey
}
func (MaxAmountAuthenticator) Authenticate ¶
func (m MaxAmountAuthenticator) Authenticate(ctx sdk.Context, request authenticator.AuthenticationRequest) error
func (MaxAmountAuthenticator) ConfirmExecution ¶
func (m MaxAmountAuthenticator) ConfirmExecution(ctx sdk.Context, request authenticator.AuthenticationRequest) error
func (MaxAmountAuthenticator) GetAmount ¶
func (m MaxAmountAuthenticator) GetAmount(ctx sdk.Context) osmomath.Int
func (MaxAmountAuthenticator) Initialize ¶
func (m MaxAmountAuthenticator) Initialize(config []byte) (authenticator.Authenticator, error)
func (MaxAmountAuthenticator) OnAuthenticatorAdded ¶
func (m MaxAmountAuthenticator) OnAuthenticatorAdded(ctx sdk.Context, account sdk.AccAddress, config []byte, authenticatorId string) error
func (MaxAmountAuthenticator) OnAuthenticatorRemoved ¶
func (m MaxAmountAuthenticator) OnAuthenticatorRemoved(ctx sdk.Context, account sdk.AccAddress, config []byte, authenticatorId string) error
func (MaxAmountAuthenticator) SetAmount ¶
func (m MaxAmountAuthenticator) SetAmount(ctx sdk.Context, amount osmomath.Int)
The following methods for MaxAmountAuthenticator are similar to the set and get value methods for StatefulAuthenticator but set and get an int
func (MaxAmountAuthenticator) StaticGas ¶
func (m MaxAmountAuthenticator) StaticGas() uint64
func (MaxAmountAuthenticator) Track ¶
func (m MaxAmountAuthenticator) Track(ctx sdk.Context, request authenticator.AuthenticationRequest) error
func (MaxAmountAuthenticator) Type ¶
func (m MaxAmountAuthenticator) Type() string
type SpyAddRequest ¶
type SpyAddRequest struct { Account sdk.AccAddress `json:"account"` Data []byte `json:"data"` AuthenticatorId string `json:"authenticator_id"` }
type SpyAuthenticator ¶
type SpyAuthenticator struct { KvStoreKey storetypes.StoreKey Name string Failure FailureFlag }
SpyAuthenticator tracks latest call and can be used to test the authenticator
func NewSpyAuthenticator ¶
func NewSpyAuthenticator(kvStoreKey storetypes.StoreKey) SpyAuthenticator
func (SpyAuthenticator) Authenticate ¶
func (s SpyAuthenticator) Authenticate(ctx sdk.Context, request authenticator.AuthenticationRequest) error
func (SpyAuthenticator) ConfirmExecution ¶
func (s SpyAuthenticator) ConfirmExecution(ctx sdk.Context, request authenticator.AuthenticationRequest) error
func (SpyAuthenticator) GetLatestCalls ¶
func (s SpyAuthenticator) GetLatestCalls(ctx sdk.Context) LatestCalls
func (SpyAuthenticator) Initialize ¶
func (s SpyAuthenticator) Initialize(config []byte) (authenticator.Authenticator, error)
func (SpyAuthenticator) OnAuthenticatorAdded ¶
func (s SpyAuthenticator) OnAuthenticatorAdded(ctx sdk.Context, account sdk.AccAddress, config []byte, authenticatorId string) error
func (SpyAuthenticator) OnAuthenticatorRemoved ¶
func (s SpyAuthenticator) OnAuthenticatorRemoved(ctx sdk.Context, account sdk.AccAddress, config []byte, authenticatorId string) error
func (SpyAuthenticator) ResetLatestCalls ¶
func (s SpyAuthenticator) ResetLatestCalls(ctx sdk.Context)
func (SpyAuthenticator) StaticGas ¶
func (s SpyAuthenticator) StaticGas() uint64
func (SpyAuthenticator) Track ¶
func (s SpyAuthenticator) Track(ctx sdk.Context, request authenticator.AuthenticationRequest) error
func (SpyAuthenticator) Type ¶
func (s SpyAuthenticator) Type() string
func (SpyAuthenticator) UpdateLatestCalls ¶
func (s SpyAuthenticator) UpdateLatestCalls(ctx sdk.Context, f func(calls LatestCalls) LatestCalls) LatestCalls
type SpyAuthenticatorData ¶
type SpyAuthenticatorData struct { Name string `json:"name"` Failure FailureFlag `json:"failure"` // bit flag representing authenticator failure }
type SpyRemoveRequest ¶
type SpyRemoveRequest struct { Account sdk.AccAddress `json:"account"` Data []byte `json:"data"` AuthenticatorId string `json:"authenticator_id"` }
type SpyTrackRequest ¶
type SpyTrackRequest struct { AuthenticatorId string `json:"authenticator_id"` Account sdk.AccAddress `json:"account"` Msg authenticator.LocalAny `json:"msg"` MsgIndex uint64 `json:"msg_index"` }
type StatefulAuthenticator ¶
type StatefulAuthenticator struct {
KvStoreKey storetypes.StoreKey
}
StatefulAuthenticator is an experiment of how to write authenticators that handle state
func (StatefulAuthenticator) Authenticate ¶
func (s StatefulAuthenticator) Authenticate(ctx sdk.Context, request authenticator.AuthenticationRequest) error
func (StatefulAuthenticator) ConfirmExecution ¶
func (s StatefulAuthenticator) ConfirmExecution(ctx sdk.Context, request authenticator.AuthenticationRequest) error
func (StatefulAuthenticator) GetValue ¶
func (s StatefulAuthenticator) GetValue(ctx sdk.Context) int
func (StatefulAuthenticator) Initialize ¶
func (s StatefulAuthenticator) Initialize(config []byte) (authenticator.Authenticator, error)
func (StatefulAuthenticator) OnAuthenticatorAdded ¶
func (s StatefulAuthenticator) OnAuthenticatorAdded(ctx sdk.Context, account sdk.AccAddress, config []byte, authenticatorId string) error
func (StatefulAuthenticator) OnAuthenticatorRemoved ¶
func (s StatefulAuthenticator) OnAuthenticatorRemoved(ctx sdk.Context, account sdk.AccAddress, config []byte, authenticatorId string) error
func (StatefulAuthenticator) SetValue ¶
func (s StatefulAuthenticator) SetValue(ctx sdk.Context, value int)
func (StatefulAuthenticator) StaticGas ¶
func (s StatefulAuthenticator) StaticGas() uint64
func (StatefulAuthenticator) Track ¶
func (s StatefulAuthenticator) Track(ctx sdk.Context, request authenticator.AuthenticationRequest) error
func (StatefulAuthenticator) Type ¶
func (s StatefulAuthenticator) Type() string
type StatefulAuthenticatorData ¶
type StatefulAuthenticatorData struct {
Value int
}
type TestingAuthenticator ¶
type TestingAuthenticator struct { Approve ApproveOn GasConsumption int BlockAddition bool BlockRemoval bool Confirm ApproveOn }
func (TestingAuthenticator) Authenticate ¶
func (t TestingAuthenticator) Authenticate(ctx sdk.Context, request authenticator.AuthenticationRequest) error
func (TestingAuthenticator) ConfirmExecution ¶
func (t TestingAuthenticator) ConfirmExecution(ctx sdk.Context, request authenticator.AuthenticationRequest) error
func (TestingAuthenticator) Initialize ¶
func (t TestingAuthenticator) Initialize(config []byte) (authenticator.Authenticator, error)
func (TestingAuthenticator) OnAuthenticatorAdded ¶
func (t TestingAuthenticator) OnAuthenticatorAdded(ctx sdk.Context, account sdk.AccAddress, config []byte, authenticatorId string) error
func (TestingAuthenticator) OnAuthenticatorRemoved ¶
func (t TestingAuthenticator) OnAuthenticatorRemoved(ctx sdk.Context, account sdk.AccAddress, config []byte, authenticatorId string) error
func (TestingAuthenticator) StaticGas ¶
func (t TestingAuthenticator) StaticGas() uint64
func (TestingAuthenticator) Track ¶
func (t TestingAuthenticator) Track(ctx sdk.Context, request authenticator.AuthenticationRequest) error
func (TestingAuthenticator) Type ¶
func (t TestingAuthenticator) Type() string
type TestingAuthenticatorData ¶
type TestingAuthenticatorData struct{}
Click to show internal directories.
Click to hide internal directories.