Compare commits

...
16 Commits
Author SHA1 Message Date
anilCSE 984db173f0 fix lint 2022-09-06 22:30:47 +05:30
anilCSE 89b64fffef update golang-ci-action version 2022-09-06 22:22:16 +05:30
anilCSE 05a3eec1d6 fix linters 2022-09-06 22:17:11 +05:30
anilCSE c236863bad update readme 2022-09-06 19:31:52 +05:30
A. F. Dudley 680d585084 Delete dependabot.yml
add back later.
2022-08-31 06:51:55 -04:00
Ian Norden 17480f2716 Merge pull request #60 from vulcanize/murali/to_ipld_prime
feat: use ipld-prime in helpers
2022-08-29 14:04:12 -05:00
SpideyPool192 e8b3ca8cae use ipdl prime in 'helpers.go/GetCid' 2022-08-18 15:02:53 +05:30
erikdies 15c09c0157 Merge pull request #59 from sjors-lemniscap/main
Update documentation for chibaclonk_81337-4
2022-08-14 16:15:38 -04:00
sjors-lemniscap 5c495e4edb Update documentation for chibaclonk_81337-4 2022-08-14 18:56:55 +02:00
Sai Kumar 79078fdf7b Merge pull request #57 from sjors-lemniscap/main
update docs for chibaclonk_81337-3
2022-08-05 10:43:52 +05:30
sjors-lemniscap f9bc170fb8 Resolve comment for PR #57 2022-08-04 19:07:56 +02:00
sjors-lemniscap 35888ad0bf update docs for chibaclonk_81337-3 2022-08-03 19:51:28 +02:00
Sai Kumar 659e771780 Merge pull request #53 from vulcanize/sai/update_testnet_docs
update testnet docs
2022-07-06 18:50:20 +05:30
Sai Kumar 16936d3315 chore: update docs for testnet2 2022-07-06 18:49:27 +05:30
Sai Kumar 0fd0b284d6 Merge pull request #52 from vulcanize/sai/update_testnet_docs
update the chain-id for testnet2
2022-07-06 10:14:42 +05:30
Sai Kumar b38c7f3ec7 chore: update the chain-id for testnet2 2022-07-06 10:13:58 +05:30
54 changed files with 272 additions and 315 deletions
-28
View File
@@ -1,28 +0,0 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
time: "10:00"
open-pull-requests-limit: 10
reviewers:
- fedekunze
- khoslaventures
labels:
- dependencies
- package-ecosystem: docker
directory: "/"
schedule:
interval: daily
time: "10:00"
open-pull-requests-limit: 10
reviewers:
- fedekunze
- khoslaventures
- package-ecosystem: gomod
directory: "/"
schedule:
interval: daily
time: "10:00"
open-pull-requests-limit: 10
+54 -8
View File
@@ -13,18 +13,64 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 10 timeout-minutes: 10
steps: steps:
- uses: actions/setup-go@v3
with:
go-version: 1.18
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6.0.1 - uses: technote-space/get-diff-action@v6.1.0
with: with:
SUFFIX_FILTER: | PATTERNS: |
.go **/**.go
.mod go.mod
.sum go.sum
- uses: golangci/golangci-lint-action@v2.5.2 - uses: golangci/golangci-lint-action@v3
with: with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. version: v1.48.0
version: v1.42.1
args: --timeout 10m args: --timeout 10m
github-token: ${{ secrets.github_token }} github-token: ${{ secrets.github_token }}
# Check only if there are differences in the source code # Check only if there are differences in the source code
if: "env.GIT_DIFF" if: "env.GIT_DIFF"
markdown-lint:
name: Run markdown-lint
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6.1.0
with:
PATTERNS: |
docs/**/*.md
x/**/*.md
README.md
- uses: articulate/actions-markdownlint@v1.1.0
# Check only if there are differences in the source code
if: env.GIT_DIFF
python-lint:
name: Run flake8 on python integration tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v17
- uses: cachix/cachix-action@v10
with:
name: ethermint
- uses: technote-space/get-diff-action@v6.1.0
with:
PATTERNS: |
**/**.py
- run: |
nix-shell -I nixpkgs=./nix -p test-env --run "make lint-py"
if: env.GIT_DIFF
gomod2nix:
name: Check gomod2nix.toml file is up to date
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
- uses: cachix/install-nix-action@v17
- uses: cachix/cachix-action@v10
with:
name: ethermint
- name: run gomod2nix
run: |
nix run -f ./nix gomod2nix
git diff --no-ext-diff --exit-code
+8 -14
View File
@@ -13,38 +13,30 @@ linters:
- errcheck - errcheck
- goconst - goconst
- gocritic - gocritic
- gofmt - gofumpt
- goimports
- revive - revive
- gosec - gosec
- gosimple - gosimple
- govet - govet
- ineffassign - ineffassign
# - lll TODO: enable - lll
- misspell - misspell
- nakedret - nakedret
- prealloc - prealloc
- exportloopref - exportloopref
- staticcheck - staticcheck
- structcheck
- stylecheck - stylecheck
# - typecheck #TODO: enable - typecheck
- unconvert - unconvert
- unparam - unparam
- unused - unused
- varcheck - varcheck
- nolintlint - nolintlint
- asciicheck - asciicheck
# - exhaustive
- exportloopref - exportloopref
- gofumpt - gofumpt
- gomodguard - gomodguard
# - nestif - whitespace
# - nlreturn
- noctx
- rowserrcheck
# - whitespace
# - wsl
issues: issues:
exclude-rules: exclude-rules:
@@ -57,6 +49,8 @@ issues:
max-same-issues: 50 max-same-issues: 50
linters-settings: linters-settings:
lll:
line-length: 150
dogsled: dogsled:
max-blank-identifiers: 3 max-blank-identifiers: 3
golint: golint:
@@ -71,7 +65,7 @@ linters-settings:
require-explanation: false require-explanation: false
require-specific: false require-specific: false
gofumpt: gofumpt:
lang-version: "1.17" lang-version: "1.18"
gomodguard: gomodguard:
blocked: blocked:
versions: # List of blocked module version constraints versions: # List of blocked module version constraints
@@ -80,4 +74,4 @@ linters-settings:
reason: "CVE-2020-15114; CVE-2020-15136; CVE-2020-15115" # Reason why the version constraint exists. (Optional) reason: "CVE-2020-15114; CVE-2020-15136; CVE-2020-15115" # Reason why the version constraint exists. (Optional)
- https://github.com/dgrijalva/jwt-go: # Blocked module with version constraint - https://github.com/dgrijalva/jwt-go: # Blocked module with version constraint
version: ">= 4.0.0-preview1" # Version constraint, see https://github.com/Masterminds/semver#basic-comparisons version: ">= 4.0.0-preview1" # Version constraint, see https://github.com/Masterminds/semver#basic-comparisons
reason: "CVE-2020-26160" # Reason why the version constraint exists. (Optional) reason: "CVE-2020-26160" # Reason why the version constraint exists. (Optional)
+6 -59
View File
@@ -1,78 +1,25 @@
<!-- # Laconic Network
parent: The Source of Proof. Laconic is a next generation data availability & verifiability layer with cryptographic proofs, powering internet-scale Web3 applications, built on Proof-of-Stake with fast-finality using the [Cosmos SDK](https://github.com/cosmos/cosmos-sdk/) which runs on top of [Tendermint Core](https://github.com/tendermint/tendermint) consensus engine.
order: false
-->
<div align="center">
<h1> Ethermint </h1>
</div>
![banner](docs/ethermint.jpg)
<div align="center">
<a href="https://github.com/tharsis/ethermint/releases/latest">
<img alt="Version" src="https://img.shields.io/github/tag/tharsis/ethermint.svg" />
</a>
<a href="https://github.com/tharsis/ethermint/blob/main/LICENSE">
<img alt="License: Apache-2.0" src="https://img.shields.io/github/license/tharsis/ethermint.svg" />
</a>
<a href="https://pkg.go.dev/github.com/tharsis/ethermint">
<img alt="GoDoc" src="https://godoc.org/github.com/tharsis/ethermint?status.svg" />
</a>
<a href="https://goreportcard.com/report/github.com/tharsis/ethermint">
<img alt="Go report card" src="https://goreportcard.com/badge/github.com/tharsis/ethermint"/>
</a>
<a href="https://bestpractices.coreinfrastructure.org/projects/5018">
<img alt="Lines of code" src="https://img.shields.io/tokei/lines/github/tharsis/ethermint">
</a>
</div>
<div align="center">
<a href="https://discord.gg/trje9XuAmy">
<img alt="Discord" src="https://img.shields.io/discord/809048090249134080.svg" />
</a>
<a href="https://github.com/tharsis/ethermint/actions?query=branch%3Amain+workflow%3ALint">
<img alt="Lint Status" src="https://github.com/tharsis/ethermint/actions/workflows/lint.yml/badge.svg?branch=main" />
</a>
<a href="https://codecov.io/gh/tharsis/ethermint">
<img alt="Code Coverage" src="https://codecov.io/gh/tharsis/ethermint/branch/main/graph/badge.svg" />
</a>
</div>
Ethermint is a scalable and interoperable Ethereum library, built on Proof-of-Stake with fast-finality using the [Cosmos SDK](https://github.com/cosmos/cosmos-sdk/) which runs on top of [Tendermint Core](https://github.com/tendermint/tendermint) consensus engine.
**Note**: Requires [Go 1.17+](https://golang.org/dl/) **Note**: Requires [Go 1.17+](https://golang.org/dl/)
## Installation ## Installation
For prerequisites and detailed build instructions please read the Evmos [Installation](https://evmos.dev/quickstart/installation.html) instructions. Once the dependencies are installed, run:
```bash ```bash
make install make install
``` ```
Or check out the latest [release](https://github.com/tharsis/ethermint/releases).
## Quick Start
To learn how the Ethermint works from a high-level perspective, go to the [Introduction](https://evmos.dev/intro/overview.html) section from the documentation. You can also check the instructions to [Run a Node](https://evmos.dev/quickstart/run_node.html).
For an example on how Ethermint can be used on any Cosmos-SDK chain, please refer to [Evmos](https://www.github.com/tharsis/evmos).
## Community ## Community
The following chat channels and forums are a great spot to ask questions about Ethermint: The following chat channels and forums are a great spot to ask questions about Ethermint:
- [Evmos Twitter](https://twitter.com/EvmosOrg) - [Laconic Twitter](https://twitter.com/laconicnetwork)
- [Evmos Discord](https://discord.gg/trje9XuAmy) - [Discord](https://discord.com/invite/ukhbBemyxY)
- [Evmos Telegram](https://t.me/EvmosOrg) - [Website](https://laconic.com)
- [Tharsis Twitter](https://twitter.com/TharsisHQ)
## Contributing ## Contributing
Looking for a good place to start contributing? Check out some [`good first issues`](https://github.com/tharsis/ethermint/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22). Looking for a good place to start contributing? Check out some [`good first issues`](https://github.com/cerc-io/laconicd/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22).
For additional instructions, standards and style guides, please refer to the [Contributing](./CONTRIBUTING.md) document. For additional instructions, standards and style guides, please refer to the [Contributing](./CONTRIBUTING.md) document.
## Careers
See our open positions on [Cosmos Jobs](https://jobs.cosmos.network/project/evmos-d0sk1uxuh-remote/), [Notion](https://tharsis.notion.site), or feel free to [reach out](mailto:careers@thars.is) via email.
-1
View File
@@ -126,7 +126,6 @@ func (avd EthAccountVerificationDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx
if err := evmkeeper.CheckSenderBalance(sdk.NewIntFromBigInt(acct.Balance), txData); err != nil { if err := evmkeeper.CheckSenderBalance(sdk.NewIntFromBigInt(acct.Balance), txData); err != nil {
return ctx, sdkerrors.Wrap(err, "failed to check sender balance") return ctx, sdkerrors.Wrap(err, "failed to check sender balance")
} }
} }
return next(ctx, tx, simulate) return next(ctx, tx, simulate)
} }
+4 -3
View File
@@ -156,8 +156,10 @@ var (
mint.AppModuleBasic{}, mint.AppModuleBasic{},
distr.AppModuleBasic{}, distr.AppModuleBasic{},
gov.NewAppModuleBasic( gov.NewAppModuleBasic(
[]govclient.ProposalHandler{paramsclient.ProposalHandler, distrclient.ProposalHandler, upgradeclient.LegacyProposalHandler, upgradeclient.LegacyCancelProposalHandler, []govclient.ProposalHandler{
ibcclientclient.UpdateClientProposalHandler, ibcclientclient.UpgradeProposalHandler}, paramsclient.ProposalHandler, distrclient.ProposalHandler, upgradeclient.LegacyProposalHandler, upgradeclient.LegacyCancelProposalHandler,
ibcclientclient.UpdateClientProposalHandler, ibcclientclient.UpgradeProposalHandler,
},
), ),
params.AppModuleBasic{}, params.AppModuleBasic{},
crisis.AppModuleBasic{}, crisis.AppModuleBasic{},
@@ -491,7 +493,6 @@ func NewEthermintApp(
transferModule := transfer.NewAppModule(app.TransferKeeper) transferModule := transfer.NewAppModule(app.TransferKeeper)
transferIBCModule := transfer.NewIBCModule(app.TransferKeeper) transferIBCModule := transfer.NewIBCModule(app.TransferKeeper)
//Create static IBC router, add transfer route, then set and seal it
ibcRouter := porttypes.NewRouter() ibcRouter := porttypes.NewRouter()
ibcRouter.AddRoute(ibctransfertypes.ModuleName, transferIBCModule) ibcRouter.AddRoute(ibctransfertypes.ModuleName, transferIBCModule)
app.IBCKeeper.SetRouter(ibcRouter) app.IBCKeeper.SetRouter(ibcRouter)
+2 -3
View File
@@ -121,7 +121,6 @@ func NewTestAppWithCustomOptions(t *testing.T, isCheckTx bool, options SetupOpti
// Setup initializes a new EthermintApp. A Nop logger is set in EthermintApp. // Setup initializes a new EthermintApp. A Nop logger is set in EthermintApp.
func Setup(t *testing.T, isCheckTx bool, patchGenesis func(*EthermintApp, simapp.GenesisState) simapp.GenesisState) *EthermintApp { func Setup(t *testing.T, isCheckTx bool, patchGenesis func(*EthermintApp, simapp.GenesisState) simapp.GenesisState) *EthermintApp {
t.Helper() t.Helper()
privVal := mock.NewPV() privVal := mock.NewPV()
@@ -202,7 +201,8 @@ func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, patchGen
} }
func genesisStateWithValSet(t *testing.T, app *EthermintApp, genesisState simapp.GenesisState, func genesisStateWithValSet(t *testing.T, app *EthermintApp, genesisState simapp.GenesisState,
valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance) simapp.GenesisState { valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance,
) simapp.GenesisState {
// set genesis accounts // set genesis accounts
authGenesis := authtypes.NewGenesisState(authtypes.DefaultParams(), genAccs) authGenesis := authtypes.NewGenesisState(authtypes.DefaultParams(), genAccs)
genesisState[authtypes.ModuleName] = app.AppCodec().MustMarshalJSON(authGenesis) genesisState[authtypes.ModuleName] = app.AppCodec().MustMarshalJSON(authGenesis)
@@ -232,7 +232,6 @@ func genesisStateWithValSet(t *testing.T, app *EthermintApp, genesisState simapp
} }
validators = append(validators, validator) validators = append(validators, validator)
delegations = append(delegations, stakingtypes.NewDelegation(genAccs[0].GetAddress(), val.Address.Bytes(), sdk.OneDec())) delegations = append(delegations, stakingtypes.NewDelegation(genAccs[0].GetAddress(), val.Address.Bytes(), sdk.OneDec()))
} }
// set validators and delegations // set validators and delegations
stakingGenesis := stakingtypes.NewGenesisState(stakingtypes.DefaultParams(), validators, delegations) stakingGenesis := stakingtypes.NewGenesisState(stakingtypes.DefaultParams(), validators, delegations)
+1 -1
View File
@@ -40,7 +40,7 @@ func SetBech32Prefixes(config *sdk.Config) {
func SetBip44CoinType(config *sdk.Config) { func SetBip44CoinType(config *sdk.Config) {
config.SetCoinType(ethermint.Bip44CoinType) config.SetCoinType(ethermint.Bip44CoinType)
config.SetPurpose(sdk.Purpose) // Shared config.SetPurpose(sdk.Purpose) // Shared
config.SetFullFundraiserPath(ethermint.BIP44HDPath) // nolint: staticcheck config.SetFullFundraiserPath(ethermint.BIP44HDPath) //nolint: staticcheck
} }
// RegisterDenoms registers the base and display denominations to the SDK. // RegisterDenoms registers the base and display denominations to the SDK.
-1
View File
@@ -309,7 +309,6 @@ func traverseFields(
} }
if fieldType.Kind() == reflect.Struct { if fieldType.Kind() == reflect.Struct {
var fieldTypedef string var fieldTypedef string
if isCollection { if isCollection {
-2
View File
@@ -125,7 +125,6 @@ func (q queryResolver) QueryRecords(ctx context.Context, attributes []*KeyValueI
All: (all != nil && *all), All: (all != nil && *all),
}, },
) )
if err != nil { if err != nil {
return nil, err return nil, err
} }
@@ -142,7 +141,6 @@ func (q queryResolver) QueryRecords(ctx context.Context, attributes []*KeyValueI
} }
return gqlResponse, nil return gqlResponse, nil
} }
func (q queryResolver) GetRecordsByIds(ctx context.Context, ids []string) ([]*Record, error) { func (q queryResolver) GetRecordsByIds(ctx context.Context, ids []string) ([]*Record, error) {
+2 -1
View File
@@ -2,12 +2,13 @@ package gql
import ( import (
"fmt" "fmt"
"net/http"
"github.com/99designs/gqlgen/graphql/handler" "github.com/99designs/gqlgen/graphql/handler"
"github.com/99designs/gqlgen/graphql/playground" "github.com/99designs/gqlgen/graphql/playground"
"github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/spf13/viper" "github.com/spf13/viper"
"net/http"
) )
// Server configures and starts the GQL server. // Server configures and starts the GQL server.
+1
View File
@@ -38,6 +38,7 @@ func getGQLCoins(coins sdk.Coins) []*Coin {
return gqlCoins return gqlCoins
} }
func GetGQLNameAuthorityRecord(record *nstypes.NameAuthority) (*AuthorityRecord, error) { func GetGQLNameAuthorityRecord(record *nstypes.NameAuthority) (*AuthorityRecord, error) {
if record == nil { if record == nil {
return nil, nil return nil, nil
-1
View File
@@ -55,7 +55,6 @@ func (e *EVMBackend) SetTxDefaults(args evmtypes.TransactionArgs) (evmtypes.Tran
if args.MaxFeePerGas.ToInt().Cmp(args.MaxPriorityFeePerGas.ToInt()) < 0 { if args.MaxFeePerGas.ToInt().Cmp(args.MaxPriorityFeePerGas.ToInt()) < 0 {
return args, fmt.Errorf("maxFeePerGas (%v) < maxPriorityFeePerGas (%v)", args.MaxFeePerGas, args.MaxPriorityFeePerGas) return args, fmt.Errorf("maxFeePerGas (%v) < maxPriorityFeePerGas (%v)", args.MaxFeePerGas, args.MaxPriorityFeePerGas)
} }
} else { } else {
if args.MaxFeePerGas != nil || args.MaxPriorityFeePerGas != nil { if args.MaxFeePerGas != nil || args.MaxPriorityFeePerGas != nil {
return args, errors.New("maxFeePerGas or maxPriorityFeePerGas specified but london is not active yet") return args, errors.New("maxFeePerGas or maxPriorityFeePerGas specified but london is not active yet")
+1 -1
View File
@@ -284,7 +284,7 @@ func (a *API) BlockProfile(file string, nsec uint) error {
// CpuProfile turns on CPU profiling for nsec seconds and writes // CpuProfile turns on CPU profiling for nsec seconds and writes
// profile data to file. // profile data to file.
func (a *API) CpuProfile(file string, nsec uint) error { // nolint: golint, stylecheck, revive func (a *API) CpuProfile(file string, nsec uint) error { //nolint: golint, stylecheck, revive
a.logger.Debug("debug_cpuProfile", "file", file, "nsec", nsec) a.logger.Debug("debug_cpuProfile", "file", file, "nsec", nsec)
if err := a.StartCPUProfile(file); err != nil { if err := a.StartCPUProfile(file); err != nil {
return err return err
+1 -1
View File
@@ -127,7 +127,7 @@ func (e *PublicAPI) ProtocolVersion() hexutil.Uint {
} }
// ChainId is the EIP-155 replay-protection chain id for the current ethereum chain config. // ChainId is the EIP-155 replay-protection chain id for the current ethereum chain config.
func (e *PublicAPI) ChainId() (*hexutil.Big, error) { // nolint func (e *PublicAPI) ChainId() (*hexutil.Big, error) { //nolint
e.logger.Debug("eth_chainId") e.logger.Debug("eth_chainId")
// if current block is at or past the EIP-155 replay-protection fork block, return chainID from config // if current block is at or past the EIP-155 replay-protection fork block, return chainID from config
bn, err := e.backend.BlockNumber() bn, err := e.backend.BlockNumber()
@@ -45,7 +45,7 @@ func NewRangeFilter(logger log.Logger, backend Backend, begin, end int64, addres
// Flatten the address and topic filter clauses into a single bloombits filter // Flatten the address and topic filter clauses into a single bloombits filter
// system. Since the bloombits are not positional, nil topics are permitted, // system. Since the bloombits are not positional, nil topics are permitted,
// which get flattened into a nil byte slice. // which get flattened into a nil byte slice.
var filtersBz [][][]byte // nolint: prealloc var filtersBz [][][]byte //nolint: prealloc
if len(addresses) > 0 { if len(addresses) > 0 {
filter := make([][]byte, len(addresses)) filter := make([][]byte, len(addresses))
for i, address := range addresses { for i, address := range addresses {
-1
View File
@@ -82,7 +82,6 @@ func MountGRPCWebServices(
logger tmlog.Logger, logger tmlog.Logger,
) { ) {
for _, res := range grpcResources { for _, res := range grpcResources {
logger.Info("[GRPC Web] HTTP POST mounted", "resource", res) logger.Info("[GRPC Web] HTTP POST mounted", "resource", res)
s := router.Methods("POST").Subrouter() s := router.Methods("POST").Subrouter()
+1 -1
View File
@@ -88,7 +88,7 @@ server_name: chibaclonkd
**Not required if you have already initialized before** **Not required if you have already initialized before**
``` ```
chibaclonkd init <your-node-moniker> --chain-id chibaclonk_81337-1 chibaclonkd init <your-node-moniker> --chain-id chibaclonk_81337-2
``` ```
On running the above command, node will be initialized with default configuration. (config files will be saved in node's On running the above command, node will be initialized with default configuration. (config files will be saved in node's
+144 -101
View File
@@ -1,42 +1,51 @@
# Setting up a Genesis Validator for Vulcanize chibaclonk Testnet (chibaclonk_81337-1) # Validator Guide for chibaclonk_81337-4 Testnet
Hardware ## Hardware Prerequisites
---
#### Supported ### Supported
- **Operating System (OS):** Ubuntu 20.04 - **Operating System (OS):** Ubuntu 20.04
- **CPU:** 1 core - **CPU:** 1 core
- **RAM:** 2GB - **RAM:** 2GB
- **Storage:** 25GB SSD - **Storage:** 25GB SSD
#### Recommended ### Recommended
- **Operating System (OS):** Ubuntu 20.04 - **Operating System (OS):** Ubuntu 20.04
- **CPU:** 2 core - **CPU:** 2 core
- **RAM:** 4GB - **RAM:** 4GB
- **Storage:** 50GB SSD - **Storage:** 50GB SSD
# A) Setup ## Network Prerequisites
## 1) Install Golang (go) - **TCP 26656** for Peer-to-Peer Network Communication
- **TCP 26660** for Prometheus Metrics (doesn't have to be exposed publicly)
1.1) Remove any existing installation of `go` # Validator Setup
## Install required software packages
```sh
# Update Ubuntu
sudo apt update
sudo apt upgrade -y
# Install required software packages
sudo apt install git curl build-essential make jq -y
``` ```
---
## Install Go
```sh
# Remove any existing installation of `go`
sudo rm -rf /usr/local/go sudo rm -rf /usr/local/go
```
1.2) Install latest/required Go version (installing `go1.17.2`) # Install Go version 1.17.2
curl https://dl.google.com/go/go1.17.2.linux-amd64.tar.gz | sudo tar -C/usr/local -zxvf -
``` # Update env variables to include go
curl -O https://golang.org/dl/go1.17.2.linux-amd64.tar.gz
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.17.2.linux-amd64.tar.gz
```
1.3) Update env variables to include `go`
```
cat <<'EOF' >>$HOME/.profile cat <<'EOF' >>$HOME/.profile
export GOROOT=/usr/local/go export GOROOT=/usr/local/go
export GOPATH=$HOME/go export GOPATH=$HOME/go
@@ -47,131 +56,168 @@ EOF
source $HOME/.profile source $HOME/.profile
``` ```
1.4) Check the version of go installed Check the version of go installed
``` ```sh
go version go version
# Should return something like: go version go1.17.2 linux/amd64
``` ```
### 2) Install required software packages ---
``` ## Install `chibaclonk`
sudo apt-get update && sudo apt-get install git curl build-essential make jq -y
```
### 3) Install `chibaclonk` ```sh
```
git clone https://github.com/vulcanize/chiba-clonk.git git clone https://github.com/vulcanize/chiba-clonk.git
cd chiba-clonk cd chiba-clonk
# Checkout main branch
git fetch --all git fetch --all
git checkout main git checkout main
# Build and install chibaclonk
make install make install
``` ```
### 4) Verify your installation Verify your installation
``` ```sh
chibaclonkd version --long chibaclonkd version --long
``` ```
On running the above command, you should see a similar response like this. Make sure that the *version* and *commit On running the above command, you should see a similar response like this. Make sure that the *version* and *commit
hash* are accurate hash* are accurate
``` ```sh
name: chibaclonk name: chibaclonk
server_name: chibaclonkd server_name: chibaclonkd
``` ```
### 5) Initialize Node ---
## Initialize Validator Node
**Not required if you have already initialized before** **Not required if you have already initialized before**
``` ```sh
chibaclonkd init <your-node-moniker> --chain-id chibaclonk_81337-1 # Initialize the validator node
chibaclonkd init <your-node-moniker> --chain-id chibaclonk_81337-4
``` ```
On running the above command, node will be initialized with default configuration. (config files will be saved in node's Running the above commands will initialize the validator node with default configuration. The config files will be saved in the default location (`~/.chibaclonkd/config`).
default home directory (~/.chibaclonkd/config)
NOTE: Backup node and validator keys. You will need to use these keys at a later point in time. **NOTE:** Backup your node and validator keys. You will need to use these keys at a later point in time.
--- ---
## 6) Create Account keys ## Overwrite Validator Initialization from previous testnet
if you have participated in previous testnet and have mnemonic phrase, use below command to recover your account **Required for `chibaclonk_81337-4`**
First we have to reset the previous genesis state (only because the `chibaclonk_81337-3` testnet failed) whereafter we can initialize the validator node for `chibaclonk_81337-4`
```sh
# Stop your node (in case it was still running)
systemctl stop chibaclonkd
# Keep a backup of your old validator directory
cp -a ~/.chibaclonkd ~/backup-chibaclonk_81337-2
# Reset the state of your validator
chibaclonkd tendermint unsafe-reset-all --home $HOME/.chibaclonkd
# Remove your previous genesis transactions
rm $HOME/.chibaclonkd/config/gentx/gentx*.json
# Overwrite your genesis state with the new chain-id
chibaclonkd init --overwrite <your-node-moniker> --chain-id chibaclonk_81337-4
``` ```
Running the above commands will re-initialize the validator node with default configuration. The config files will be saved in the default location (`~/.chibaclonkd/config`).
**NOTE:** Backup your node and validator keys. You will need to use these keys at a later point in time.
---
## Create Account keys
If you have participated in a previous testnet and have a mnemonic phrase, use below command to recover your account:
```sh
chibaclonkd keys add <key-name> --recover chibaclonkd keys add <key-name> --recover
``` ```
to create new account To create a new account use:
``` ```sh
chibaclonkd keys add <key-name> chibaclonkd keys add <key-name>
``` ```
NOTE: Save `mnemonic` and related account details (public key). You will need to use the need mnemonic/private key to **NOTE:** Save the `mnemonic` and related account details (public key). You will need to use the mnemonic and / or private key to recover accounts at a later point in time.
recover accounts at a later point in time.
## 7) Add Genesis Account ---
**Note: don't add more than 12,000 CHK , if you add more than that, your gentx will be ignored.**
``` ## Add Genesis Account
chibaclonkd add-genesis-account <key-name> 12000000000000000000000achk --keyring-backend os
**NOTE:** Don't add more than 12,900 CHK , if you add more than that, your gentx will be ignored.
```sh
chibaclonkd add-genesis-account <key-name> 12900000000000000000000achk --keyring-backend os
``` ```
## 8) Create Your `gentx` Create Your `gentx` transaction file
``` ```sh
chibaclonkd gentx <key-name> 12000000000000000000000achk \ chibaclonkd gentx <key-name> 12900000000000000000000achk \
--pubkey=$(chibaclonkd tendermint show-validator) \ --pubkey=$(chibaclonkd tendermint show-validator) \
--chain-id="chibaclonk_81337-1" \ --chain-id="chibaclonk_81337-4" \
--moniker="YOUR_MONIKER_NAME" \ --moniker="<your-moniker-name>" \
--website="https://yourweb.site" \ --website="<your-validator-website>" \
--details="description of my validator" \ --details="<your-validator-description>" \
--identity="<your-keybase-public-key>" \
--commission-rate="0.10" \ --commission-rate="0.10" \
--commission-max-rate="0.20" \ --commission-max-rate="0.20" \
--commission-max-change-rate="0.01" \ --commission-max-change-rate="0.01" \
--min-self-delegation="1" --min-self-delegation="1"
``` ```
Note: **NOTE:**
- `<key-name>` and `chain-id` are required. other flags are optional - `<key-name>` and `chain-id` are required. other flags are optional
- Don't change amount value while creating your gentx - Don't change the amount value while creating your gentx
- Genesis transaction file will be saved in `~/.chibaclonkd/config/gentx` folder - Genesis transaction file will be saved in `~/.chibaclonkd/config/gentx` folder
## 9) Submit Your gentx
Submit your `gentx` file to the [testnets]() in the format of
`<validator-moniker>-gentx.json`
NOTE: (Do NOT use space in the file name)
To submit the gentx file, follow the below process:
- Fork the [testnets]() repository
- Upload your gentx file in `chibaclonk_81337-1/config/gentxs` folder
- Submit Pull Request to [testnets]() with name `ADD <your-moniker> gentx`
--- ---
**Execute below instructions only after publishing of final genesis file** ## Submit Your gentx
genesis file will be published to [testnets/chibaclonk_9000-1]() Submit your `gentx` file to the [https://github.com/vulcanize/laconic-testnet]() repository in the following format:
`<validator-moniker>-gentx.json`
# B) Starting the validator **NOTE:** (Do NOT use spaces in the file name)
TBU To submit the gentx file, follow the below process:
## 3) Start the Node - Fork the [https://github.com/vulcanize/laconic-testnet]() repository
- Upload your gentx file in the `chibaclonk_81337-4/config/gentxs` folder
- Submit Pull Request to [https://github.com/vulcanize/laconic-testnet]() with name `ADD <your-moniker> gentx`
#### 3.1) Start node as `systemctl` service The genesis file will be published in the `chibaclonk_81337-4/config/` folder within the [https://github.com/vulcanize/laconic-testnet]() repository.
3.1.1) Create the service file Note: this step is not required if you did setup before # CONTINUE WITH BELOW STEPS ONLY AFTER GENESIS FILE HAS BEEN PUBLISHED
``` ## Adjust validator node configuration
```sh
# Set seed & peers variable
seeds="<seeds node list here>"
peers="<peers node list here>"
# Update seeds, persistent_peers and prometheus parameters in config.toml
sed -i.bak -e "s/^seeds *=.*/seeds = \"$seeds\"/; s/^persistent_peers *=.*/persistent_peers = \"$peers\"/; s/^prometheus *=.*/prometheus = true/" $HOME/.chibaclonkd/config/config.toml
# Create systemd validator service
sudo tee /etc/systemd/system/chibaclonkd.service > /dev/null <<EOF sudo tee /etc/systemd/system/chibaclonkd.service > /dev/null <<EOF
[Unit] [Unit]
Description=chibaclonkd Daemon Description=chibaclonkd Daemon
@@ -179,7 +225,7 @@ After=network-online.target
[Service] [Service]
User=$USER User=$USER
ExecStart=$(which chibaclonkd) start ExecStart=$(which chibaclonkd) start --mode validator --gql-playground --gql-server --log_level=warn
Restart=always Restart=always
RestartSec=3 RestartSec=3
LimitNOFILE=65535 LimitNOFILE=65535
@@ -187,45 +233,42 @@ LimitNOFILE=65535
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
EOF EOF
```
3.1.2) Load service and start #Reload systemd and start the validator node
```
sudo systemctl daemon-reload sudo systemctl daemon-reload
sudo systemctl enable chibaclonkd sudo systemctl enable chibaclonkd
sudo systemctl start chibaclonkd sudo systemctl start chibaclonkd
``` ```
3.1.3) Check status of service Check status of service
``` ```sh
sudo systemctl status chibaclonkd sudo systemctl status chibaclonkd
``` ```
`NOTE:` ---
A helpful command here is `journalctl` that can be used to:
a) check logs ## Helpful Commands
``` ```sh
journalctl -u chibaclonkd # Check logs
``` journalctl -u chibaclonkd
b) most recent logs # Most recent logs
journalctl -xeu chibaclonkd
``` # Logs from previous day
journalctl -xeu chibaclonkd journalctl --since "1 day ago" -u chibaclonkd
```
c) logs from previous day # Check logs with follow flag
journalctl -f -u chibaclonkd
``` # Check discovered peers
journalctl --since "1 day ago" -u chibaclonkd curl http://localhost:26657/net_info
```
d) Check logs with follow flag # Check network consensus state
curl http://localhost:26657/consensus_state
``` # Check the sync status of your validator node
journalctl -f -u chibaclonkd chibaclonkd status | jq .SyncInfo
``` ```
+2 -2
View File
@@ -6,7 +6,7 @@
### 1.Run Full Node ### 1.Run Full Node
- Check "[Run Full Node](full-node.md)" section to Run a Full Node - Check "[Run Full Node](full_node.md)" section to Run a Full Node
### 2. Create Account & Get test tokens ### 2. Create Account & Get test tokens
@@ -42,7 +42,7 @@ chibaclonkd tx staking create-validator \
--moniker="my-moniker" \ --moniker="my-moniker" \
--website="https://myweb.site" \ --website="https://myweb.site" \
--details="description of your validator" \ --details="description of your validator" \
--chain-id="chibaclonk_81337-1" \ --chain-id="chibaclonk_81337-2" \
--commission-rate="0.10" \ --commission-rate="0.10" \
--commission-max-rate="0.20" \ --commission-max-rate="0.20" \
--commission-max-change-rate="0.01" \ --commission-max-change-rate="0.01" \
-1
View File
@@ -431,7 +431,6 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) {
stakingtypes.NewCommissionRates(commission, sdk.OneDec(), sdk.OneDec()), stakingtypes.NewCommissionRates(commission, sdk.OneDec(), sdk.OneDec()),
sdk.OneInt(), sdk.OneInt(),
) )
if err != nil { if err != nil {
return nil, err return nil, err
} }
+2 -2
View File
@@ -253,12 +253,12 @@ func WriteFile(name string, dir string, contents []byte) error {
writePath := filepath.Join(dir) writePath := filepath.Join(dir)
file := filepath.Join(writePath, name) file := filepath.Join(writePath, name)
err := tmos.EnsureDir(writePath, 0755) err := tmos.EnsureDir(writePath, 0o755)
if err != nil { if err != nil {
return err return err
} }
err = ioutil.WriteFile(file, contents, 0644) // nolint: gosec err = ioutil.WriteFile(file, contents, 0o644) //nolint: gosec
if err != nil { if err != nil {
return err return err
} }
-1
View File
@@ -36,7 +36,6 @@ func GenerateHash(json map[string]interface{}) (string, []byte, error) {
return "", nil, err return "", nil, err
} }
//cid, err := CIDFromJSONBytes(content)
cidString, err := CIDFromJSONBytesUsingIpldPrime(content) cidString, err := CIDFromJSONBytesUsingIpldPrime(content)
if err != nil { if err != nil {
return "", nil, err return "", nil, err
+1 -1
View File
@@ -16,7 +16,7 @@ func GenerateMnemonic() (string, error) {
return "", err return "", err
} }
mnemonic, err := bip39.NewMnemonic(entropySeed[:]) mnemonic, err := bip39.NewMnemonic(entropySeed)
if err != nil { if err != nil {
return "", err return "", err
} }
+1 -1
View File
@@ -134,7 +134,7 @@ func GetCmdCommitBid() *cobra.Command {
} }
// Save reveal file. // Save reveal file.
ioutil.WriteFile(fmt.Sprintf("%s-%s.json", clientCtx.GetFromName(), commitHash), content, 0600) ioutil.WriteFile(fmt.Sprintf("%s-%s.json", clientCtx.GetFromName(), commitHash), content, 0o600)
msg := types.NewMsgCommitBid(auctionID, commitHash, clientCtx.GetFromAddress()) msg := types.NewMsgCommitBid(auctionID, commitHash, clientCtx.GetFromAddress())
err = msg.ValidateBasic() err = msg.ValidateBasic()
+1 -3
View File
@@ -382,7 +382,7 @@ func (k Keeper) CommitBid(ctx sdk.Context, msg types.MsgCommitBid) (*types.Bid,
return &bid, nil return &bid, nil
} }
// RevealBid reeals a bid comitted earlier. // RevealBid reeals a bid committed earlier.
func (k Keeper) RevealBid(ctx sdk.Context, msg types.MsgRevealBid) (*types.Auction, error) { func (k Keeper) RevealBid(ctx sdk.Context, msg types.MsgRevealBid) (*types.Auction, error) {
if !k.HasAuction(ctx, msg.AuctionId) { if !k.HasAuction(ctx, msg.AuctionId) {
return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Auction not found.") return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Auction not found.")
@@ -561,7 +561,6 @@ func (k Keeper) pickAuctionWinner(ctx sdk.Context, auction *types.Auction) {
ctx.Logger().Info(fmt.Sprintf("Updated 1st bid %s %s", highestBid.BidderAddress, highestBid.BidAmount.String())) ctx.Logger().Info(fmt.Sprintf("Updated 1st bid %s %s", highestBid.BidderAddress, highestBid.BidAmount.String()))
ctx.Logger().Info(fmt.Sprintf("Updated 2nd bid %s %s", secondHighestBid.BidderAddress, secondHighestBid.BidAmount.String())) ctx.Logger().Info(fmt.Sprintf("Updated 2nd bid %s %s", secondHighestBid.BidderAddress, secondHighestBid.BidAmount.String()))
} else if secondHighestBid == nil || secondHighestBid.BidAmount.IsLT(bid.BidAmount) { } else if secondHighestBid == nil || secondHighestBid.BidAmount.IsLT(bid.BidAmount) {
ctx.Logger().Info(fmt.Sprintf("New 2nd highest bid %s %s", bid.BidderAddress, bid.BidAmount.String())) ctx.Logger().Info(fmt.Sprintf("New 2nd highest bid %s %s", bid.BidderAddress, bid.BidAmount.String()))
@@ -588,7 +587,6 @@ func (k Keeper) pickAuctionWinner(ctx sdk.Context, auction *types.Auction) {
ctx.Logger().Info(fmt.Sprintf("Auction %s winner %s.", auction.Id, auction.WinnerAddress)) ctx.Logger().Info(fmt.Sprintf("Auction %s winner %s.", auction.Id, auction.WinnerAddress))
ctx.Logger().Info(fmt.Sprintf("Auction %s winner bid %s.", auction.Id, auction.WinningBid.String())) ctx.Logger().Info(fmt.Sprintf("Auction %s winner bid %s.", auction.Id, auction.WinningBid.String()))
ctx.Logger().Info(fmt.Sprintf("Auction %s winner price %s.", auction.Id, auction.WinningPrice.String())) ctx.Logger().Info(fmt.Sprintf("Auction %s winner price %s.", auction.Id, auction.WinningPrice.String()))
} else { } else {
ctx.Logger().Info(fmt.Sprintf("Auction %s has no valid revealed bids (no winner).", auction.Id)) ctx.Logger().Info(fmt.Sprintf("Auction %s has no valid revealed bids (no winner).", auction.Id))
} }
-1
View File
@@ -79,7 +79,6 @@ func (s msgServer) CommitBid(c context.Context, msg *types.MsgCommitBid) (*types
return &types.MsgCommitBidResponse{Bid: resp}, nil return &types.MsgCommitBidResponse{Bid: resp}, nil
} }
//RevealBid is the command for revealing a bid
func (s msgServer) RevealBid(c context.Context, msg *types.MsgRevealBid) (*types.MsgRevealBidResponse, error) { func (s msgServer) RevealBid(c context.Context, msg *types.MsgRevealBid) (*types.MsgRevealBidResponse, error) {
ctx := sdk.UnwrapSDKContext(c) ctx := sdk.UnwrapSDKContext(c)
+1 -1
View File
@@ -56,7 +56,7 @@ func (b AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEnc
if err != nil { if err != nil {
return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err)
} }
// Once json successfully marshalled, passes along to genesis.go // Once json successfully marshaled, passes along to genesis.go
return ValidateGenesis(data) return ValidateGenesis(data)
} }
-2
View File
@@ -63,7 +63,6 @@ func (msg MsgCreateAuction) GetSigners() []sdk.AccAddress {
// NewMsgCommitBid is the constructor function for MsgCommitBid. // NewMsgCommitBid is the constructor function for MsgCommitBid.
func NewMsgCommitBid(auctionID string, commitHash string, signer sdk.AccAddress) MsgCommitBid { func NewMsgCommitBid(auctionID string, commitHash string, signer sdk.AccAddress) MsgCommitBid {
return MsgCommitBid{ return MsgCommitBid{
AuctionId: auctionID, AuctionId: auctionID,
CommitHash: commitHash, CommitHash: commitHash,
@@ -107,7 +106,6 @@ func (msg MsgCommitBid) GetSigners() []sdk.AccAddress {
// NewMsgRevealBid is the constructor function for MsgRevealBid. // NewMsgRevealBid is the constructor function for MsgRevealBid.
func NewMsgRevealBid(auctionID string, reveal string, signer sdk.AccAddress) MsgRevealBid { func NewMsgRevealBid(auctionID string, reveal string, signer sdk.AccAddress) MsgRevealBid {
return MsgRevealBid{ return MsgRevealBid{
AuctionId: auctionID, AuctionId: auctionID,
Reveal: reveal, Reveal: reveal,
+1 -1
View File
@@ -104,7 +104,7 @@ func WithdrawBondCmd() *cobra.Command {
return cmd return cmd
} }
// CancelBondCmd is the CLI command for cancelling a bond. // CancelBondCmd is the CLI command for canceling a bond.
func CancelBondCmd() *cobra.Command { func CancelBondCmd() *cobra.Command {
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "cancel [bond Id]", Use: "cancel [bond Id]",
-2
View File
@@ -28,7 +28,6 @@ func (s *IntegrationTestSuite) TestGRPCGetBonds() {
true, true,
"", "",
func() { func() {
}, },
}, },
{ {
@@ -87,7 +86,6 @@ func (s *IntegrationTestSuite) TestGRPCGetBondsByOwner() {
fmt.Sprintf(reqUrl, "asdasd"), fmt.Sprintf(reqUrl, "asdasd"),
true, true,
func() { func() {
}, },
}, },
{ {
-1
View File
@@ -251,7 +251,6 @@ func (s *IntegrationTestSuite) TestGetQueryBondListsByOwner() {
}, },
true, true,
func() { func() {
}, },
}, },
{ {
+2 -2
View File
@@ -10,8 +10,8 @@ import (
// InitGenesis initializes genesis state based on exported genesis // InitGenesis initializes genesis state based on exported genesis
func InitGenesis( func InitGenesis(
ctx sdk.Context, ctx sdk.Context,
k keeper.Keeper, data types.GenesisState) []abci.ValidatorUpdate { k keeper.Keeper, data types.GenesisState,
) []abci.ValidatorUpdate {
k.SetParams(ctx, data.Params) k.SetParams(ctx, data.Params)
for _, bond := range data.Bonds { for _, bond := range data.Bonds {
+1
View File
@@ -2,6 +2,7 @@ package keeper
import ( import (
"fmt" "fmt"
sdk "github.com/cosmos/cosmos-sdk/types" sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/tharsis/ethermint/x/bond/types" "github.com/tharsis/ethermint/x/bond/types"
) )
+1
View File
@@ -2,6 +2,7 @@ package keeper
import ( import (
"context" "context"
sdk "github.com/cosmos/cosmos-sdk/types" sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/tharsis/ethermint/x/bond/types" "github.com/tharsis/ethermint/x/bond/types"
) )
+1
View File
@@ -4,6 +4,7 @@ import (
"context" "context"
"encoding/json" "encoding/json"
"fmt" "fmt"
"github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types" codectypes "github.com/cosmos/cosmos-sdk/codec/types"
+1
View File
@@ -3,6 +3,7 @@ package types
import ( import (
"errors" "errors"
"fmt" "fmt"
sdk "github.com/cosmos/cosmos-sdk/types" sdk "github.com/cosmos/cosmos-sdk/types"
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
) )
+2 -2
View File
@@ -89,7 +89,7 @@ func (log *Log) ToEthereum() *ethtypes.Log {
} }
func NewLogsFromEth(ethlogs []*ethtypes.Log) []*Log { func NewLogsFromEth(ethlogs []*ethtypes.Log) []*Log {
var logs []*Log // nolint: prealloc var logs []*Log //nolint: prealloc
for _, ethlog := range ethlogs { for _, ethlog := range ethlogs {
logs = append(logs, NewLogFromEth(ethlog)) logs = append(logs, NewLogFromEth(ethlog))
} }
@@ -99,7 +99,7 @@ func NewLogsFromEth(ethlogs []*ethtypes.Log) []*Log {
// LogsToEthereum casts the Ethermint Logs to a slice of Ethereum Logs. // LogsToEthereum casts the Ethermint Logs to a slice of Ethereum Logs.
func LogsToEthereum(logs []*Log) []*ethtypes.Log { func LogsToEthereum(logs []*Log) []*ethtypes.Log {
var ethLogs []*ethtypes.Log // nolint: prealloc var ethLogs []*ethtypes.Log //nolint: prealloc
for i := range logs { for i := range logs {
ethLogs = append(ethLogs, logs[i].ToEthereum()) ethLogs = append(ethLogs, logs[i].ToEthereum())
} }
+1 -1
View File
@@ -15,7 +15,7 @@ const (
// prefix bytes for the feemarket persistent store // prefix bytes for the feemarket persistent store
const ( const (
prefixBlockGasUsed = iota + 1 prefixBlockGasUsed = iota + 1
deprecatedPrefixBaseFee // nolint deprecatedPrefixBaseFee //nolint
) )
// KVStore key prefixes // KVStore key prefixes
-1
View File
@@ -266,7 +266,6 @@ $ %s query %s query-by-bond [bond id]
return err return err
} }
return clientCtx.PrintProto(res) return clientCtx.PrintProto(res)
}, },
} }
flags.AddQueryFlagsToCmd(cmd) flags.AddQueryFlagsToCmd(cmd)
-1
View File
@@ -371,7 +371,6 @@ $ %s tx %s delete-name [crn]
return cmd return cmd
} }
//GetPayloadFromFile Load payload object from YAML file.
func GetPayloadFromFile(filePath string) (*types.PayloadType, error) { func GetPayloadFromFile(filePath string) (*types.PayloadType, error) {
var payload types.PayloadType var payload types.PayloadType
+3 -11
View File
@@ -64,7 +64,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryWhoIs() {
val := s.network.Validators[0] val := s.network.Validators[0]
sr := s.Require() sr := s.Require()
reqUrl := val.APIAddress + "/vulcanize/nameservice/v1beta1/whois/%s" reqUrl := val.APIAddress + "/vulcanize/nameservice/v1beta1/whois/%s"
var authorityName = "QueryWhoIS" authorityName := "QueryWhoIS"
testCases := []struct { testCases := []struct {
name string name string
url string url string
@@ -78,7 +78,6 @@ func (s *IntegrationTestSuite) TestGRPCQueryWhoIs() {
true, true,
"", "",
func(authorityName string) { func(authorityName string) {
}, },
}, },
{ {
@@ -132,7 +131,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryLookup() {
val := s.network.Validators[0] val := s.network.Validators[0]
sr := s.Require() sr := s.Require()
reqUrl := val.APIAddress + "/vulcanize/nameservice/v1beta1/lookup?crn=%s" reqUrl := val.APIAddress + "/vulcanize/nameservice/v1beta1/lookup?crn=%s"
var authorityName = "QueryLookUp" authorityName := "QueryLookUp"
testCases := []struct { testCases := []struct {
name string name string
@@ -147,7 +146,6 @@ func (s *IntegrationTestSuite) TestGRPCQueryLookup() {
true, true,
"", "",
func(authorityName string) { func(authorityName string) {
}, },
}, },
{ {
@@ -199,7 +197,6 @@ func (s *IntegrationTestSuite) TestGRPCQueryRecordExpiryQueue() {
true, true,
"", "",
func(bondId string) { func(bondId string) {
}, },
}, },
{ {
@@ -271,7 +268,6 @@ func (s *IntegrationTestSuite) TestGRPCQueryAuthorityExpiryQueue() {
true, true,
"", "",
func(authorityName string) { func(authorityName string) {
}, },
}, },
{ {
@@ -307,7 +303,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryAuthorityExpiryQueue() {
if !tc.expectErr { if !tc.expectErr {
tc.preRun("QueryAuthorityExpiryQueue") tc.preRun("QueryAuthorityExpiryQueue")
} }
// wait 12 seconds to name authorites expires // wait 12 seconds to name authorities expires
time.Sleep(time.Second * 12) time.Sleep(time.Second * 12)
resp, _ := rest.GetRequest(tc.url) resp, _ := rest.GetRequest(tc.url)
@@ -343,7 +339,6 @@ func (s *IntegrationTestSuite) TestGRPCQueryListRecords() {
true, true,
"", "",
func(bondId string) { func(bondId string) {
}, },
}, },
{ {
@@ -483,7 +478,6 @@ func (s *IntegrationTestSuite) TestGRPCQueryGetRecordByBondID() {
true, true,
"", "",
func(bondId string) { func(bondId string) {
}, },
}, },
{ {
@@ -538,7 +532,6 @@ func (s *IntegrationTestSuite) TestGRPCQueryGetNameServiceModuleBalance() {
true, true,
"", "",
func(bondId string) { func(bondId string) {
}, },
}, },
{ {
@@ -590,7 +583,6 @@ func (s *IntegrationTestSuite) TestGRPCQueryNamesList() {
true, true,
"", "",
func(authorityName string) { func(authorityName string) {
}, },
}, },
{ {
+5 -9
View File
@@ -66,7 +66,6 @@ func (s *IntegrationTestSuite) TestGetCmdQueryForRecords() {
true, true,
0, 0,
func() { func() {
}, },
}, },
{ {
@@ -235,7 +234,7 @@ func (s *IntegrationTestSuite) TestGetCmdQueryForRecords() {
func (s *IntegrationTestSuite) TestGetCmdWhoIs() { func (s *IntegrationTestSuite) TestGetCmdWhoIs() {
val := s.network.Validators[0] val := s.network.Validators[0]
sr := s.Require() sr := s.Require()
var authorityName = "test2" authorityName := "test2"
testCases := []struct { testCases := []struct {
name string name string
args []string args []string
@@ -249,7 +248,6 @@ func (s *IntegrationTestSuite) TestGetCmdWhoIs() {
true, true,
1, 1,
func(authorityName string) { func(authorityName string) {
}, },
}, },
{ {
@@ -306,7 +304,7 @@ func (s *IntegrationTestSuite) TestGetCmdWhoIs() {
func (s *IntegrationTestSuite) TestGetCmdLookupCRN() { func (s *IntegrationTestSuite) TestGetCmdLookupCRN() {
val := s.network.Validators[0] val := s.network.Validators[0]
sr := s.Require() sr := s.Require()
var authorityName = "test1" authorityName := "test1"
testCases := []struct { testCases := []struct {
name string name string
args []string args []string
@@ -320,7 +318,6 @@ func (s *IntegrationTestSuite) TestGetCmdLookupCRN() {
true, true,
0, 0,
func(authorityName string) { func(authorityName string) {
}, },
}, },
{ {
@@ -400,7 +397,7 @@ func (s *IntegrationTestSuite) TestGetCmdLookupCRN() {
func (s *IntegrationTestSuite) GetRecordExpiryQueue() { func (s *IntegrationTestSuite) GetRecordExpiryQueue() {
val := s.network.Validators[0] val := s.network.Validators[0]
sr := s.Require() sr := s.Require()
var authorityName = "GetRecordExpiryQueue" authorityName := "GetRecordExpiryQueue"
testCasesForRecordsExpiry := []struct { testCasesForRecordsExpiry := []struct {
name string name string
@@ -415,7 +412,6 @@ func (s *IntegrationTestSuite) GetRecordExpiryQueue() {
true, true,
0, 0,
func(authorityName string, s *IntegrationTestSuite) { func(authorityName string, s *IntegrationTestSuite) {
}, },
}, },
{ {
@@ -451,10 +447,11 @@ func (s *IntegrationTestSuite) GetRecordExpiryQueue() {
}) })
} }
} }
func (s *IntegrationTestSuite) TestGetAuthorityExpiryQueue() { func (s *IntegrationTestSuite) TestGetAuthorityExpiryQueue() {
val := s.network.Validators[0] val := s.network.Validators[0]
sr := s.Require() sr := s.Require()
var authorityName = "TestGetAuthorityExpiryQueue" authorityName := "TestGetAuthorityExpiryQueue"
testCases := []struct { testCases := []struct {
name string name string
@@ -467,7 +464,6 @@ func (s *IntegrationTestSuite) TestGetAuthorityExpiryQueue() {
[]string{"invalid", fmt.Sprintf("--%s=json", tmcli.OutputFlag)}, []string{"invalid", fmt.Sprintf("--%s=json", tmcli.OutputFlag)},
true, true,
func(authorityName string) { func(authorityName string) {
}, },
}, },
{ {
+6 -11
View File
@@ -42,7 +42,7 @@ func NewIntegrationTestSuite(cfg network.Config) *IntegrationTestSuite {
func (s *IntegrationTestSuite) SetupSuite() { func (s *IntegrationTestSuite) SetupSuite() {
s.T().Log("setting up integration test suite") s.T().Log("setting up integration test suite")
var genesisState = s.cfg.GenesisState genesisState := s.cfg.GenesisState
var nsData nstypes.GenesisState var nsData nstypes.GenesisState
s.Require().NoError(s.cfg.Codec.UnmarshalJSON(genesisState[nstypes.ModuleName], &nsData)) s.Require().NoError(s.cfg.Codec.UnmarshalJSON(genesisState[nstypes.ModuleName], &nsData))
@@ -222,7 +222,7 @@ func (s *IntegrationTestSuite) TestGetCmdSetRecord() {
func (s *IntegrationTestSuite) TestGetCmdReserveName() { func (s *IntegrationTestSuite) TestGetCmdReserveName() {
val := s.network.Validators[0] val := s.network.Validators[0]
sr := s.Require() sr := s.Require()
var authorityName = "testtest" authorityName := "testtest"
testCases := []struct { testCases := []struct {
name string name string
args []string args []string
@@ -289,7 +289,7 @@ func (s *IntegrationTestSuite) TestGetCmdReserveName() {
func (s *IntegrationTestSuite) TestGetCmdSetName() { func (s *IntegrationTestSuite) TestGetCmdSetName() {
val := s.network.Validators[0] val := s.network.Validators[0]
sr := s.Require() sr := s.Require()
var authorityName = "TestGetCmdSetName" authorityName := "TestGetCmdSetName"
testCases := []struct { testCases := []struct {
name string name string
args []string args []string
@@ -307,7 +307,6 @@ func (s *IntegrationTestSuite) TestGetCmdSetName() {
}, },
true, true,
func(authorityName string) { func(authorityName string) {
}, },
}, },
{ {
@@ -394,7 +393,7 @@ func (s *IntegrationTestSuite) TestGetCmdSetName() {
func (s *IntegrationTestSuite) TestGetCmdSetAuthorityBond() { func (s *IntegrationTestSuite) TestGetCmdSetAuthorityBond() {
val := s.network.Validators[0] val := s.network.Validators[0]
sr := s.Require() sr := s.Require()
var authorityName = "TestGetCmdSetAuthorityBond" authorityName := "TestGetCmdSetAuthorityBond"
testCases := []struct { testCases := []struct {
name string name string
@@ -413,7 +412,6 @@ func (s *IntegrationTestSuite) TestGetCmdSetAuthorityBond() {
}, },
true, true,
func(authorityName string) { func(authorityName string) {
}, },
}, },
{ {
@@ -480,7 +478,7 @@ func (s *IntegrationTestSuite) TestGetCmdSetAuthorityBond() {
func (s *IntegrationTestSuite) TestGetCmdDeleteName() { func (s *IntegrationTestSuite) TestGetCmdDeleteName() {
val := s.network.Validators[0] val := s.network.Validators[0]
sr := s.Require() sr := s.Require()
var authorityName = "TestGetCmdDeleteName" authorityName := "TestGetCmdDeleteName"
testCasesForDeletingName := []struct { testCasesForDeletingName := []struct {
name string name string
args []string args []string
@@ -498,7 +496,6 @@ func (s *IntegrationTestSuite) TestGetCmdDeleteName() {
}, },
true, true,
func(authorityName string, s *IntegrationTestSuite) { func(authorityName string, s *IntegrationTestSuite) {
}, },
}, },
{ {
@@ -564,7 +561,6 @@ func (s *IntegrationTestSuite) TestGetCmdDissociateBond() {
return "" return ""
}, },
func(recordId string, s *IntegrationTestSuite) { func(recordId string, s *IntegrationTestSuite) {
}, },
}, },
{ {
@@ -659,7 +655,7 @@ func (s *IntegrationTestSuite) TestGetCmdDissociateBond() {
} }
// //
//func (s *IntegrationTestSuite) TestGetCmdDissociateRecords() { // func (s *IntegrationTestSuite) TestGetCmdDissociateRecords() {
// val := s.network.Validators[0] // val := s.network.Validators[0]
// sr := s.Require() // sr := s.Require()
// testCasesForDeletingName := []struct { // testCasesForDeletingName := []struct {
@@ -807,7 +803,6 @@ func (s *IntegrationTestSuite) TestGetCmdAssociateBond() {
return "", "" return "", ""
}, },
func(recordId, bondId string, s *IntegrationTestSuite) { func(recordId, bondId string, s *IntegrationTestSuite) {
}, },
}, },
{ {
-2
View File
@@ -17,7 +17,6 @@ func InitGenesis(ctx sdk.Context, keeper keeper.Keeper, data types.GenesisState)
// Add to record expiry queue if expiry time is in the future. // Add to record expiry queue if expiry time is in the future.
expiryTime, err := time.Parse(time.RFC3339, record.ExpiryTime) expiryTime, err := time.Parse(time.RFC3339, record.ExpiryTime)
if err != nil { if err != nil {
panic(err) panic(err)
} }
@@ -33,7 +32,6 @@ func InitGenesis(ctx sdk.Context, keeper keeper.Keeper, data types.GenesisState)
} }
for _, authority := range data.Authorities { for _, authority := range data.Authorities {
//Only import authorities that are marked active.
if authority.Entry.Status == types.AuthorityActive { if authority.Entry.Status == types.AuthorityActive {
keeper.SetNameAuthority(ctx, authority.Name, authority.Entry) keeper.SetNameAuthority(ctx, authority.Name, authority.Entry)
+4 -11
View File
@@ -7,11 +7,10 @@ import (
"encoding/gob" "encoding/gob"
"encoding/hex" "encoding/hex"
"encoding/json" "encoding/json"
set "github.com/deckarep/golang-set"
cbor "github.com/ipfs/go-ipld-cbor"
mh "github.com/multiformats/go-multihash"
"sort" "sort"
set "github.com/deckarep/golang-set"
wnsUtils "github.com/tharsis/ethermint/utils"
) )
func StringToBytes(val string) []byte { func StringToBytes(val string) []byte {
@@ -62,7 +61,6 @@ func MarshalMapToJSONBytes(val map[string]interface{}) (bytes []byte) {
func UnMarshalMapFromJSONBytes(bytes []byte) map[string]interface{} { func UnMarshalMapFromJSONBytes(bytes []byte) map[string]interface{} {
var val map[string]interface{} var val map[string]interface{}
err := json.Unmarshal(bytes, &val) err := json.Unmarshal(bytes, &val)
if err != nil { if err != nil {
panic("Marshal error.") panic("Marshal error.")
} }
@@ -72,12 +70,7 @@ func UnMarshalMapFromJSONBytes(bytes []byte) map[string]interface{} {
// GetCid gets the content ID. // GetCid gets the content ID.
func GetCid(content []byte) (string, error) { func GetCid(content []byte) (string, error) {
node, err := cbor.FromJSON(bytes.NewReader(content), mh.SHA2_256, -1) return wnsUtils.CIDFromJSONBytesUsingIpldPrime(content)
if err != nil {
return "", err
}
return node.Cid().String(), nil
} }
// BytesToBase64 encodes a byte array as a base64 string. // BytesToBase64 encodes a byte array as a base64 string.
+2 -2
View File
@@ -15,8 +15,8 @@ func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper) {
// (2) associated bond exists, if bondID is not null. // (2) associated bond exists, if bondID is not null.
func RecordInvariants(k Keeper) sdk.Invariant { func RecordInvariants(k Keeper) sdk.Invariant {
return func(ctx sdk.Context) (string, bool) { return func(ctx sdk.Context) (string, bool) {
//store := ctx.KVStore(k.storeKey) // store := ctx.KVStore(k.storeKey)
//itr := sdk.KVStorePrefixIterator(store, PrefixCIDToRecordIndex) // itr := sdk.KVStorePrefixIterator(store, PrefixCIDToRecordIndex)
//defer itr.Close() //defer itr.Close()
//for ; itr.Valid(); itr.Next() { //for ; itr.Valid(); itr.Next() {
// bz := store.Get(itr.Key()) // bz := store.Get(itr.Key())
+2 -5
View File
@@ -73,7 +73,8 @@ type Keeper struct {
// NewKeeper creates new instances of the nameservice Keeper // NewKeeper creates new instances of the nameservice Keeper
func NewKeeper(cdc codec.BinaryCodec, accountKeeper auth.AccountKeeper, bankKeeper bank.Keeper, recordKeeper RecordKeeper, func NewKeeper(cdc codec.BinaryCodec, accountKeeper auth.AccountKeeper, bankKeeper bank.Keeper, recordKeeper RecordKeeper,
bondKeeper bondkeeper.Keeper, auctionKeeper auctionkeeper.Keeper, storeKey storetypes.StoreKey, ps paramtypes.Subspace) Keeper { bondKeeper bondkeeper.Keeper, auctionKeeper auctionkeeper.Keeper, storeKey storetypes.StoreKey, ps paramtypes.Subspace,
) Keeper {
// set KeyTable if it has not already been set // set KeyTable if it has not already been set
if !ps.HasKeyTable() { if !ps.HasKeyTable() {
ps = ps.WithKeyTable(types.ParamKeyTable()) ps = ps.WithKeyTable(types.ParamKeyTable())
@@ -295,7 +296,6 @@ func (k Keeper) GetRecordExpiryQueueTimeSlice(ctx sdk.Context, timestamp time.Ti
// InsertRecordExpiryQueue inserts a record CID to the appropriate timeslice in the record expiry queue. // InsertRecordExpiryQueue inserts a record CID to the appropriate timeslice in the record expiry queue.
func (k Keeper) InsertRecordExpiryQueue(ctx sdk.Context, val types.Record) { func (k Keeper) InsertRecordExpiryQueue(ctx sdk.Context, val types.Record) {
expiryTime, err := time.Parse(time.RFC3339, val.ExpiryTime) expiryTime, err := time.Parse(time.RFC3339, val.ExpiryTime)
if err != nil { if err != nil {
panic(err) panic(err)
} }
@@ -308,7 +308,6 @@ func (k Keeper) InsertRecordExpiryQueue(ctx sdk.Context, val types.Record) {
// DeleteRecordExpiryQueue deletes a record CID from the record expiry queue. // DeleteRecordExpiryQueue deletes a record CID from the record expiry queue.
func (k Keeper) DeleteRecordExpiryQueue(ctx sdk.Context, record types.Record) { func (k Keeper) DeleteRecordExpiryQueue(ctx sdk.Context, record types.Record) {
expiryTime, err := time.Parse(time.RFC3339, record.ExpiryTime) expiryTime, err := time.Parse(time.RFC3339, record.ExpiryTime)
if err != nil { if err != nil {
panic(err) panic(err)
} }
@@ -344,7 +343,6 @@ func (k Keeper) GetAllExpiredRecords(ctx sdk.Context, currTime time.Time) (expir
for ; itr.Valid(); itr.Next() { for ; itr.Valid(); itr.Next() {
timeslice, err := helpers.BytesArrToStringArr(itr.Value()) timeslice, err := helpers.BytesArrToStringArr(itr.Value())
if err != nil { if err != nil {
panic(err) panic(err)
} }
@@ -426,7 +424,6 @@ func recordObjToRecord(store sdk.KVStore, codec codec.BinaryCodec, record types.
if store.Has(reverseNameIndexKey) { if store.Has(reverseNameIndexKey) {
names, err := helpers.BytesArrToStringArr(store.Get(reverseNameIndexKey)) names, err := helpers.BytesArrToStringArr(store.Get(reverseNameIndexKey))
if err != nil { if err != nil {
panic(err) panic(err)
} }
-1
View File
@@ -653,7 +653,6 @@ func (k Keeper) GetAllExpiredAuthorities(ctx sdk.Context, currTime time.Time) (e
for ; itr.Valid(); itr.Next() { for ; itr.Valid(); itr.Next() {
timeslice := []string{} timeslice := []string{}
timeslice, err := helpers.BytesArrToStringArr(itr.Value()) timeslice, err := helpers.BytesArrToStringArr(itr.Value())
if err != nil { if err != nil {
panic(err) panic(err)
} }
-2
View File
@@ -162,7 +162,6 @@ func (k Keeper) ProcessRenewRecord(ctx sdk.Context, msg types.MsgRenewRecord) er
// Check if renewal is required (i.e. expired record marked as deleted). // Check if renewal is required (i.e. expired record marked as deleted).
record := k.GetRecord(ctx, msg.RecordId) record := k.GetRecord(ctx, msg.RecordId)
expiryTime, err := time.Parse(time.RFC3339, record.ExpiryTime) expiryTime, err := time.Parse(time.RFC3339, record.ExpiryTime)
if err != nil { if err != nil {
panic(err) panic(err)
} }
@@ -182,7 +181,6 @@ func (k Keeper) ProcessRenewRecord(ctx sdk.Context, msg types.MsgRenewRecord) er
// ProcessAssociateBond associates a record with a bond. // ProcessAssociateBond associates a record with a bond.
func (k Keeper) ProcessAssociateBond(ctx sdk.Context, msg types.MsgAssociateBond) error { func (k Keeper) ProcessAssociateBond(ctx sdk.Context, msg types.MsgAssociateBond) error {
if !k.HasRecord(ctx, msg.RecordId) { if !k.HasRecord(ctx, msg.RecordId) {
return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Record not found.") return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Record not found.")
} }
+1 -1
View File
@@ -4,6 +4,7 @@ import (
"context" "context"
"encoding/json" "encoding/json"
"fmt" "fmt"
"github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types" codectypes "github.com/cosmos/cosmos-sdk/codec/types"
@@ -105,7 +106,6 @@ func (am AppModule) LegacyQuerierHandler(amino *codec.LegacyAmino) sdk.Querier {
} }
func (am AppModule) RegisterServices(cfg module.Configurator) { func (am AppModule) RegisterServices(cfg module.Configurator) {
querier := keeper.Querier{Keeper: am.keeper} querier := keeper.Querier{Keeper: am.keeper}
types.RegisterQueryServer(cfg.QueryServer(), querier) types.RegisterQueryServer(cfg.QueryServer(), querier)
-2
View File
@@ -31,7 +31,6 @@ func (msg MsgSetName) Type() string { return "set-name" }
// ValidateBasic Implements Msg. // ValidateBasic Implements Msg.
func (msg MsgSetName) ValidateBasic() error { func (msg MsgSetName) ValidateBasic() error {
if msg.Crn == "" { if msg.Crn == "" {
return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "CRN is required.") return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "CRN is required.")
} }
@@ -76,7 +75,6 @@ func (msg MsgReserveAuthority) Type() string { return "reserve-authority" }
// ValidateBasic Implements Msg. // ValidateBasic Implements Msg.
func (msg MsgReserveAuthority) ValidateBasic() error { func (msg MsgReserveAuthority) ValidateBasic() error {
if len(msg.Name) == 0 { if len(msg.Name) == 0 {
return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "name is required.") return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "name is required.")
} }
+4 -3
View File
@@ -3,9 +3,10 @@ package types
import ( import (
"bytes" "bytes"
"fmt" "fmt"
"time"
sdk "github.com/cosmos/cosmos-sdk/types" sdk "github.com/cosmos/cosmos-sdk/types"
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
"time"
) )
// Default parameter values. // Default parameter values.
@@ -75,8 +76,8 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs {
func NewParams(recordRent sdk.Coin, recordRentDuration time.Duration, func NewParams(recordRent sdk.Coin, recordRentDuration time.Duration,
authorityRent sdk.Coin, authorityRentDuration time.Duration, authorityGracePeriod time.Duration, authorityRent sdk.Coin, authorityRentDuration time.Duration, authorityGracePeriod time.Duration,
authorityAuctionEnabled bool, commitsDuration time.Duration, revealsDuration time.Duration, authorityAuctionEnabled bool, commitsDuration time.Duration, revealsDuration time.Duration,
commitFee sdk.Coin, revealFee sdk.Coin, minimumBid sdk.Coin) Params { commitFee sdk.Coin, revealFee sdk.Coin, minimumBid sdk.Coin,
) Params {
return Params{ return Params{
RecordRent: recordRent, RecordRent: recordRent,
RecordRentDuration: recordRentDuration, RecordRentDuration: recordRentDuration,
+1 -1
View File
@@ -22,7 +22,7 @@ type PayloadType struct {
// ToPayload converts PayloadType to Payload object. // ToPayload converts PayloadType to Payload object.
// Why? Because go-amino can't handle maps: https://github.com/tendermint/go-amino/issues/4. // Why? Because go-amino can't handle maps: https://github.com/tendermint/go-amino/issues/4.
func (payloadObj *PayloadType) ToPayload() Payload { func (payloadObj *PayloadType) ToPayload() Payload {
var payload = Payload{ payload := Payload{
Record: &Record{ Record: &Record{
Deleted: false, Deleted: false,
Owners: nil, Owners: nil,