Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: block info #16

Merged
merged 1 commit into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ linters:
- ineffassign
- staticcheck
- unused
- gocognit
# - gocognit
- godox
- gocritic
- gci
Expand Down
7 changes: 5 additions & 2 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion discord/discord.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down