Skip to content

Commit

Permalink
Update configs for new reqs for sdk v0.50 address codec, apply new si…
Browse files Browse the repository at this point in the history
…gners get method to tx processor. Bump lens to latest
  • Loading branch information
pharr117 committed Sep 29, 2024
1 parent cd3d0e4 commit 63babdc
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 10 deletions.
1 change: 1 addition & 0 deletions config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ rpc-retry-max-wait=30 #RPC query failure backoff max wait time in seconds
[lens]
rpc = "https://rpc.kujira.ccvalidators.com:443" #On Kujira use one of the endpoints from the list https://github.com/Team-Kujira/networks/tree/master/mainnet
account-prefix = "kujira"
validator-account-prefix="kujiravaloper"
chain-id = "kaiyo-1"
chain-name = "Kujira"

Expand Down
15 changes: 10 additions & 5 deletions config/common_configs.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ type Database struct {
}

type lens struct {
RPC string
AccountPrefix string `mapstructure:"account-prefix"`
ChainID string `mapstructure:"chain-id"`
ChainName string `mapstructure:"chain-name"`
RPC string
AccountPrefix string `mapstructure:"account-prefix"`
ValidatorAccountPrefix string `mapstructure:"validator-account-prefix"`
ChainID string `mapstructure:"chain-id"`
ChainName string `mapstructure:"chain-name"`
}

type throttlingBase struct {
Expand Down Expand Up @@ -59,7 +60,8 @@ func SetupDatabaseFlags(databaseConf *Database, cmd *cobra.Command) {

func SetupLensFlags(lensConf *lens, cmd *cobra.Command) {
cmd.PersistentFlags().StringVar(&lensConf.RPC, "lens.rpc", "", "node rpc endpoint")
cmd.PersistentFlags().StringVar(&lensConf.AccountPrefix, "lens.account-prefix", "", "lens account prefix")
cmd.PersistentFlags().StringVar(&lensConf.AccountPrefix, "lens.account-prefix", "osmo", "lens account prefix")
cmd.PersistentFlags().StringVar(&lensConf.ValidatorAccountPrefix, "lens.validator-account-prefix", "osmovaloper", "lens validator account prefix")
cmd.PersistentFlags().StringVar(&lensConf.ChainID, "lens.chain-id", "", "lens chain ID")
cmd.PersistentFlags().StringVar(&lensConf.ChainName, "lens.chain-name", "", "lens chain name")
}
Expand Down Expand Up @@ -104,6 +106,9 @@ func validateLensConf(lensConf lens) (lens, error) {
if util.StrNotSet(lensConf.AccountPrefix) {
return lensConf, errors.New("lens account-prefix must be set")
}
if util.StrNotSet(lensConf.ValidatorAccountPrefix) {
return lensConf, errors.New("lens validator-account-prefix must be set")
}
if util.StrNotSet(lensConf.ChainID) {
return lensConf, errors.New("lens chain-id must be set")
}
Expand Down
12 changes: 10 additions & 2 deletions core/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,11 @@ func ProcessRPCBlockByHeightTXs(db *gorm.DB, cl *client.ChainClient, blockResult
}

indexerTx.AuthInfo = *txFull.AuthInfo
txSigners, _, _ := txFull.GetSigners(cl.Codec.Marshaler)
txSigners, _, err := txFull.GetSigners(cl.Codec.Marshaler)

Check failure on line 356 in core/tx.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gofumpt`-ed (gofumpt)
if err != nil {
return nil, blockTime, fmt.Errorf("error getting signers: %v", err)
}

for _, signer := range txSigners {
indexerTx.Signers = append(indexerTx.Signers, signer)
Expand Down Expand Up @@ -441,7 +445,11 @@ func ProcessRPCTXs(db *gorm.DB, cl *client.ChainClient, txEventResp *cosmosTx.Ge
}

indexerTx.AuthInfo = *currTx.AuthInfo
txSigners, _, _ := currTx.GetSigners(cl.Codec.Marshaler)
txSigners, _, err := currTx.GetSigners(cl.Codec.Marshaler)

Check failure on line 449 in core/tx.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gofumpt`-ed (gofumpt)
if err != nil {
return nil, blockTime, fmt.Errorf("error getting signers: %v", err)
}

for _, signer := range txSigners {
indexerTx.Signers = append(indexerTx.Signers, signer)
Expand Down
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ toolchain go1.22.7
require (
github.com/BurntSushi/toml v1.4.0
// Our lens library is pinned to this specific SHA and branch: 2ff2d8138af66fb3f3e3429b9837db1e720ed39f, https://github.com/DefiantLabs/lens/tree/v0.0.22-dl
github.com/DefiantLabs/lens v0.3.1-0.20240627235205-2ff2d8138af6
github.com/DefiantLabs/lens v0.3.1-0.20240929192656-26da6febf56c
github.com/cosmos/cosmos-sdk v0.50.9
github.com/gin-gonic/gin v1.9.1
github.com/go-co-op/gocron v1.13.0
Expand Down Expand Up @@ -295,5 +295,3 @@ replace (
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
)

replace github.com/DefiantLabs/lens => /home/piiohpii/go_code/github.com/DefiantLabs/lens
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@ github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dX
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ=
github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw=
github.com/DefiantLabs/lens v0.3.1-0.20240929192656-26da6febf56c h1:UI8cFhJXCEVm5CN5UyF0dy6N4/DbVowTmd8E28OfWA8=
github.com/DefiantLabs/lens v0.3.1-0.20240929192656-26da6febf56c/go.mod h1:heKBXfKSdsPKxjgruJchLByuCtSSlnn281nhCvrZ/VI=
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc=
github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE=
Expand Down

0 comments on commit 63babdc

Please sign in to comment.