Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
RogerKSI committed Feb 13, 2024
1 parent d412a41 commit 78d08d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions hooks/emitter/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import (
"encoding/json"
"strings"

"github.com/bandprotocol/chain/v2/hooks/common"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/query"
"github.com/cosmos/cosmos-sdk/x/group"
proto "github.com/cosmos/gogoproto/proto"

"github.com/bandprotocol/chain/v2/hooks/common"
)

func extractStringFromEventMap(evMap common.EvMap, event string, topic string) string {
Expand Down Expand Up @@ -265,7 +266,7 @@ func (h *Hook) handleGroupEventProposalPruned(
)
proposalStatus := extractStringFromEventMap(evMap, proto.MessageName(&group.EventProposalPruned{}), "status")
tallyResult := group.DefaultTallyResult()
json.Unmarshal([]byte(evMap[proto.MessageName(&group.EventProposalPruned{})+".tally_result"][0]), &tallyResult)
_ = json.Unmarshal([]byte(evMap[proto.MessageName(&group.EventProposalPruned{})+".tally_result"][0]), &tallyResult)
h.Write("UPDATE_GROUP_PROPOSAL_BY_ID", common.JsDict{
"id": proposalId,
"status": proposalStatus,
Expand Down
2 changes: 1 addition & 1 deletion hooks/emitter/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func (h *Hook) handleBeginBlockEndBlockEvent(ctx sdk.Context, event abci.Event)
}

func splitKeyWithTime(key []byte) (proposalID uint64, endTime time.Time) {
var lenTime = len(sdk.FormatTimeBytes(time.Now()))
lenTime := len(sdk.FormatTimeBytes(time.Now()))
kv.AssertKeyLength(key[2:], 8+lenTime)

endTime, err := sdk.ParseTimeBytes(key[2 : 2+lenTime])
Expand Down

0 comments on commit 78d08d5

Please sign in to comment.