-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into update-main-doc
- Loading branch information
Showing
14 changed files
with
666 additions
and
788 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: golangci-lint | ||
on: | ||
push: | ||
tags: | ||
- v* | ||
branches: | ||
- master | ||
- main | ||
pull_request: | ||
permissions: | ||
contents: read | ||
# Optional: allow read access to pull request. Use with `only-new-issues` option. | ||
# pull-requests: read | ||
jobs: | ||
golangci: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.19 | ||
- uses: actions/checkout@v3 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version | ||
version: latest |
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,33 @@ | ||
package app | ||
|
||
import ( | ||
"github.com/BitCannaGlobal/bcna/app/params" | ||
"github.com/cosmos/cosmos-sdk/codec" | ||
"github.com/cosmos/cosmos-sdk/codec/types" | ||
"github.com/cosmos/cosmos-sdk/std" | ||
"github.com/cosmos/cosmos-sdk/x/auth/tx" | ||
) | ||
|
||
// makeEncodingConfig creates an EncodingConfig for an amino based test configuration. | ||
func makeEncodingConfig() params.EncodingConfig { | ||
amino := codec.NewLegacyAmino() | ||
interfaceRegistry := types.NewInterfaceRegistry() | ||
marshaler := codec.NewProtoCodec(interfaceRegistry) | ||
txCfg := tx.NewTxConfig(marshaler, tx.DefaultSignModes) | ||
return params.EncodingConfig{ | ||
InterfaceRegistry: interfaceRegistry, | ||
Marshaler: marshaler, | ||
TxConfig: txCfg, | ||
Amino: amino, | ||
} | ||
} | ||
|
||
// MakeEncodingConfig creates an EncodingConfig for testing | ||
func MakeEncodingConfig() params.EncodingConfig { | ||
encodingConfig := makeEncodingConfig() | ||
std.RegisterLegacyAminoCodec(encodingConfig.Amino) | ||
std.RegisterInterfaces(encodingConfig.InterfaceRegistry) | ||
ModuleBasics.RegisterLegacyAminoCodec(encodingConfig.Amino) | ||
ModuleBasics.RegisterInterfaces(encodingConfig.InterfaceRegistry) | ||
return encodingConfig | ||
} |
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,26 @@ | ||
package params | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
) | ||
|
||
// AccountAddressPrefix defines the Paloma network's Bech32 address prefix. | ||
const AccountAddressPrefix = "bcna" | ||
|
||
// Account specific Bech32 prefixes. | ||
var ( | ||
AccountPubKeyPrefix = AccountAddressPrefix + "pub" | ||
ValidatorAddressPrefix = AccountAddressPrefix + "valoper" | ||
ValidatorPubKeyPrefix = AccountAddressPrefix + "valoperpub" | ||
ConsNodeAddressPrefix = AccountAddressPrefix + "valcons" | ||
ConsNodePubKeyPrefix = AccountAddressPrefix + "valconspub" | ||
) | ||
|
||
// SetAddressConfig sets Paloma's address configuration. | ||
func SetAddressConfig() { | ||
config := sdk.GetConfig() | ||
config.SetBech32PrefixForAccount(AccountAddressPrefix, AccountPubKeyPrefix) | ||
config.SetBech32PrefixForValidator(ValidatorAddressPrefix, ValidatorPubKeyPrefix) | ||
config.SetBech32PrefixForConsensusNode(ConsNodeAddressPrefix, ConsNodePubKeyPrefix) | ||
config.Seal() | ||
} |
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,16 @@ | ||
package params | ||
|
||
import ( | ||
"github.com/cosmos/cosmos-sdk/client" | ||
"github.com/cosmos/cosmos-sdk/codec" | ||
"github.com/cosmos/cosmos-sdk/codec/types" | ||
) | ||
|
||
// EncodingConfig specifies the concrete encoding types to use for a given app. | ||
// This is provided for compatibility between protobuf and amino implementations. | ||
type EncodingConfig struct { | ||
InterfaceRegistry types.InterfaceRegistry | ||
Marshaler codec.Codec | ||
TxConfig client.TxConfig | ||
Amino *codec.LegacyAmino | ||
} |
Oops, something went wrong.