Documentation ¶
Index ¶
- Constants
- Variables
- func EndBlock(ctx sdk.Context, k Keeper)
- func ErrInvalidSideChainId(codespace sdk.CodespaceType, msg string) sdk.Error
- func GetSideChainStorePrefixKey(sideChainId string) []byte
- func NewQuerier(k Keeper) sdk.Querier
- func ParamTypeTable() params.TypeTable
- type ChanPermissionSettingHooks
- type IbcKeeper
- type Keeper
- func (k Keeper) AscSideChainId(ctx sdk.Context) (sideChainId string)
- func (k *Keeper) CreateNewChannelToIbc(ctx sdk.Context, sideChainId sdk.ChainID, channelId sdk.ChannelID, ...) (seq uint64, sdkErr sdk.Error)
- func (k *Keeper) GetAllSideChainPrefixes(ctx sdk.Context) ([]string, [][]byte)
- func (k *Keeper) GetChannelID(channelName string) (sdk.ChannelID, error)
- func (k *Keeper) GetChannelSendPermission(ctx sdk.Context, destChainID sdk.ChainID, channelID sdk.ChannelID) sdk.ChannelPermission
- func (k *Keeper) GetChannelSendPermissions(ctx sdk.Context, destChainID sdk.ChainID) map[sdk.ChannelID]sdk.ChannelPermission
- func (k *Keeper) GetCrossChainApp(ctx sdk.Context, channelID sdk.ChannelID) sdk.CrossChainApplication
- func (k *Keeper) GetDestChainID(name string) (sdk.ChainID, error)
- func (k *Keeper) GetDestChainName(id sdk.ChainID) (string, error)
- func (k *Keeper) GetReceiveSequence(ctx sdk.Context, destChainID sdk.ChainID, channelID sdk.ChannelID) uint64
- func (k *Keeper) GetSendSequence(ctx sdk.Context, destChainID sdk.ChainID, channelID sdk.ChannelID) uint64
- func (k Keeper) GetSideChainStorePrefix(ctx sdk.Context, sideChainId string) []byte
- func (k *Keeper) GetSrcChainID() sdk.ChainID
- func (k *Keeper) IncrReceiveSequence(ctx sdk.Context, destChainID sdk.ChainID, channelID sdk.ChannelID)
- func (k *Keeper) IncrSendSequence(ctx sdk.Context, destChainID sdk.ChainID, channelID sdk.ChannelID)
- func (k *Keeper) PrepareCtxForSideChain(ctx sdk.Context, sideChainId string) (sdk.Context, error)
- func (k *Keeper) RegisterChannel(name string, id sdk.ChannelID, app sdk.CrossChainApplication) error
- func (k *Keeper) RegisterDestChain(name string, chainID sdk.ChainID) error
- func (k *Keeper) SaveChannelSettingChangeToIbc(ctx sdk.Context, sideChainId sdk.ChainID, channelId sdk.ChannelID, ...) (seq uint64, sdkErr sdk.Error)
- func (k *Keeper) SetChannelSendPermission(ctx sdk.Context, destChainID sdk.ChainID, channelID sdk.ChannelID, ...)
- func (k *Keeper) SetGovKeeper(govKeeper *gov.Keeper)
- func (k *Keeper) SetIbcKeeper(ibcKeeper IbcKeeper)
- func (k Keeper) SetParams(ctx sdk.Context, params Params)
- func (k Keeper) SetSideChainIdAndStorePrefix(ctx sdk.Context, sideChainId string, storePrefix []byte)
- func (k *Keeper) SetSrcChainID(srcChainID sdk.ChainID)
- type Params
Constants ¶
View Source
const ( SafeToleratePeriod = 2 * 7 * 24 * 60 * 60 * time.Second // 2 weeks EnableOrDisableChannelKey = "enableOrDisableChannel" AddOrUpdateChannelKey = "addOrUpdateChannel" )
View Source
const ( DefaultCodespace sdk.CodespaceType = 31 CodeInvalidSideChainId sdk.CodeType = 101 )
View Source
const DefaultParamspace = "sidechain"
Default parameter namespace
View Source
const (
QuerychannelSettings = "channelSettings"
)
Variables ¶
View Source
var ( SideChainStorePrefixByIdKey = []byte{0x01} // prefix for each key to a side chain store prefix, by side chain id PrefixForSendSequenceKey = []byte{0xf0} PrefixForReceiveSequenceKey = []byte{0xf1} PrefixForChannelPermissionKey = []byte{0xc0} )
View Source
var (
CrossChainContractAddr, _ = hex.DecodeString("0000000000000000000000000000000000002000")
)
View Source
var (
KeyAscSideChainId = []byte("AscSideChainId")
)
Functions ¶
func ErrInvalidSideChainId ¶
func ErrInvalidSideChainId(codespace sdk.CodespaceType, msg string) sdk.Error
func NewQuerier ¶
creates a querier for staking REST endpoints
Types ¶
type ChanPermissionSettingHooks ¶
type ChanPermissionSettingHooks struct {
// contains filtered or unexported fields
}
--------------------- ChanPermissionSettingHooks -----------------
func NewChanPermissionSettingHook ¶
func NewChanPermissionSettingHook(cdc *amino.Codec, keeper *Keeper) ChanPermissionSettingHooks
func (ChanPermissionSettingHooks) OnProposalSubmitted ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func (Keeper) AscSideChainId ¶ added in v0.1.4
func (*Keeper) CreateNewChannelToIbc ¶
func (*Keeper) GetAllSideChainPrefixes ¶
func (*Keeper) GetChannelID ¶
func (*Keeper) GetChannelSendPermission ¶
func (*Keeper) GetChannelSendPermissions ¶
func (*Keeper) GetCrossChainApp ¶
func (*Keeper) GetReceiveSequence ¶
func (*Keeper) GetSendSequence ¶
func (Keeper) GetSideChainStorePrefix ¶
get side chain store key prefix
func (*Keeper) GetSrcChainID ¶
func (*Keeper) IncrReceiveSequence ¶
func (*Keeper) IncrSendSequence ¶
func (*Keeper) PrepareCtxForSideChain ¶
func (*Keeper) RegisterChannel ¶
func (*Keeper) RegisterDestChain ¶
internally, we use name as the id of the chain, must be unique
func (*Keeper) SaveChannelSettingChangeToIbc ¶
func (*Keeper) SetChannelSendPermission ¶
func (*Keeper) SetGovKeeper ¶
func (*Keeper) SetIbcKeeper ¶
func (Keeper) SetSideChainIdAndStorePrefix ¶
func (k Keeper) SetSideChainIdAndStorePrefix(ctx sdk.Context, sideChainId string, storePrefix []byte)
TODO: to support multi side chains in the future. We will enable a registration mechanism and add these chain ids to db. then we need to check if the sideChainId already exists
func (*Keeper) SetSrcChainID ¶
type Params ¶
type Params struct {
AscSideChainId string `json:"asc_side_chain_id"`
}
func (*Params) KeyValuePairs ¶
func (p *Params) KeyValuePairs() params.KeyValuePairs
Implements params.ParamStruct
Source Files ¶
Click to show internal directories.
Click to hide internal directories.