Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
MonikaCat committed Sep 26, 2023
1 parent cd18509 commit 791bfb0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
10 changes: 8 additions & 2 deletions database/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func (db *Db) storeVestingAccount(account exported.VestingAccount) (int, error)
// Store the vesting account
err := db.SaveAccounts([]types.Account{types.NewAccount(account.GetAddress().String())})
if err != nil {
return 0, fmt.Errorf("error while storing vesting account: %s", err)
return 0, fmt.Errorf("error while storing vesting account address: %s", err)
}

var vestingAccountRowID int
Expand Down Expand Up @@ -130,7 +130,13 @@ func (db *Db) StoreBaseVestingAccountFromMsg(bva *vestingtypes.BaseVestingAccoun
start_time = excluded.start_time,
end_time = excluded.end_time`

_, err := db.SQL.Exec(stmt,
// Store the vesting account
err := db.SaveAccounts([]types.Account{types.NewAccount(bva.GetAddress().String())})
if err != nil {
return fmt.Errorf("error while storing vesting account address: %s", err)
}

_, err = db.SQL.Exec(stmt,
proto.MessageName(bva),
bva.GetAddress().String(),
pq.Array(dbtypes.NewDbCoins(bva.OriginalVesting)),
Expand Down
5 changes: 2 additions & 3 deletions modules/gov/handle_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package gov
import (
"fmt"
"strconv"
"time"

juno "github.com/forbole/juno/v5/types"

Expand All @@ -20,7 +19,7 @@ func (m *Module) HandleBlock(
b *tmctypes.ResultBlock, blockResults *tmctypes.ResultBlockResults, _ []*juno.Tx, _ *tmctypes.ResultValidators,
) error {

err := m.updateProposalsStatus(b.Block.Height, b.Block.Time, blockResults.EndBlockEvents)
err := m.updateProposalsStatus(b.Block.Height, blockResults.EndBlockEvents)
if err != nil {
log.Error().Str("module", "gov").Int64("height", b.Block.Height).
Err(err).Msg("error while updating proposals")
Expand All @@ -30,7 +29,7 @@ func (m *Module) HandleBlock(
}

// updateProposalsStatus updates the status of proposals if they have been included in the EndBlockEvents
func (m *Module) updateProposalsStatus(height int64, blockTime time.Time, events []abci.Event) error {
func (m *Module) updateProposalsStatus(height int64, events []abci.Event) error {
if len(events) == 0 {
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion modules/gov/handle_msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func (m *Module) handleMsgSubmitProposal(tx *juno.Tx, index int, msg *govtypesv1

err = m.db.SaveAccounts(addresses)
if err != nil {
return fmt.Errorf("error while storing MsgCommunityPoolSpend proposal recipient: %s", err)
return fmt.Errorf("error while storing proposal recipient: %s", err)
}

// Store the proposal
Expand Down

0 comments on commit 791bfb0

Please sign in to comment.