Documentation
¶
Index ¶
- func Has(fixed, toCheck FailureFlag) bool
- type ApproveOn
- type FailureFlag
- type LatestCalls
- type SpyAddRequest
- type SpyAuthenticateRequest
- type SpyAuthenticator
- func (s SpyAuthenticator) Authenticate(ctx sdk.Context, request types.AuthenticationRequest) error
- func (s SpyAuthenticator) ConfirmExecution(ctx sdk.Context, request types.AuthenticationRequest) error
- func (s SpyAuthenticator) GetLatestCalls(ctx sdk.Context) LatestCalls
- func (s SpyAuthenticator) Initialize(config []byte) (types.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 types.AuthenticationRequest) error
- func (s SpyAuthenticator) Type() string
- func (s SpyAuthenticator) UpdateLatestCalls(ctx sdk.Context, f func(calls LatestCalls) LatestCalls) LatestCalls
- type SpyAuthenticatorData
- type SpyConfirmExecutionRequest
- type SpyRemoveRequest
- type SpyTrackRequest
- type TestingAuthenticator
- func (t TestingAuthenticator) Authenticate(ctx sdk.Context, request types.AuthenticationRequest) error
- func (t TestingAuthenticator) ConfirmExecution(ctx sdk.Context, request types.AuthenticationRequest) error
- func (t TestingAuthenticator) Initialize(config []byte) (types.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 types.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 SpyAuthenticateRequest
Track SpyTrackRequest
ConfirmExecution SpyConfirmExecutionRequest
OnAuthenticatorAdded SpyAddRequest
OnAuthenticatorRemoved SpyRemoveRequest
}
type SpyAddRequest ¶
type SpyAddRequest struct {
Account sdk.AccAddress `json:"account"`
Data []byte `json:"data"`
AuthenticatorId string `json:"authenticator_id"`
}
type SpyAuthenticateRequest ¶
type SpyAuthenticateRequest struct {
AuthenticatorId string `json:"authenticator_id"`
Account sdk.AccAddress `json:"account"`
Msg []byte `json:"msg"`
MsgIndex uint64 `json:"msg_index"`
}
type SpyAuthenticator ¶
type SpyAuthenticator struct {
KvStoreKey storetypes.StoreKey
Name string
Failure FailureFlag
Cdc codec.BinaryCodec
}
SpyAuthenticator tracks latest call and can be used to test the authenticator
func NewSpyAuthenticator ¶
func NewSpyAuthenticator(cdc codec.BinaryCodec, kvStoreKey storetypes.StoreKey) SpyAuthenticator
func (SpyAuthenticator) Authenticate ¶
func (s SpyAuthenticator) Authenticate(ctx sdk.Context, request types.AuthenticationRequest) error
func (SpyAuthenticator) ConfirmExecution ¶
func (s SpyAuthenticator) ConfirmExecution(ctx sdk.Context, request types.AuthenticationRequest) error
func (SpyAuthenticator) GetLatestCalls ¶
func (s SpyAuthenticator) GetLatestCalls(ctx sdk.Context) LatestCalls
func (SpyAuthenticator) Initialize ¶
func (s SpyAuthenticator) Initialize(config []byte) (types.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 types.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 SpyConfirmExecutionRequest ¶
type SpyConfirmExecutionRequest struct {
AuthenticatorId string `json:"authenticator_id"`
Account sdk.AccAddress `json:"account"`
Msg []byte `json:"msg"`
MsgIndex uint64 `json:"msg_index"`
}
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 []byte `json:"msg"`
MsgIndex uint64 `json:"msg_index"`
}
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 types.AuthenticationRequest) error
func (TestingAuthenticator) ConfirmExecution ¶
func (t TestingAuthenticator) ConfirmExecution(ctx sdk.Context, request types.AuthenticationRequest) error
func (TestingAuthenticator) Initialize ¶
func (t TestingAuthenticator) Initialize(config []byte) (types.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 types.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.