Skip to content

Commit

Permalink
addressed PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
miladz68 committed Nov 28, 2023
1 parent 5b961b0 commit f2fa91c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion modules/bank/handle_msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (m *Module) updateBalanceForEventType(index int, tx *juno.Tx, eventType str
return err
}

if coin.Denom == m.govDenom {
if coin.Denom == m.baseDenom {
continue
}

Expand Down
20 changes: 11 additions & 9 deletions modules/bank/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
junomessages "github.com/forbole/juno/v5/modules/messages"

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

"github.com/CoreumFoundation/coreum/v3/pkg/config/constant"
)

var (
Expand All @@ -23,7 +25,7 @@ type Module struct {

messageParser junomessages.MessageAddressesParser
keeper source.Source
govDenom string
baseDenom string
}

// NewModule returns a new Module instance
Expand All @@ -39,7 +41,7 @@ func NewModule(
db: db,
messageParser: messageParser,
keeper: keeper,
govDenom: getGovTokenFromAddressPrefix(addressPrefix),
baseDenom: getBaseTokenFromAddressPrefix(addressPrefix),
}
}

Expand All @@ -48,14 +50,14 @@ func (m *Module) Name() string {
return "bank"
}

func getGovTokenFromAddressPrefix(addressPrefix string) string {
func getBaseTokenFromAddressPrefix(addressPrefix string) string {
switch addressPrefix {
case "core":
return "ucore"
case "testcore":
return "utestcore"
case "devcore":
return "udevcore"
case constant.AddressPrefixMain:
return constant.DenomMain
case constant.AddressPrefixTest:
return constant.DenomTest
case constant.AddressPrefixDev:
return constant.DenomDev
default:
return ""
}
Expand Down

0 comments on commit f2fa91c

Please sign in to comment.