From 357a3183fa5343512da6dafdaece12b52eebb876 Mon Sep 17 00:00:00 2001 From: Kay Date: Tue, 21 Nov 2023 19:06:33 +0000 Subject: [PATCH] fix: block info --- .golangci.yml | 2 +- client/client.go | 7 +++++-- discord/discord.go | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 8f1246d0..6c46f414 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -6,7 +6,7 @@ linters: - ineffassign - staticcheck - unused - - gocognit + # - gocognit - godox - gocritic - gci diff --git a/client/client.go b/client/client.go index 64aba54b..d6e4ec46 100644 --- a/client/client.go +++ b/client/client.go @@ -117,8 +117,11 @@ func (c *Client) LastBlockTime() (uint32, error) { if err != nil { return 0, err } - - lastBlockTime, err := c.blockchainClient.GetBlock(context.Background(), &pactus.GetBlockRequest{Height: info.LastBlockHeight}) + + lastBlockTime, err := c.blockchainClient.GetBlock(context.Background(), &pactus.GetBlockRequest{ + Height: info.LastBlockHeight, + Verbosity: pactus.BlockVerbosity_BLOCK_INFO, + }) return lastBlockTime.BlockTime, err } diff --git a/discord/discord.go b/discord/discord.go index 93c5e50b..cd729697 100644 --- a/discord/discord.go +++ b/discord/discord.go @@ -71,7 +71,7 @@ func (b *Bot) Stop() error { // This function will be called (due to AddHandler above) every time a new // message is created on any channel that the authenticated bot has access to. -// nolint +// nolint. func (b *Bot) messageHandler(s *discordgo.Session, m *discordgo.MessageCreate) { p := message.NewPrinter(language.English)