-
Notifications
You must be signed in to change notification settings - Fork 257
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'cosmos/v0.44.x' of https://github.com/forbole/bdjuno in…
…to chains/emoney/mainnet
- Loading branch information
Showing
111 changed files
with
1,473 additions
and
393 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,15 +15,15 @@ jobs: | |
timeout-minutes: 6 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: technote-space/[email protected].0 | ||
- uses: technote-space/[email protected].2 | ||
with: | ||
SUFFIX_FILTER: | | ||
.go | ||
.mod | ||
.sum | ||
- uses: golangci/golangci-lint-action@v3.2.0 | ||
- uses: golangci/golangci-lint-action@v3.4.0 | ||
with: | ||
version: v1.28 | ||
version: v1.50.1 | ||
args: --timeout 10m | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
if: "env.GIT_DIFF != ''" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
|
||
FROM golang:1.18-alpine AS builder | ||
RUN apk update && apk add --no-cache make git | ||
WORKDIR /go/src/github.com/forbole/bdjuno | ||
COPY . ./ | ||
|
||
RUN apk update && apk add --no-cache ca-certificates build-base git | ||
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.1.1/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a | ||
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.1.1/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a | ||
RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep 9ecb037336bd56076573dc18c26631a9d2099a7f2b40dc04b6cae31ffb4c8f9a | ||
RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep 6e4de7ba9bad4ae9679c7f9ecf7e283dd0160e71567c6a7be6ae47c81ebe7f32 | ||
## Copy the library you want to the final location that will be found by the linker flag `-lwasmvm_muslc` | ||
RUN cp /lib/libwasmvm_muslc.$(uname -m).a /lib/libwasmvm_muslc.a | ||
RUN go mod download | ||
RUN LINK_STATICALLY=true BUILD_TAGS="muslc" make build | ||
|
||
FROM alpine:latest | ||
RUN apk update && apk add --no-cache ca-certificates build-base | ||
WORKDIR /bdjuno | ||
COPY --from=builder /go/src/github.com/forbole/bdjuno/build/bdjuno /usr/bin/bdjuno | ||
CMD [ "bdjuno" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package bank | ||
|
||
import ( | ||
parsecmdtypes "github.com/forbole/juno/v3/cmd/parse/types" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
// NewBankCmd returns the Cobra command allowing to fix various things related to the x/bank module | ||
func NewBankCmd(parseConfig *parsecmdtypes.Config) *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "bank", | ||
Short: "Fix things related to the x/bank module", | ||
} | ||
|
||
cmd.AddCommand( | ||
supplyCmd(parseConfig), | ||
) | ||
|
||
return cmd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package bank | ||
|
||
import ( | ||
"fmt" | ||
|
||
modulestypes "github.com/forbole/bdjuno/v3/modules/types" | ||
|
||
parsecmdtypes "github.com/forbole/juno/v3/cmd/parse/types" | ||
"github.com/forbole/juno/v3/types/config" | ||
"github.com/spf13/cobra" | ||
|
||
"github.com/forbole/bdjuno/v3/database" | ||
"github.com/forbole/bdjuno/v3/modules/bank" | ||
) | ||
|
||
// supplyCmd returns the Cobra command allowing to refresh x/bank total supply | ||
func supplyCmd(parseConfig *parsecmdtypes.Config) *cobra.Command { | ||
return &cobra.Command{ | ||
Use: "supply", | ||
Short: "Refresh total supply", | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
parseCtx, err := parsecmdtypes.GetParserContext(config.Cfg, parseConfig) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
sources, err := modulestypes.BuildSources(config.Cfg.Node, parseCtx.EncodingConfig) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
// Get the database | ||
db := database.Cast(parseCtx.Database) | ||
|
||
// Build bank module | ||
bankModule := bank.NewModule(nil, sources.BankSource, parseCtx.EncodingConfig.Marshaler, db) | ||
|
||
err = bankModule.UpdateSupply() | ||
if err != nil { | ||
return fmt.Errorf("error while getting latest bank supply: %s", err) | ||
} | ||
|
||
return nil | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package distribution | ||
|
||
import ( | ||
parsecmdtypes "github.com/forbole/juno/v3/cmd/parse/types" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
// NewDistributionCmd returns the Cobra command allowing to fix various things related to the x/distribution module | ||
func NewDistributionCmd(parseConfig *parsecmdtypes.Config) *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "distribution", | ||
Short: "Fix things related to the x/distribution module", | ||
} | ||
|
||
cmd.AddCommand( | ||
communityPoolCmd(parseConfig), | ||
) | ||
|
||
return cmd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package distribution | ||
|
||
import ( | ||
"fmt" | ||
|
||
parsecmdtypes "github.com/forbole/juno/v3/cmd/parse/types" | ||
"github.com/forbole/juno/v3/types/config" | ||
"github.com/spf13/cobra" | ||
|
||
"github.com/forbole/bdjuno/v3/database" | ||
"github.com/forbole/bdjuno/v3/modules/distribution" | ||
modulestypes "github.com/forbole/bdjuno/v3/modules/types" | ||
) | ||
|
||
// communityPoolCmd returns the Cobra command allowing to refresh community pool | ||
func communityPoolCmd(parseConfig *parsecmdtypes.Config) *cobra.Command { | ||
return &cobra.Command{ | ||
Use: "community-pool", | ||
Short: "Refresh community pool", | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
parseCtx, err := parsecmdtypes.GetParserContext(config.Cfg, parseConfig) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
sources, err := modulestypes.BuildSources(config.Cfg.Node, parseCtx.EncodingConfig) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
// Get the database | ||
db := database.Cast(parseCtx.Database) | ||
|
||
// Build distribution module | ||
distrModule := distribution.NewModule(sources.DistrSource, parseCtx.EncodingConfig.Marshaler, db) | ||
|
||
err = distrModule.GetLatestCommunityPool() | ||
if err != nil { | ||
return fmt.Errorf("error while updating community pool: %s", err) | ||
} | ||
|
||
return nil | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package mint | ||
|
||
import ( | ||
parsecmdtypes "github.com/forbole/juno/v3/cmd/parse/types" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
// NewMintCmd returns the Cobra command allowing to fix various things related to the x/mint module | ||
func NewMintCmd(parseConfig *parsecmdtypes.Config) *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "mint", | ||
Short: "Fix things related to the x/mint module", | ||
} | ||
|
||
cmd.AddCommand( | ||
inflationCmd(parseConfig), | ||
) | ||
|
||
return cmd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package mint | ||
|
||
import ( | ||
"fmt" | ||
|
||
parsecmdtypes "github.com/forbole/juno/v3/cmd/parse/types" | ||
"github.com/forbole/juno/v3/types/config" | ||
"github.com/spf13/cobra" | ||
|
||
"github.com/forbole/bdjuno/v3/database" | ||
"github.com/forbole/bdjuno/v3/modules/mint" | ||
modulestypes "github.com/forbole/bdjuno/v3/modules/types" | ||
) | ||
|
||
// inflationCmd returns the Cobra command allowing to refresh x/mint inflation | ||
func inflationCmd(parseConfig *parsecmdtypes.Config) *cobra.Command { | ||
return &cobra.Command{ | ||
Use: "inflation", | ||
Short: "Refresh inflation", | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
parseCtx, err := parsecmdtypes.GetParserContext(config.Cfg, parseConfig) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
sources, err := modulestypes.BuildSources(config.Cfg.Node, parseCtx.EncodingConfig) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
// Get the database | ||
db := database.Cast(parseCtx.Database) | ||
|
||
// Build mint module | ||
mintModule := mint.NewModule(sources.MintSource, parseCtx.EncodingConfig.Marshaler, db) | ||
|
||
err = mintModule.UpdateInflation() | ||
if err != nil { | ||
return fmt.Errorf("error while updating inflation: %s", err) | ||
} | ||
|
||
return nil | ||
}, | ||
} | ||
} |
Oops, something went wrong.