package executor

import (
	brokertypes "github.com/33cn/plugin/plugin/dapp/broker/types"
)

//获取innterMeta
func (b *broker) Query_QueryInnerMeta(query *brokertypes.QueryInnerMeta) (*brokertypes.Meta, error) {
	return getInnerMeta(b.GetStateDB())
}

//获取outterMeta
func (b *broker) Query_QueryOutterMeta(query *brokertypes.QueryOutterMeta) (*brokertypes.Meta, error) {
	return getOutterMeta(b.GetStateDB())
}

//获取callBackMeta
func (b *broker) Query_QueryCallBackMeta(query *brokertypes.QueryNilParam) (*brokertypes.Meta, error) {
	return getCallBackMeta(b.GetStateDB())
}

//获取inMessage
func (b *broker) Query_QueryInMessage(query *brokertypes.QueryInMessage) (*brokertypes.Response, error) {
	return getInMessage(b.GetStateDB(), query)
}

//获取outMessage
func (b *broker) Query_QueryOutMessage(query *brokertypes.QueryOutMessage) (*brokertypes.InterchainEvent, error) {
	return getOutMessage(b.GetStateDB(), query)
}

//获取监听列表
func (b *broker) Query_PollingEvent(query *brokertypes.PollingEvent) (*brokertypes.InterChainEventList, error) {
	return pollInterEvent(b.GetStateDB(), query.Meta)
}

//get bitxhub  and chainID
func (b *broker) Query_GetBrokerInfo(query *brokertypes.QueryNilParam) (*brokertypes.BrokerInfo, error) {
	return getBrokerInfo(b.GetStateDB())
}
