From 401e3510803865d39b708cb374edb609bc6d8d54 Mon Sep 17 00:00:00 2001 From: nikugogoi <95nikass@gmail.com> Date: Tue, 5 Apr 2022 19:23:49 +0530 Subject: [PATCH] fix: gql query lookupAuthorities and bond module messages (#25) --- gql/resolver.go | 2 +- init.sh | 2 +- x/bond/types/msg.go | 18 ++++++++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/gql/resolver.go b/gql/resolver.go index 63dbf209..adb0a531 100644 --- a/gql/resolver.go +++ b/gql/resolver.go @@ -47,7 +47,7 @@ func (q queryResolver) LookupAuthorities(ctx context.Context, names []string) ([ return nil, err } - if nameAuthority.AuctionId == "" { + if nameAuthority.AuctionId != "" { auctionResp, err := auctionQueryClient.GetAuction(context.Background(), &auctiontypes.AuctionRequest{Id: nameAuthority.GetAuctionId()}) if err != nil { return nil, err diff --git a/init.sh b/init.sh index de11d281..1a7c78d2 100755 --- a/init.sh +++ b/init.sh @@ -87,4 +87,4 @@ if [[ $1 == "pending" ]]; then fi # Start the node (remove the --pruning=nothing flag if historical queries are not needed) -ethermintd start --pruning=nothing --evm.tracer=json $TRACE --log_level $LOGLEVEL --minimum-gas-prices=0.0001aphoton --json-rpc.api eth,txpool,personal,net,debug,web3,miner --api.enable +ethermintd start --pruning=nothing --evm.tracer=json $TRACE --log_level $LOGLEVEL --minimum-gas-prices=0.0001aphoton --json-rpc.api eth,txpool,personal,net,debug,web3,miner --api.enable --gql-server --gql-playground diff --git a/x/bond/types/msg.go b/x/bond/types/msg.go index 84d5ec73..653d14c0 100644 --- a/x/bond/types/msg.go +++ b/x/bond/types/msg.go @@ -56,6 +56,12 @@ func NewMsgRefillBond(id string, amount sdk.Coin, signer sdk.AccAddress) MsgRefi } } +// Route Implements Msg. +func (msg MsgRefillBond) Route() string { return RouterKey } + +// Type Implements Msg. +func (msg MsgRefillBond) Type() string { return "refill" } + func (msg MsgRefillBond) ValidateBasic() error { if len(msg.Id) == 0 { return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, msg.Id) @@ -89,6 +95,12 @@ func NewMsgWithdrawBond(id string, amount sdk.Coin, signer sdk.AccAddress) MsgWi } } +// Route Implements Msg. +func (msg MsgWithdrawBond) Route() string { return RouterKey } + +// Type Implements Msg. +func (msg MsgWithdrawBond) Type() string { return "withdraw" } + func (msg MsgWithdrawBond) ValidateBasic() error { if len(msg.Id) == 0 { return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, msg.Id) @@ -121,6 +133,12 @@ func NewMsgCancelBond(id string, signer sdk.AccAddress) MsgCancelBond { } } +// Route Implements Msg. +func (msg MsgCancelBond) Route() string { return RouterKey } + +// Type Implements Msg. +func (msg MsgCancelBond) Type() string { return "cancel" } + func (msg MsgCancelBond) ValidateBasic() error { if len(msg.Id) == 0 { return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, msg.Id)