fix: rollback to tendermint v0.34.21 #38
18
.github/workflows/lint.yml
vendored
18
.github/workflows/lint.yml
vendored
@ -13,17 +13,19 @@ 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
|
||||||
|
4
.github/workflows/security.yml
vendored
4
.github/workflows/security.yml
vendored
@ -21,10 +21,10 @@ jobs:
|
|||||||
go.mod
|
go.mod
|
||||||
go.sum
|
go.sum
|
||||||
- name: Run Gosec Security Scanner
|
- name: Run Gosec Security Scanner
|
||||||
uses: informalsystems/gosec@master
|
uses: cosmos/gosec@master
|
||||||
with:
|
with:
|
||||||
# we let the report trigger content trigger a failure using the GitHub Security features.
|
# we let the report trigger content trigger a failure using the GitHub Security features.
|
||||||
args: '-no-fail -fmt sarif -out results.sarif ./...'
|
args: '-no-fail -fmt sarif -out results.sarif -exclude=G701 ./...'
|
||||||
if: "env.GIT_DIFF_FILTERED != ''"
|
if: "env.GIT_DIFF_FILTERED != ''"
|
||||||
- name: Upload SARIF file
|
- name: Upload SARIF file
|
||||||
uses: github/codeql-action/upload-sarif@v1
|
uses: github/codeql-action/upload-sarif@v1
|
||||||
|
@ -45,6 +45,8 @@ linters:
|
|||||||
- rowserrcheck
|
- rowserrcheck
|
||||||
# - whitespace
|
# - whitespace
|
||||||
# - wsl
|
# - wsl
|
||||||
|
disable:
|
||||||
|
- typecheck
|
||||||
|
|
||||||
issues:
|
issues:
|
||||||
exclude-rules:
|
exclude-rules:
|
||||||
|
@ -344,7 +344,7 @@ func (suite AnteTestSuite) TestAnteHandler() {
|
|||||||
coinAmount := sdk.NewCoin(evmtypes.DefaultEVMDenom, sdk.NewInt(20))
|
coinAmount := sdk.NewCoin(evmtypes.DefaultEVMDenom, sdk.NewInt(20))
|
||||||
gasAmount := sdk.NewCoins(coinAmount)
|
gasAmount := sdk.NewCoins(coinAmount)
|
||||||
gas := uint64(200000)
|
gas := uint64(200000)
|
||||||
//reusing the gasAmount for deposit
|
// reusing the gasAmount for deposit
|
||||||
deposit := sdk.NewCoins(coinAmount)
|
deposit := sdk.NewCoins(coinAmount)
|
||||||
txBuilder := suite.CreateTestEIP712SubmitProposal(from, privKey, "ethermint_9000-1", gas, gasAmount, deposit)
|
txBuilder := suite.CreateTestEIP712SubmitProposal(from, privKey, "ethermint_9000-1", gas, gasAmount, deposit)
|
||||||
return txBuilder.GetTx()
|
return txBuilder.GetTx()
|
||||||
|
@ -125,7 +125,7 @@ func (avd EthAccountVerificationDecorator) AnteHandle(
|
|||||||
|
|
||||||
// check whether the sender address is EOA
|
// check whether the sender address is EOA
|
||||||
fromAddr := common.BytesToAddress(from)
|
fromAddr := common.BytesToAddress(from)
|
||||||
acct := avd.evmKeeper.GetAccount(ctx, fromAddr)
|
acct := avd.evmKeeper.GetAccount(ctx, fromAddr) //nolint: all
|
||||||
|
|
||||||
if acct == nil {
|
if acct == nil {
|
||||||
acc := avd.ak.NewAccountWithAddress(ctx, from)
|
acc := avd.ak.NewAccountWithAddress(ctx, from)
|
||||||
|
@ -31,19 +31,19 @@ type HandlerOptions struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (options HandlerOptions) validate() error {
|
func (options HandlerOptions) validate() error {
|
||||||
if options.AccountKeeper == nil {
|
if options.AccountKeeper == evmtypes.AccountKeeper(nil) {
|
||||||
return sdkerrors.Wrap(sdkerrors.ErrLogic, "account keeper is required for AnteHandler")
|
return sdkerrors.Wrap(sdkerrors.ErrLogic, "account keeper is required for AnteHandler")
|
||||||
}
|
}
|
||||||
if options.BankKeeper == nil {
|
if options.BankKeeper == evmtypes.BankKeeper(nil) {
|
||||||
return sdkerrors.Wrap(sdkerrors.ErrLogic, "bank keeper is required for AnteHandler")
|
return sdkerrors.Wrap(sdkerrors.ErrLogic, "bank keeper is required for AnteHandler")
|
||||||
}
|
}
|
||||||
if options.SignModeHandler == nil {
|
if options.SignModeHandler == authsigning.SignModeHandler(nil) {
|
||||||
return sdkerrors.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder")
|
return sdkerrors.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder")
|
||||||
}
|
}
|
||||||
if options.FeeMarketKeeper == nil {
|
if options.FeeMarketKeeper == evmtypes.FeeMarketKeeper(nil) {
|
||||||
return sdkerrors.Wrap(sdkerrors.ErrLogic, "fee market keeper is required for AnteHandler")
|
return sdkerrors.Wrap(sdkerrors.ErrLogic, "fee market keeper is required for AnteHandler")
|
||||||
}
|
}
|
||||||
if options.EvmKeeper == nil {
|
if options.EvmKeeper == EVMKeeper(nil) {
|
||||||
return sdkerrors.Wrap(sdkerrors.ErrLogic, "evm keeper is required for AnteHandler")
|
return sdkerrors.Wrap(sdkerrors.ErrLogic, "evm keeper is required for AnteHandler")
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
@ -768,6 +768,7 @@ func (app *EthermintApp) LoadHeight(height int64) error {
|
|||||||
// ModuleAccountAddrs returns all the app's module account addresses.
|
// ModuleAccountAddrs returns all the app's module account addresses.
|
||||||
func (app *EthermintApp) ModuleAccountAddrs() map[string]bool {
|
func (app *EthermintApp) ModuleAccountAddrs() map[string]bool {
|
||||||
modAccAddrs := make(map[string]bool)
|
modAccAddrs := make(map[string]bool)
|
||||||
|
// #nosec G705
|
||||||
for acc := range maccPerms {
|
for acc := range maccPerms {
|
||||||
modAccAddrs[authtypes.NewModuleAddress(acc).String()] = true
|
modAccAddrs[authtypes.NewModuleAddress(acc).String()] = true
|
||||||
}
|
}
|
||||||
@ -779,6 +780,7 @@ func (app *EthermintApp) ModuleAccountAddrs() map[string]bool {
|
|||||||
// allowed to receive external tokens.
|
// allowed to receive external tokens.
|
||||||
func (app *EthermintApp) BlockedAddrs() map[string]bool {
|
func (app *EthermintApp) BlockedAddrs() map[string]bool {
|
||||||
blockedAddrs := make(map[string]bool)
|
blockedAddrs := make(map[string]bool)
|
||||||
|
// #nosec G705
|
||||||
for acc := range maccPerms {
|
for acc := range maccPerms {
|
||||||
blockedAddrs[authtypes.NewModuleAddress(acc).String()] = !allowedReceivingModAcc[acc]
|
blockedAddrs[authtypes.NewModuleAddress(acc).String()] = !allowedReceivingModAcc[acc]
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ package app
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"math/rand"
|
"math/rand" // #nosec G702
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/codec"
|
"github.com/cosmos/cosmos-sdk/codec"
|
||||||
|
@ -135,8 +135,8 @@
|
|||||||
- [GenesisState](#vulcanize.bond.v1beta1.GenesisState)
|
- [GenesisState](#vulcanize.bond.v1beta1.GenesisState)
|
||||||
|
|
||||||
- [vulcanize/bond/v1beta1/query.proto](#vulcanize/bond/v1beta1/query.proto)
|
- [vulcanize/bond/v1beta1/query.proto](#vulcanize/bond/v1beta1/query.proto)
|
||||||
- [QueryGetBondByIdRequest](#vulcanize.bond.v1beta1.QueryGetBondByIdRequest)
|
- [QueryGetBondByIDRequest](#vulcanize.bond.v1beta1.QueryGetBondByIDRequest)
|
||||||
- [QueryGetBondByIdResponse](#vulcanize.bond.v1beta1.QueryGetBondByIdResponse)
|
- [QueryGetBondByIDResponse](#vulcanize.bond.v1beta1.QueryGetBondByIDResponse)
|
||||||
- [QueryGetBondModuleBalanceRequest](#vulcanize.bond.v1beta1.QueryGetBondModuleBalanceRequest)
|
- [QueryGetBondModuleBalanceRequest](#vulcanize.bond.v1beta1.QueryGetBondModuleBalanceRequest)
|
||||||
- [QueryGetBondModuleBalanceResponse](#vulcanize.bond.v1beta1.QueryGetBondModuleBalanceResponse)
|
- [QueryGetBondModuleBalanceResponse](#vulcanize.bond.v1beta1.QueryGetBondModuleBalanceResponse)
|
||||||
- [QueryGetBondsByOwnerRequest](#vulcanize.bond.v1beta1.QueryGetBondsByOwnerRequest)
|
- [QueryGetBondsByOwnerRequest](#vulcanize.bond.v1beta1.QueryGetBondsByOwnerRequest)
|
||||||
@ -195,10 +195,10 @@
|
|||||||
- [QueryLookupCrnResponse](#vulcanize.nameservice.v1beta1.QueryLookupCrnResponse)
|
- [QueryLookupCrnResponse](#vulcanize.nameservice.v1beta1.QueryLookupCrnResponse)
|
||||||
- [QueryParamsRequest](#vulcanize.nameservice.v1beta1.QueryParamsRequest)
|
- [QueryParamsRequest](#vulcanize.nameservice.v1beta1.QueryParamsRequest)
|
||||||
- [QueryParamsResponse](#vulcanize.nameservice.v1beta1.QueryParamsResponse)
|
- [QueryParamsResponse](#vulcanize.nameservice.v1beta1.QueryParamsResponse)
|
||||||
- [QueryRecordByBondIdRequest](#vulcanize.nameservice.v1beta1.QueryRecordByBondIdRequest)
|
- [QueryRecordByBondIDRequest](#vulcanize.nameservice.v1beta1.QueryRecordByBondIDRequest)
|
||||||
- [QueryRecordByBondIdResponse](#vulcanize.nameservice.v1beta1.QueryRecordByBondIdResponse)
|
- [QueryRecordByBondIDResponse](#vulcanize.nameservice.v1beta1.QueryRecordByBondIDResponse)
|
||||||
- [QueryRecordByIdRequest](#vulcanize.nameservice.v1beta1.QueryRecordByIdRequest)
|
- [QueryRecordByIDRequest](#vulcanize.nameservice.v1beta1.QueryRecordByIDRequest)
|
||||||
- [QueryRecordByIdResponse](#vulcanize.nameservice.v1beta1.QueryRecordByIdResponse)
|
- [QueryRecordByIDResponse](#vulcanize.nameservice.v1beta1.QueryRecordByIDResponse)
|
||||||
- [QueryResolveCrn](#vulcanize.nameservice.v1beta1.QueryResolveCrn)
|
- [QueryResolveCrn](#vulcanize.nameservice.v1beta1.QueryResolveCrn)
|
||||||
- [QueryResolveCrnResponse](#vulcanize.nameservice.v1beta1.QueryResolveCrnResponse)
|
- [QueryResolveCrnResponse](#vulcanize.nameservice.v1beta1.QueryResolveCrnResponse)
|
||||||
- [QueryWhoisRequest](#vulcanize.nameservice.v1beta1.QueryWhoisRequest)
|
- [QueryWhoisRequest](#vulcanize.nameservice.v1beta1.QueryWhoisRequest)
|
||||||
@ -2004,10 +2004,10 @@ GenesisState defines the bond module's genesis state.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="vulcanize.bond.v1beta1.QueryGetBondByIdRequest"></a>
|
<a name="vulcanize.bond.v1beta1.QueryGetBondByIDRequest"></a>
|
||||||
|
|
||||||
### QueryGetBondByIdRequest
|
### QueryGetBondByIDRequest
|
||||||
QueryGetBondById
|
QueryGetBondByID
|
||||||
|
|
||||||
|
|
||||||
| Field | Type | Label | Description |
|
| Field | Type | Label | Description |
|
||||||
@ -2019,10 +2019,10 @@ QueryGetBondById
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="vulcanize.bond.v1beta1.QueryGetBondByIdResponse"></a>
|
<a name="vulcanize.bond.v1beta1.QueryGetBondByIDResponse"></a>
|
||||||
|
|
||||||
### QueryGetBondByIdResponse
|
### QueryGetBondByIDResponse
|
||||||
QueryGetBondByIdResponse returns QueryGetBondById query response
|
QueryGetBondByIDResponse returns QueryGetBondByID query response
|
||||||
|
|
||||||
|
|
||||||
| Field | Type | Label | Description |
|
| Field | Type | Label | Description |
|
||||||
@ -2162,7 +2162,7 @@ Query defines the gRPC querier service for bond module
|
|||||||
| ----------- | ------------ | ------------- | ------------| ------- | -------- |
|
| ----------- | ------------ | ------------- | ------------| ------- | -------- |
|
||||||
| `Params` | [QueryParamsRequest](#vulcanize.bond.v1beta1.QueryParamsRequest) | [QueryParamsResponse](#vulcanize.bond.v1beta1.QueryParamsResponse) | Params queries bonds module params. | GET|/vulcanize/bond/v1beta1/params|
|
| `Params` | [QueryParamsRequest](#vulcanize.bond.v1beta1.QueryParamsRequest) | [QueryParamsResponse](#vulcanize.bond.v1beta1.QueryParamsResponse) | Params queries bonds module params. | GET|/vulcanize/bond/v1beta1/params|
|
||||||
| `Bonds` | [QueryGetBondsRequest](#vulcanize.bond.v1beta1.QueryGetBondsRequest) | [QueryGetBondsResponse](#vulcanize.bond.v1beta1.QueryGetBondsResponse) | Bonds queries bonds list. | GET|/vulcanize/bond/v1beta1/bonds|
|
| `Bonds` | [QueryGetBondsRequest](#vulcanize.bond.v1beta1.QueryGetBondsRequest) | [QueryGetBondsResponse](#vulcanize.bond.v1beta1.QueryGetBondsResponse) | Bonds queries bonds list. | GET|/vulcanize/bond/v1beta1/bonds|
|
||||||
| `GetBondById` | [QueryGetBondByIdRequest](#vulcanize.bond.v1beta1.QueryGetBondByIdRequest) | [QueryGetBondByIdResponse](#vulcanize.bond.v1beta1.QueryGetBondByIdResponse) | GetBondById | GET|/vulcanize/bond/v1beta1/bonds/{id}|
|
| `GetBondByID` | [QueryGetBondByIDRequest](#vulcanize.bond.v1beta1.QueryGetBondByIDRequest) | [QueryGetBondByIDResponse](#vulcanize.bond.v1beta1.QueryGetBondByIDResponse) | GetBondById | GET|/vulcanize/bond/v1beta1/bonds/{id}|
|
||||||
| `GetBondsByOwner` | [QueryGetBondsByOwnerRequest](#vulcanize.bond.v1beta1.QueryGetBondsByOwnerRequest) | [QueryGetBondsByOwnerResponse](#vulcanize.bond.v1beta1.QueryGetBondsByOwnerResponse) | Get Bonds List by Owner | GET|/vulcanize/bond/v1beta1/by-owner/{owner}|
|
| `GetBondsByOwner` | [QueryGetBondsByOwnerRequest](#vulcanize.bond.v1beta1.QueryGetBondsByOwnerRequest) | [QueryGetBondsByOwnerResponse](#vulcanize.bond.v1beta1.QueryGetBondsByOwnerResponse) | Get Bonds List by Owner | GET|/vulcanize/bond/v1beta1/by-owner/{owner}|
|
||||||
| `GetBondsModuleBalance` | [QueryGetBondModuleBalanceRequest](#vulcanize.bond.v1beta1.QueryGetBondModuleBalanceRequest) | [QueryGetBondModuleBalanceResponse](#vulcanize.bond.v1beta1.QueryGetBondModuleBalanceResponse) | Get Bonds module balance | GET|/vulcanize/bond/v1beta1/balance|
|
| `GetBondsModuleBalance` | [QueryGetBondModuleBalanceRequest](#vulcanize.bond.v1beta1.QueryGetBondModuleBalanceRequest) | [QueryGetBondModuleBalanceResponse](#vulcanize.bond.v1beta1.QueryGetBondModuleBalanceResponse) | Get Bonds module balance | GET|/vulcanize/bond/v1beta1/balance|
|
||||||
|
|
||||||
@ -2841,9 +2841,9 @@ QueryParamsResponse is response type for nameservice params
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="vulcanize.nameservice.v1beta1.QueryRecordByBondIdRequest"></a>
|
<a name="vulcanize.nameservice.v1beta1.QueryRecordByBondIDRequest"></a>
|
||||||
|
|
||||||
### QueryRecordByBondIdRequest
|
### QueryRecordByBondIDRequest
|
||||||
QueryRecordByBondIdRequest is request type for get the records by bond-id
|
QueryRecordByBondIdRequest is request type for get the records by bond-id
|
||||||
|
|
||||||
|
|
||||||
@ -2857,9 +2857,9 @@ QueryRecordByBondIdRequest is request type for get the records by bond-id
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="vulcanize.nameservice.v1beta1.QueryRecordByBondIdResponse"></a>
|
<a name="vulcanize.nameservice.v1beta1.QueryRecordByBondIDResponse"></a>
|
||||||
|
|
||||||
### QueryRecordByBondIdResponse
|
### QueryRecordByBondIDResponse
|
||||||
QueryRecordByBondIdResponse is response type for records list by bond-id
|
QueryRecordByBondIdResponse is response type for records list by bond-id
|
||||||
|
|
||||||
|
|
||||||
@ -2873,10 +2873,10 @@ QueryRecordByBondIdResponse is response type for records list by bond-id
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="vulcanize.nameservice.v1beta1.QueryRecordByIdRequest"></a>
|
<a name="vulcanize.nameservice.v1beta1.QueryRecordByIDRequest"></a>
|
||||||
|
|
||||||
### QueryRecordByIdRequest
|
### QueryRecordByIDRequest
|
||||||
QueryRecordByIdRequest is request type for nameservice records by id
|
QueryRecordByIDRequest is request type for nameservice records by id
|
||||||
|
|
||||||
|
|
||||||
| Field | Type | Label | Description |
|
| Field | Type | Label | Description |
|
||||||
@ -2888,10 +2888,10 @@ QueryRecordByIdRequest is request type for nameservice records by id
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="vulcanize.nameservice.v1beta1.QueryRecordByIdResponse"></a>
|
<a name="vulcanize.nameservice.v1beta1.QueryRecordByIDResponse"></a>
|
||||||
|
|
||||||
### QueryRecordByIdResponse
|
### QueryRecordByIDResponse
|
||||||
QueryRecordByIdResponse is response type for nameservice records by id
|
QueryRecordByIDResponse is response type for nameservice records by id
|
||||||
|
|
||||||
|
|
||||||
| Field | Type | Label | Description |
|
| Field | Type | Label | Description |
|
||||||
@ -2978,8 +2978,8 @@ Query defines the gRPC querier service for nameservice module
|
|||||||
| ----------- | ------------ | ------------- | ------------| ------- | -------- |
|
| ----------- | ------------ | ------------- | ------------| ------- | -------- |
|
||||||
| `Params` | [QueryParamsRequest](#vulcanize.nameservice.v1beta1.QueryParamsRequest) | [QueryParamsResponse](#vulcanize.nameservice.v1beta1.QueryParamsResponse) | Params queries the nameservice module params. | GET|/vulcanize/nameservice/v1beta1/params|
|
| `Params` | [QueryParamsRequest](#vulcanize.nameservice.v1beta1.QueryParamsRequest) | [QueryParamsResponse](#vulcanize.nameservice.v1beta1.QueryParamsResponse) | Params queries the nameservice module params. | GET|/vulcanize/nameservice/v1beta1/params|
|
||||||
| `ListRecords` | [QueryListRecordsRequest](#vulcanize.nameservice.v1beta1.QueryListRecordsRequest) | [QueryListRecordsResponse](#vulcanize.nameservice.v1beta1.QueryListRecordsResponse) | List records | GET|/vulcanize/nameservice/v1beta1/records|
|
| `ListRecords` | [QueryListRecordsRequest](#vulcanize.nameservice.v1beta1.QueryListRecordsRequest) | [QueryListRecordsResponse](#vulcanize.nameservice.v1beta1.QueryListRecordsResponse) | List records | GET|/vulcanize/nameservice/v1beta1/records|
|
||||||
| `GetRecord` | [QueryRecordByIdRequest](#vulcanize.nameservice.v1beta1.QueryRecordByIdRequest) | [QueryRecordByIdResponse](#vulcanize.nameservice.v1beta1.QueryRecordByIdResponse) | Get record by id | GET|/vulcanize/nameservice/v1beta1/records/{id}|
|
| `GetRecord` | [QueryRecordByIDRequest](#vulcanize.nameservice.v1beta1.QueryRecordByIDRequest) | [QueryRecordByIDResponse](#vulcanize.nameservice.v1beta1.QueryRecordByIDResponse) | Get record by id | GET|/vulcanize/nameservice/v1beta1/records/{id}|
|
||||||
| `GetRecordByBondId` | [QueryRecordByBondIdRequest](#vulcanize.nameservice.v1beta1.QueryRecordByBondIdRequest) | [QueryRecordByBondIdResponse](#vulcanize.nameservice.v1beta1.QueryRecordByBondIdResponse) | Get records by bond id | GET|/vulcanize/nameservice/v1beta1/records-by-bond-id/{id}|
|
| `GetRecordByBondID` | [QueryRecordByBondIDRequest](#vulcanize.nameservice.v1beta1.QueryRecordByBondIDRequest) | [QueryRecordByBondIDResponse](#vulcanize.nameservice.v1beta1.QueryRecordByBondIDResponse) | Get records by bond id | GET|/vulcanize/nameservice/v1beta1/records-by-bond-id/{id}|
|
||||||
| `GetNameServiceModuleBalance` | [GetNameServiceModuleBalanceRequest](#vulcanize.nameservice.v1beta1.GetNameServiceModuleBalanceRequest) | [GetNameServiceModuleBalanceResponse](#vulcanize.nameservice.v1beta1.GetNameServiceModuleBalanceResponse) | Get nameservice module balance | GET|/vulcanize/nameservice/v1beta1/balance|
|
| `GetNameServiceModuleBalance` | [GetNameServiceModuleBalanceRequest](#vulcanize.nameservice.v1beta1.GetNameServiceModuleBalanceRequest) | [GetNameServiceModuleBalanceResponse](#vulcanize.nameservice.v1beta1.GetNameServiceModuleBalanceResponse) | Get nameservice module balance | GET|/vulcanize/nameservice/v1beta1/balance|
|
||||||
| `ListNameRecords` | [QueryListNameRecordsRequest](#vulcanize.nameservice.v1beta1.QueryListNameRecordsRequest) | [QueryListNameRecordsResponse](#vulcanize.nameservice.v1beta1.QueryListNameRecordsResponse) | List name records | GET|/vulcanize/nameservice/v1beta1/names|
|
| `ListNameRecords` | [QueryListNameRecordsRequest](#vulcanize.nameservice.v1beta1.QueryListNameRecordsRequest) | [QueryListNameRecordsResponse](#vulcanize.nameservice.v1beta1.QueryListNameRecordsResponse) | List name records | GET|/vulcanize/nameservice/v1beta1/names|
|
||||||
| `Whois` | [QueryWhoisRequest](#vulcanize.nameservice.v1beta1.QueryWhoisRequest) | [QueryWhoisResponse](#vulcanize.nameservice.v1beta1.QueryWhoisResponse) | Whois method retrieve the name authority info | GET|/vulcanize/nameservice/v1beta1/whois/{name}|
|
| `Whois` | [QueryWhoisRequest](#vulcanize.nameservice.v1beta1.QueryWhoisRequest) | [QueryWhoisResponse](#vulcanize.nameservice.v1beta1.QueryWhoisResponse) | Whois method retrieve the name authority info | GET|/vulcanize/nameservice/v1beta1/whois/{name}|
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"math/big"
|
"math/big"
|
||||||
"reflect"
|
"reflect" // #nosec G702
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -23,9 +23,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// Testing Constants
|
// Testing Constants
|
||||||
var chainId = "ethermint_9000-1"
|
var (
|
||||||
var ctx = client.Context{}.WithTxConfig(
|
chainId = "ethermint_9000-1"
|
||||||
|
ctx = client.Context{}.WithTxConfig(
|
||||||
encoding.MakeConfig(app.ModuleBasics).TxConfig,
|
encoding.MakeConfig(app.ModuleBasics).TxConfig,
|
||||||
|
)
|
||||||
)
|
)
|
||||||
var feePayerAddress = "ethm17xpfvakm2amg962yls6f84z3kell8c5lthdzgl"
|
var feePayerAddress = "ethm17xpfvakm2amg962yls6f84z3kell8c5lthdzgl"
|
||||||
|
|
||||||
|
6
go.mod
6
go.mod
@ -44,8 +44,8 @@ require (
|
|||||||
github.com/vektah/gqlparser/v2 v2.5.1
|
github.com/vektah/gqlparser/v2 v2.5.1
|
||||||
golang.org/x/net v0.0.0-20220909164309-bea034e7d591
|
golang.org/x/net v0.0.0-20220909164309-bea034e7d591
|
||||||
golang.org/x/text v0.3.7
|
golang.org/x/text v0.3.7
|
||||||
google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e
|
google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a
|
||||||
google.golang.org/grpc v1.49.0
|
google.golang.org/grpc v1.50.0
|
||||||
google.golang.org/protobuf v1.28.1
|
google.golang.org/protobuf v1.28.1
|
||||||
gopkg.in/yaml.v3 v3.0.1
|
gopkg.in/yaml.v3 v3.0.1
|
||||||
sigs.k8s.io/yaml v1.3.0
|
sigs.k8s.io/yaml v1.3.0
|
||||||
@ -198,7 +198,7 @@ require (
|
|||||||
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
|
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
|
||||||
golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2 // indirect
|
golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2 // indirect
|
||||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect
|
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect
|
||||||
golang.org/x/sys v0.0.0-20220908150016-7ac13a9a928d // indirect
|
golang.org/x/sys v0.0.0-20220913175220-63ea55921009 // indirect
|
||||||
golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 // indirect
|
golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 // indirect
|
||||||
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
|
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
|
||||||
google.golang.org/api v0.93.0 // indirect
|
google.golang.org/api v0.93.0 // indirect
|
||||||
|
12
go.sum
12
go.sum
@ -1456,8 +1456,8 @@ golang.org/x/sys v0.0.0-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBc
|
|||||||
golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20220908150016-7ac13a9a928d h1:RoyzQTK76Rktm3p4xyZslc8T8I1tBz4UEjZCzeh57mM=
|
golang.org/x/sys v0.0.0-20220913175220-63ea55921009 h1:PuvuRMeLWqsf/ZdT1UUZz0syhioyv1mzuFZsXs4fvhw=
|
||||||
golang.org/x/sys v0.0.0-20220908150016-7ac13a9a928d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220913175220-63ea55921009/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
|
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
|
||||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||||
@ -1700,8 +1700,8 @@ google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljW
|
|||||||
google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA=
|
google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA=
|
||||||
google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA=
|
google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA=
|
||||||
google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA=
|
google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA=
|
||||||
google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e h1:halCgTFuLWDRD61piiNSxPsARANGD3Xl16hPrLgLiIg=
|
google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a h1:GH6UPn3ixhWcKDhpnEC55S75cerLPdpp3hrhfKYjZgw=
|
||||||
google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqwhZAwq4wsRUaVG555sVgsNmIjRtO7t/JH29U=
|
google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM=
|
||||||
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
|
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
|
||||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||||
google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||||
@ -1740,8 +1740,8 @@ google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11
|
|||||||
google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
|
google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
|
||||||
google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
|
google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
|
||||||
google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
|
google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
|
||||||
google.golang.org/grpc v1.49.0 h1:WTLtQzmQori5FUH25Pq4WT22oCsv8USpQ+F6rqtsmxw=
|
google.golang.org/grpc v1.50.0 h1:fPVVDxY9w++VjTZsYvXWqEf9Rqar/e+9zYfxKK+W+YU=
|
||||||
google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
|
google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
|
||||||
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw=
|
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw=
|
||||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||||
|
@ -34,7 +34,7 @@ type queryResolver struct{ *Resolver }
|
|||||||
func (q queryResolver) LookupAuthorities(ctx context.Context, names []string) ([]*AuthorityRecord, error) {
|
func (q queryResolver) LookupAuthorities(ctx context.Context, names []string) ([]*AuthorityRecord, error) {
|
||||||
nsQueryClient := nstypes.NewQueryClient(q.ctx)
|
nsQueryClient := nstypes.NewQueryClient(q.ctx)
|
||||||
auctionQueryClient := auctiontypes.NewQueryClient(q.ctx)
|
auctionQueryClient := auctiontypes.NewQueryClient(q.ctx)
|
||||||
var gqlResponse []*AuthorityRecord
|
gqlResponse := []*AuthorityRecord{}
|
||||||
|
|
||||||
for _, name := range names {
|
for _, name := range names {
|
||||||
res, err := nsQueryClient.Whois(context.Background(), &nstypes.QueryWhoisRequest{Name: name})
|
res, err := nsQueryClient.Whois(context.Background(), &nstypes.QueryWhoisRequest{Name: name})
|
||||||
@ -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) {
|
||||||
@ -150,7 +148,7 @@ func (q queryResolver) GetRecordsByIds(ctx context.Context, ids []string) ([]*Re
|
|||||||
gqlResponse := make([]*Record, len(ids))
|
gqlResponse := make([]*Record, len(ids))
|
||||||
|
|
||||||
for i, id := range ids {
|
for i, id := range ids {
|
||||||
res, err := nsQueryClient.GetRecord(context.Background(), &nstypes.QueryRecordByIdRequest{Id: id})
|
res, err := nsQueryClient.GetRecord(context.Background(), &nstypes.QueryRecordByIDRequest{Id: id})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// Return nil for record not found.
|
// Return nil for record not found.
|
||||||
gqlResponse[i] = nil
|
gqlResponse[i] = nil
|
||||||
@ -231,7 +229,9 @@ func (q queryResolver) GetAccount(ctx context.Context, address string) (*Account
|
|||||||
// Get the account balance
|
// Get the account balance
|
||||||
bankQueryClient := banktypes.NewQueryClient(q.ctx)
|
bankQueryClient := banktypes.NewQueryClient(q.ctx)
|
||||||
balance, err := bankQueryClient.AllBalances(ctx, &banktypes.QueryAllBalancesRequest{Address: address})
|
balance, err := bankQueryClient.AllBalances(ctx, &banktypes.QueryAllBalancesRequest{Address: address})
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
accNum := strconv.FormatUint(account.GetAccountNumber(), 10)
|
accNum := strconv.FormatUint(account.GetAccountNumber(), 10)
|
||||||
seq := strconv.FormatUint(account.GetSequence(), 10)
|
seq := strconv.FormatUint(account.GetSequence(), 10)
|
||||||
|
|
||||||
@ -259,7 +259,7 @@ func (q queryResolver) GetBondsByIds(ctx context.Context, ids []string) ([]*Bond
|
|||||||
|
|
||||||
func (q *queryResolver) GetBond(ctx context.Context, id string) (*Bond, error) {
|
func (q *queryResolver) GetBond(ctx context.Context, id string) (*Bond, error) {
|
||||||
bondQueryClient := bondtypes.NewQueryClient(q.ctx)
|
bondQueryClient := bondtypes.NewQueryClient(q.ctx)
|
||||||
bondResp, err := bondQueryClient.GetBondById(context.Background(), &bondtypes.QueryGetBondByIdRequest{Id: id})
|
bondResp, err := bondQueryClient.GetBondByID(context.Background(), &bondtypes.QueryGetBondByIDRequest{Id: id})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -313,7 +313,8 @@ func (q queryResolver) GetBondsByOwner(ctx context.Context, address string) (*Ow
|
|||||||
|
|
||||||
ownerBonds := make([]*Bond, len(bondResp.GetBonds()))
|
ownerBonds := make([]*Bond, len(bondResp.GetBonds()))
|
||||||
for i, bond := range bondResp.GetBonds() {
|
for i, bond := range bondResp.GetBonds() {
|
||||||
bondObj, err := getGQLBond(&bond)
|
// #nosec G601
|
||||||
|
bondObj, err := getGQLBond(&bond) //nolint: all
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ func Server(ctx client.Context) {
|
|||||||
http.Handle("/graphql", srv)
|
http.Handle("/graphql", srv)
|
||||||
|
|
||||||
log.Info("Connect to GraphQL playground", "url", fmt.Sprintf("http://localhost:%s", port))
|
log.Info("Connect to GraphQL playground", "url", fmt.Sprintf("http://localhost:%s", port))
|
||||||
err := http.ListenAndServe(":"+port, nil)
|
err := http.ListenAndServe(":"+port, nil) //nolint: all
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,7 @@ func getValidatorSet(client client.Context) ([]*ValidatorInfo, error) {
|
|||||||
|
|
||||||
// GetDiskUsage returns disk usage for the given path.
|
// GetDiskUsage returns disk usage for the given path.
|
||||||
func GetDiskUsage(dirPath string) (string, error) {
|
func GetDiskUsage(dirPath string) (string, error) {
|
||||||
out, err := exec.Command("du", "-sh", dirPath).Output()
|
out, err := exec.Command("du", "-sh", dirPath).Output() // #nosec G204
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
37
gql/util.go
37
gql/util.go
@ -3,7 +3,8 @@ package gql
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"reflect"
|
"fmt"
|
||||||
|
"reflect" // #nosec G702
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
auctiontypes "github.com/cerc-io/laconicd/x/auction/types"
|
auctiontypes "github.com/cerc-io/laconicd/x/auction/types"
|
||||||
@ -38,6 +39,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
|
||||||
@ -84,7 +86,7 @@ func getGQLRecord(ctx context.Context, resolver QueryResolver, record nstypes.Re
|
|||||||
|
|
||||||
func getGQLNameRecord(record *nstypes.NameRecord) (*NameRecord, error) {
|
func getGQLNameRecord(record *nstypes.NameRecord) (*NameRecord, error) {
|
||||||
if record == nil {
|
if record == nil {
|
||||||
return nil, nil
|
return nil, fmt.Errorf("got nil record")
|
||||||
}
|
}
|
||||||
|
|
||||||
records := make([]*NameRecordEntry, len(record.History))
|
records := make([]*NameRecordEntry, len(record.History))
|
||||||
@ -118,26 +120,6 @@ func getGQLBond(bondObj *bondtypes.Bond) (*Bond, error) {
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func matchBondOnAttributes(bondObj *bondtypes.Bond, attributes []*KeyValueInput) bool {
|
|
||||||
for _, attr := range attributes {
|
|
||||||
switch attr.Key {
|
|
||||||
case OwnerAttributeName:
|
|
||||||
{
|
|
||||||
if attr.Value.String == nil || bondObj.Owner != *attr.Value.String {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
// Only attributes explicitly listed in the switch are queryable.
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
func getAuctionBid(bid *auctiontypes.Bid) *AuctionBid {
|
func getAuctionBid(bid *auctiontypes.Bid) *AuctionBid {
|
||||||
return &AuctionBid{
|
return &AuctionBid{
|
||||||
BidderAddress: bid.BidderAddress,
|
BidderAddress: bid.BidderAddress,
|
||||||
@ -184,10 +166,12 @@ func GetGQLAuction(auction *auctiontypes.Auction, bids []*auctiontypes.Bid) (*Au
|
|||||||
func getReferences(ctx context.Context, resolver QueryResolver, r *nstypes.RecordType) ([]*Record, error) {
|
func getReferences(ctx context.Context, resolver QueryResolver, r *nstypes.RecordType) ([]*Record, error) {
|
||||||
var ids []string
|
var ids []string
|
||||||
|
|
||||||
for _, value := range r.Attributes {
|
// #nosec G705
|
||||||
switch value.(type) {
|
for key := range r.Attributes {
|
||||||
|
//nolint: all
|
||||||
|
switch r.Attributes[key].(type) {
|
||||||
case interface{}:
|
case interface{}:
|
||||||
if obj, ok := value.(map[string]interface{}); ok {
|
if obj, ok := r.Attributes[key].(map[string]interface{}); ok {
|
||||||
if _, ok := obj["/"]; ok && len(obj) == 1 {
|
if _, ok := obj["/"]; ok && len(obj) == 1 {
|
||||||
if _, ok := obj["/"].(string); ok {
|
if _, ok := obj["/"].(string); ok {
|
||||||
ids = append(ids, obj["/"].(string))
|
ids = append(ids, obj["/"].(string))
|
||||||
@ -205,11 +189,12 @@ func getAttributes(r *nstypes.RecordType) ([]*KeyValue, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func mapToKeyValuePairs(attrs map[string]interface{}) ([]*KeyValue, error) {
|
func mapToKeyValuePairs(attrs map[string]interface{}) ([]*KeyValue, error) {
|
||||||
var kvPairs []*KeyValue
|
kvPairs := []*KeyValue{}
|
||||||
|
|
||||||
trueVal := true
|
trueVal := true
|
||||||
falseVal := false
|
falseVal := false
|
||||||
|
|
||||||
|
// #nosec G705
|
||||||
for key, value := range attrs {
|
for key, value := range attrs {
|
||||||
kvPair := &KeyValue{
|
kvPair := &KeyValue{
|
||||||
Key: key,
|
Key: key,
|
||||||
|
@ -22,7 +22,7 @@ service Query {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetBondById
|
// GetBondById
|
||||||
rpc GetBondById(QueryGetBondByIdRequest) returns (QueryGetBondByIdResponse) {
|
rpc GetBondByID(QueryGetBondByIDRequest) returns (QueryGetBondByIDResponse) {
|
||||||
option (google.api.http).get = "/vulcanize/bond/v1beta1/bonds/{id}";
|
option (google.api.http).get = "/vulcanize/bond/v1beta1/bonds/{id}";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,13 +58,13 @@ message QueryGetBondsResponse {
|
|||||||
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// QueryGetBondById
|
// QueryGetBondByID
|
||||||
message QueryGetBondByIdRequest {
|
message QueryGetBondByIDRequest {
|
||||||
string id = 1 [(gogoproto.moretags) = "json:\"id\" yaml:\"id\""];
|
string id = 1 [(gogoproto.moretags) = "json:\"id\" yaml:\"id\""];
|
||||||
}
|
}
|
||||||
|
|
||||||
// QueryGetBondByIdResponse returns QueryGetBondById query response
|
// QueryGetBondByIDResponse returns QueryGetBondByID query response
|
||||||
message QueryGetBondByIdResponse {
|
message QueryGetBondByIDResponse {
|
||||||
Bond bond = 1 [(gogoproto.moretags) = "json:\"bond\" yaml:\"bond\""];
|
Bond bond = 1 [(gogoproto.moretags) = "json:\"bond\" yaml:\"bond\""];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,11 +20,11 @@ service Query {
|
|||||||
option (google.api.http).get = "/vulcanize/nameservice/v1beta1/records";
|
option (google.api.http).get = "/vulcanize/nameservice/v1beta1/records";
|
||||||
}
|
}
|
||||||
// Get record by id
|
// Get record by id
|
||||||
rpc GetRecord(QueryRecordByIdRequest) returns (QueryRecordByIdResponse) {
|
rpc GetRecord(QueryRecordByIDRequest) returns (QueryRecordByIDResponse) {
|
||||||
option (google.api.http).get = "/vulcanize/nameservice/v1beta1/records/{id}";
|
option (google.api.http).get = "/vulcanize/nameservice/v1beta1/records/{id}";
|
||||||
}
|
}
|
||||||
// Get records by bond id
|
// Get records by bond id
|
||||||
rpc GetRecordByBondId(QueryRecordByBondIdRequest) returns (QueryRecordByBondIdResponse) {
|
rpc GetRecordByBondID(QueryRecordByBondIDRequest) returns (QueryRecordByBondIDResponse) {
|
||||||
option (google.api.http).get = "/vulcanize/nameservice/v1beta1/records-by-bond-id/{id}";
|
option (google.api.http).get = "/vulcanize/nameservice/v1beta1/records-by-bond-id/{id}";
|
||||||
}
|
}
|
||||||
// Get nameservice module balance
|
// Get nameservice module balance
|
||||||
@ -98,25 +98,25 @@ message QueryListRecordsResponse {
|
|||||||
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// QueryRecordByIdRequest is request type for nameservice records by id
|
// QueryRecordByIDRequest is request type for nameservice records by id
|
||||||
message QueryRecordByIdRequest {
|
message QueryRecordByIDRequest {
|
||||||
string id = 1;
|
string id = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// QueryRecordByIdResponse is response type for nameservice records by id
|
// QueryRecordByIDResponse is response type for nameservice records by id
|
||||||
message QueryRecordByIdResponse {
|
message QueryRecordByIDResponse {
|
||||||
Record record = 1 [(gogoproto.nullable) = false];
|
Record record = 1 [(gogoproto.nullable) = false];
|
||||||
}
|
}
|
||||||
|
|
||||||
// QueryRecordByBondIdRequest is request type for get the records by bond-id
|
// QueryRecordByBondIdRequest is request type for get the records by bond-id
|
||||||
message QueryRecordByBondIdRequest {
|
message QueryRecordByBondIDRequest {
|
||||||
string id = 1;
|
string id = 1;
|
||||||
// pagination defines an optional pagination for the request.
|
// pagination defines an optional pagination for the request.
|
||||||
cosmos.base.query.v1beta1.PageRequest pagination = 2;
|
cosmos.base.query.v1beta1.PageRequest pagination = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// QueryRecordByBondIdResponse is response type for records list by bond-id
|
// QueryRecordByBondIdResponse is response type for records list by bond-id
|
||||||
message QueryRecordByBondIdResponse {
|
message QueryRecordByBondIDResponse {
|
||||||
repeated Record records = 1 [(gogoproto.nullable) = false];
|
repeated Record records = 1 [(gogoproto.nullable) = false];
|
||||||
// pagination defines the pagination in the response.
|
// pagination defines the pagination in the response.
|
||||||
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
||||||
|
@ -124,6 +124,7 @@ func (m *memEventBus) closeAllSubscribers(name string) {
|
|||||||
subsribers := m.subscribers[name]
|
subsribers := m.subscribers[name]
|
||||||
delete(m.subscribers, name)
|
delete(m.subscribers, name)
|
||||||
|
|
||||||
|
// #nosec G705
|
||||||
for _, sub := range subsribers {
|
for _, sub := range subsribers {
|
||||||
close(sub)
|
close(sub)
|
||||||
}
|
}
|
||||||
@ -134,6 +135,7 @@ func (m *memEventBus) publishAllSubscribers(name string, msg coretypes.ResultEve
|
|||||||
subsribers := m.subscribers[name]
|
subsribers := m.subscribers[name]
|
||||||
m.subscribersMux.RUnlock()
|
m.subscribersMux.RUnlock()
|
||||||
|
|
||||||
|
// #nosec G705
|
||||||
for _, sub := range subsribers {
|
for _, sub := range subsribers {
|
||||||
select {
|
select {
|
||||||
case sub <- msg:
|
case sub <- msg:
|
||||||
|
@ -6,7 +6,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"runtime"
|
"runtime" // #nosec G702
|
||||||
"runtime/debug"
|
"runtime/debug"
|
||||||
"runtime/pprof"
|
"runtime/pprof"
|
||||||
"sync"
|
"sync"
|
||||||
|
@ -102,6 +102,7 @@ func (api *PublicFilterAPI) timeoutLoop() {
|
|||||||
for {
|
for {
|
||||||
<-ticker.C
|
<-ticker.C
|
||||||
api.filtersMu.Lock()
|
api.filtersMu.Lock()
|
||||||
|
// #nosec G705
|
||||||
for id, f := range api.filters {
|
for id, f := range api.filters {
|
||||||
select {
|
select {
|
||||||
case <-f.deadline.C:
|
case <-f.deadline.C:
|
||||||
|
@ -240,6 +240,7 @@ func (es *EventSystem) eventLoop() {
|
|||||||
delete(es.index[f.typ], f.id)
|
delete(es.index[f.typ], f.id)
|
||||||
|
|
||||||
var channelInUse bool
|
var channelInUse bool
|
||||||
|
// #nosec G705
|
||||||
for _, sub := range es.index[f.typ] {
|
for _, sub := range es.index[f.typ] {
|
||||||
if sub.event == f.event {
|
if sub.event == f.event {
|
||||||
channelInUse = true
|
channelInUse = true
|
||||||
|
@ -173,6 +173,7 @@ func (s *websocketsServer) readLoop(wsConn *wsConn) {
|
|||||||
subscriptions := make(map[rpc.ID]pubsub.UnsubscribeFunc)
|
subscriptions := make(map[rpc.ID]pubsub.UnsubscribeFunc)
|
||||||
defer func() {
|
defer func() {
|
||||||
// cancel all subscriptions when connection closed
|
// cancel all subscriptions when connection closed
|
||||||
|
// #nosec G705
|
||||||
for _, unsubFn := range subscriptions {
|
for _, unsubFn := range subscriptions {
|
||||||
unsubFn()
|
unsubFn()
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,6 @@ func call(t *testing.T, method string, params interface{}) *Response {
|
|||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
time.Sleep(1 * time.Second)
|
time.Sleep(1 * time.Second)
|
||||||
/* #nosec */
|
|
||||||
res, err := http.Post(HOST, "application/json", bytes.NewBuffer(req))
|
res, err := http.Post(HOST, "application/json", bytes.NewBuffer(req))
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
@ -110,7 +109,6 @@ func callWithError(method string, params interface{}) (*Response, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
time.Sleep(1 * time.Second)
|
time.Sleep(1 * time.Second)
|
||||||
/* #nosec */
|
|
||||||
res, err := http.Post(HOST, "application/json", bytes.NewBuffer(req))
|
res, err := http.Post(HOST, "application/json", bytes.NewBuffer(req))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -246,7 +244,6 @@ func TestEth_GetFilterChanges_WrongID(t *testing.T) {
|
|||||||
req, err := json.Marshal(createRequest("eth_getFilterChanges", []string{"0x1122334400000077"}))
|
req, err := json.Marshal(createRequest("eth_getFilterChanges", []string{"0x1122334400000077"}))
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
/* #nosec */
|
|
||||||
res, err := http.Post(HOST, "application/json", bytes.NewBuffer(req))
|
res, err := http.Post(HOST, "application/json", bytes.NewBuffer(req))
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
@ -3,13 +3,14 @@ package rpc
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/gorilla/websocket"
|
|
||||||
"github.com/stretchr/testify/require"
|
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/gorilla/websocket"
|
||||||
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -11,10 +11,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
_ authtypes.AccountI = (*EthAccount)(nil)
|
_ authtypes.AccountI = (*EthAccount)(nil) //nolint: all
|
||||||
_ EthAccountI = (*EthAccount)(nil)
|
_ EthAccountI = (*EthAccount)(nil) //nolint: all
|
||||||
_ authtypes.GenesisAccount = (*EthAccount)(nil)
|
_ authtypes.GenesisAccount = (*EthAccount)(nil) //nolint: all
|
||||||
_ codectypes.UnpackInterfacesMessage = (*EthAccount)(nil)
|
_ codectypes.UnpackInterfacesMessage = (*EthAccount)(nil) //nolint: all
|
||||||
)
|
)
|
||||||
|
|
||||||
var emptyCodeHash = crypto.Keccak256(nil)
|
var emptyCodeHash = crypto.Keccak256(nil)
|
||||||
|
@ -8,7 +8,6 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"github.com/ipfs/go-cid"
|
|
||||||
"github.com/ipld/go-ipld-prime/codec/dagcbor"
|
"github.com/ipld/go-ipld-prime/codec/dagcbor"
|
||||||
"github.com/ipld/go-ipld-prime/fluent"
|
"github.com/ipld/go-ipld-prime/fluent"
|
||||||
"github.com/ipld/go-ipld-prime/linking"
|
"github.com/ipld/go-ipld-prime/linking"
|
||||||
@ -17,6 +16,7 @@ import (
|
|||||||
"github.com/ipld/go-ipld-prime/storage/memstore"
|
"github.com/ipld/go-ipld-prime/storage/memstore"
|
||||||
|
|
||||||
canonicalJson "github.com/gibson042/canonicaljson-go"
|
canonicalJson "github.com/gibson042/canonicaljson-go"
|
||||||
|
"github.com/ipfs/go-cid"
|
||||||
cbor "github.com/ipfs/go-ipld-cbor"
|
cbor "github.com/ipfs/go-ipld-cbor"
|
||||||
basicnode "github.com/ipld/go-ipld-prime/node/basic"
|
basicnode "github.com/ipld/go-ipld-prime/node/basic"
|
||||||
mh "github.com/multiformats/go-multihash"
|
mh "github.com/multiformats/go-multihash"
|
||||||
@ -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
|
||||||
@ -81,7 +80,7 @@ func CIDFromJSONBytesUsingIpldPrime(content []byte) (string, error) {
|
|||||||
// This gathers together any parameters that might be needed when making a link.
|
// This gathers together any parameters that might be needed when making a link.
|
||||||
// (For CIDs, the version, the codec, and the multihash type are all parameters we'll need.)
|
// (For CIDs, the version, the codec, and the multihash type are all parameters we'll need.)
|
||||||
// Often, you can probably make this a constant for your whole application.
|
// Often, you can probably make this a constant for your whole application.
|
||||||
lp := cidlink.LinkPrototype{Prefix: cid.Prefix{
|
lp := cidlink.LinkPrototype{Prefix: cid.Prefix{ //nolint:golint
|
||||||
Version: 1, // Usually '1'.
|
Version: 1, // Usually '1'.
|
||||||
Codec: 0x71, // 0x71 means "dag-cbor" -- See the multicodecs table: https://github.com/multiformats/multicodec/
|
Codec: 0x71, // 0x71 means "dag-cbor" -- See the multicodecs table: https://github.com/multiformats/multicodec/
|
||||||
MhType: 0x12, // 0x12 means "sha2-256" -- See the multicodecs table: https://github.com/multiformats/multicodec/
|
MhType: 0x12, // 0x12 means "sha2-256" -- See the multicodecs table: https://github.com/multiformats/multicodec/
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
@ -12,10 +12,13 @@ import (
|
|||||||
set "github.com/deckarep/golang-set"
|
set "github.com/deckarep/golang-set"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Int64ToBytes(num int64) []byte {
|
func Int64ToBytes(num int64) ([]byte, error) {
|
||||||
buf := new(bytes.Buffer)
|
buf := new(bytes.Buffer)
|
||||||
binary.Write(buf, binary.BigEndian, num)
|
if err := binary.Write(buf, binary.BigEndian, num); err != nil {
|
||||||
return buf.Bytes()
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return buf.Bytes(), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetToSlice(set set.Set) []string {
|
func SetToSlice(set set.Set) []string {
|
||||||
|
@ -2,7 +2,7 @@ package version
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"runtime"
|
"runtime" // #nosec G702
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -134,7 +134,10 @@ func GetCmdCommitBid() *cobra.Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Save reveal file.
|
// Save reveal file.
|
||||||
ioutil.WriteFile(fmt.Sprintf("%s-%s.json", clientCtx.GetFromName(), commitHash), content, 0600)
|
err = ioutil.WriteFile(fmt.Sprintf("%s-%s.json", clientCtx.GetFromName(), commitHash), content, 0o600)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
msg := types.NewMsgCommitBid(auctionID, commitHash, clientCtx.GetFromAddress())
|
msg := types.NewMsgCommitBid(auctionID, commitHash, clientCtx.GetFromAddress())
|
||||||
err = msg.ValidateBasic()
|
err = msg.ValidateBasic()
|
||||||
@ -166,7 +169,7 @@ func GetCmdRevealBid() *cobra.Command {
|
|||||||
auctionID := args[0]
|
auctionID := args[0]
|
||||||
revealFilePath := args[1]
|
revealFilePath := args[1]
|
||||||
|
|
||||||
revealBytes, err := ioutil.ReadFile(revealFilePath)
|
revealBytes, err := ioutil.ReadFile(revealFilePath) // #nosec G304
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ func NewIntegrationTestSuite(cfg network.Config) *IntegrationTestSuite {
|
|||||||
return &IntegrationTestSuite{cfg: cfg}
|
return &IntegrationTestSuite{cfg: cfg}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *IntegrationTestSuite) SetupSuite() {
|
func (s *IntegrationTestSuite) SetupSuite() { //nolint: all
|
||||||
s.T().Log("setting up integration test suite")
|
s.T().Log("setting up integration test suite")
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
|
@ -16,7 +16,7 @@ const (
|
|||||||
func (suite *IntegrationTestSuite) TestGetAllAuctionsGrpc() {
|
func (suite *IntegrationTestSuite) TestGetAllAuctionsGrpc() {
|
||||||
val := suite.network.Validators[0]
|
val := suite.network.Validators[0]
|
||||||
sr := suite.Require()
|
sr := suite.Require()
|
||||||
reqUrl := fmt.Sprintf("%s/vulcanize/auction/v1beta1/auctions", val.APIAddress)
|
reqURL := fmt.Sprintf("%s/vulcanize/auction/v1beta1/auctions", val.APIAddress)
|
||||||
|
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
msg string
|
msg string
|
||||||
@ -26,13 +26,13 @@ func (suite *IntegrationTestSuite) TestGetAllAuctionsGrpc() {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"invalid request to get all auctions",
|
"invalid request to get all auctions",
|
||||||
reqUrl + randomAuctionID,
|
reqURL + randomAuctionID,
|
||||||
"",
|
"",
|
||||||
true,
|
true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"valid request to get all auctions",
|
"valid request to get all auctions",
|
||||||
reqUrl,
|
reqURL,
|
||||||
"",
|
"",
|
||||||
false,
|
false,
|
||||||
},
|
},
|
||||||
@ -46,6 +46,7 @@ func (suite *IntegrationTestSuite) TestGetAllAuctionsGrpc() {
|
|||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
var auctions auctiontypes.AuctionsResponse
|
var auctions auctiontypes.AuctionsResponse
|
||||||
err = val.ClientCtx.Codec.UnmarshalJSON(resp, &auctions)
|
err = val.ClientCtx.Codec.UnmarshalJSON(resp, &auctions)
|
||||||
|
sr.NoError(err)
|
||||||
sr.NotZero(len(auctions.Auctions.Auctions))
|
sr.NotZero(len(auctions.Auctions.Auctions))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -55,10 +56,10 @@ func (suite *IntegrationTestSuite) TestGetAllAuctionsGrpc() {
|
|||||||
func (suite *IntegrationTestSuite) TestQueryParamsGrpc() {
|
func (suite *IntegrationTestSuite) TestQueryParamsGrpc() {
|
||||||
val := suite.network.Validators[0]
|
val := suite.network.Validators[0]
|
||||||
sr := suite.Require()
|
sr := suite.Require()
|
||||||
reqUrl := fmt.Sprintf("%s/vulcanize/auction/v1beta1/params", val.APIAddress)
|
reqURL := fmt.Sprintf("%s/vulcanize/auction/v1beta1/params", val.APIAddress)
|
||||||
|
|
||||||
suite.Run("valid request to get auction params", func() {
|
suite.Run("valid request to get auction params", func() {
|
||||||
resp, err := rest.GetRequest(reqUrl)
|
resp, err := rest.GetRequest(reqURL)
|
||||||
suite.Require().NoError(err)
|
suite.Require().NoError(err)
|
||||||
|
|
||||||
var params auctiontypes.QueryParamsResponse
|
var params auctiontypes.QueryParamsResponse
|
||||||
@ -72,7 +73,7 @@ func (suite *IntegrationTestSuite) TestQueryParamsGrpc() {
|
|||||||
func (suite *IntegrationTestSuite) TestGetAuctionGrpc() {
|
func (suite *IntegrationTestSuite) TestGetAuctionGrpc() {
|
||||||
val := suite.network.Validators[0]
|
val := suite.network.Validators[0]
|
||||||
sr := suite.Require()
|
sr := suite.Require()
|
||||||
reqUrl := fmt.Sprintf("%s/vulcanize/auction/v1beta1/auctions/", val.APIAddress)
|
reqURL := fmt.Sprintf("%s/vulcanize/auction/v1beta1/auctions/", val.APIAddress)
|
||||||
|
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
msg string
|
msg string
|
||||||
@ -83,14 +84,14 @@ func (suite *IntegrationTestSuite) TestGetAuctionGrpc() {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"invalid request to get an auction",
|
"invalid request to get an auction",
|
||||||
reqUrl + randomAuctionID,
|
reqURL + randomAuctionID,
|
||||||
"",
|
"",
|
||||||
true,
|
true,
|
||||||
func() string { return "" },
|
func() string { return "" },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"valid request to get an auction",
|
"valid request to get an auction",
|
||||||
reqUrl,
|
reqURL,
|
||||||
"",
|
"",
|
||||||
false,
|
false,
|
||||||
func() string { return suite.defaultAuctionID },
|
func() string { return suite.defaultAuctionID },
|
||||||
@ -116,7 +117,7 @@ func (suite *IntegrationTestSuite) TestGetAuctionGrpc() {
|
|||||||
func (suite *IntegrationTestSuite) TestGetBidsGrpc() {
|
func (suite *IntegrationTestSuite) TestGetBidsGrpc() {
|
||||||
val := suite.network.Validators[0]
|
val := suite.network.Validators[0]
|
||||||
sr := suite.Require()
|
sr := suite.Require()
|
||||||
reqUrl := fmt.Sprintf("%s/vulcanize/auction/v1beta1/bids/", val.APIAddress)
|
reqURL := fmt.Sprintf("%s/vulcanize/auction/v1beta1/bids/", val.APIAddress)
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
msg string
|
msg string
|
||||||
url string
|
url string
|
||||||
@ -126,14 +127,14 @@ func (suite *IntegrationTestSuite) TestGetBidsGrpc() {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"invalid request to get all bids",
|
"invalid request to get all bids",
|
||||||
reqUrl,
|
reqURL,
|
||||||
"",
|
"",
|
||||||
true,
|
true,
|
||||||
func() string { return "" },
|
func() string { return "" },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"valid request to get all bids",
|
"valid request to get all bids",
|
||||||
reqUrl,
|
reqURL,
|
||||||
"",
|
"",
|
||||||
false,
|
false,
|
||||||
func() string { return suite.createAuctionAndBid(false, true) },
|
func() string { return suite.createAuctionAndBid(false, true) },
|
||||||
@ -161,7 +162,7 @@ func (suite *IntegrationTestSuite) TestGetBidsGrpc() {
|
|||||||
func (suite *IntegrationTestSuite) TestGetBidGrpc() {
|
func (suite *IntegrationTestSuite) TestGetBidGrpc() {
|
||||||
val := suite.network.Validators[0]
|
val := suite.network.Validators[0]
|
||||||
sr := suite.Require()
|
sr := suite.Require()
|
||||||
reqUrl := fmt.Sprintf("%s/vulcanize/auction/v1beta1/bids/", val.APIAddress)
|
reqURL := fmt.Sprintf("%s/vulcanize/auction/v1beta1/bids/", val.APIAddress)
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
msg string
|
msg string
|
||||||
url string
|
url string
|
||||||
@ -170,13 +171,13 @@ func (suite *IntegrationTestSuite) TestGetBidGrpc() {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"invalid request to get bid",
|
"invalid request to get bid",
|
||||||
fmt.Sprintf("%s/%s/", reqUrl, randomAuctionID),
|
fmt.Sprintf("%s/%s/", reqURL, randomAuctionID),
|
||||||
"",
|
"",
|
||||||
true,
|
true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"valid request to get bid",
|
"valid request to get bid",
|
||||||
fmt.Sprintf("%s/%s/%s", reqUrl, randomAuctionID, randomBidderAddress),
|
fmt.Sprintf("%s/%s/%s", reqURL, randomAuctionID, randomBidderAddress),
|
||||||
"",
|
"",
|
||||||
false,
|
false,
|
||||||
},
|
},
|
||||||
@ -199,7 +200,7 @@ func (suite *IntegrationTestSuite) TestGetBidGrpc() {
|
|||||||
func (suite *IntegrationTestSuite) TestGetAuctionsByOwnerGrpc() {
|
func (suite *IntegrationTestSuite) TestGetAuctionsByOwnerGrpc() {
|
||||||
val := suite.network.Validators[0]
|
val := suite.network.Validators[0]
|
||||||
sr := suite.Require()
|
sr := suite.Require()
|
||||||
reqUrl := fmt.Sprintf("%s/vulcanize/auction/v1beta1/by-owner/", val.APIAddress)
|
reqURL := fmt.Sprintf("%s/vulcanize/auction/v1beta1/by-owner/", val.APIAddress)
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
msg string
|
msg string
|
||||||
url string
|
url string
|
||||||
@ -208,13 +209,13 @@ func (suite *IntegrationTestSuite) TestGetAuctionsByOwnerGrpc() {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"invalid request to get auctions by owner",
|
"invalid request to get auctions by owner",
|
||||||
reqUrl,
|
reqURL,
|
||||||
"",
|
"",
|
||||||
true,
|
true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"valid request to get auctions by owner",
|
"valid request to get auctions by owner",
|
||||||
fmt.Sprintf("%s/%s", reqUrl, randomOwnerAddress),
|
fmt.Sprintf("%s/%s", reqURL, randomOwnerAddress),
|
||||||
"",
|
"",
|
||||||
false,
|
false,
|
||||||
},
|
},
|
||||||
@ -237,13 +238,13 @@ func (suite *IntegrationTestSuite) TestGetAuctionsByOwnerGrpc() {
|
|||||||
func (suite *IntegrationTestSuite) TestQueryBalanceGrpc() {
|
func (suite *IntegrationTestSuite) TestQueryBalanceGrpc() {
|
||||||
val := suite.network.Validators[0]
|
val := suite.network.Validators[0]
|
||||||
sr := suite.Require()
|
sr := suite.Require()
|
||||||
reqUrl := fmt.Sprintf("%s/vulcanize/auction/v1beta1/balance", val.APIAddress)
|
reqURL := fmt.Sprintf("%s/vulcanize/auction/v1beta1/balance", val.APIAddress)
|
||||||
msg := "valid request to get the auction module balance"
|
msg := "valid request to get the auction module balance"
|
||||||
|
|
||||||
suite.createAuctionAndBid(false, true)
|
suite.createAuctionAndBid(false, true)
|
||||||
|
|
||||||
suite.Run(msg, func() {
|
suite.Run(msg, func() {
|
||||||
resp, err := rest.GetRequest(reqUrl)
|
resp, err := rest.GetRequest(reqURL)
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
|
|
||||||
var response auctiontypes.BalanceResponse
|
var response auctiontypes.BalanceResponse
|
||||||
|
@ -274,7 +274,7 @@ func (suite *IntegrationTestSuite) TestGetCmdAuctionsByBidder() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (suite IntegrationTestSuite) createAuctionAndBid(createAuction, createBid bool) string {
|
func (suite *IntegrationTestSuite) createAuctionAndBid(createAuction, createBid bool) string {
|
||||||
val := suite.network.Validators[0]
|
val := suite.network.Validators[0]
|
||||||
sr := suite.Require()
|
sr := suite.Require()
|
||||||
auctionID := ""
|
auctionID := ""
|
||||||
|
@ -27,9 +27,10 @@ func ExportGenesis(ctx sdk.Context, keeper keeper.Keeper) types.GenesisState {
|
|||||||
params := keeper.GetParams(ctx)
|
params := keeper.GetParams(ctx)
|
||||||
auctions := keeper.ListAuctions(ctx)
|
auctions := keeper.ListAuctions(ctx)
|
||||||
|
|
||||||
var genesisAuctions []*types.Auction
|
genesisAuctions := []*types.Auction{}
|
||||||
for _, auction := range auctions {
|
for _, auction := range auctions {
|
||||||
genesisAuctions = append(genesisAuctions, &auction)
|
// #nosec G601
|
||||||
|
genesisAuctions = append(genesisAuctions, &auction) //nolint: all
|
||||||
}
|
}
|
||||||
return types.GenesisState{Params: params, Auctions: genesisAuctions}
|
return types.GenesisState{Params: params, Auctions: genesisAuctions}
|
||||||
}
|
}
|
||||||
|
@ -13,9 +13,7 @@ import (
|
|||||||
|
|
||||||
const testCommitHash = "71D8CF34026E32A3A34C2C2D4ADF25ABC8D7943A4619761BE27F196603D91B9D"
|
const testCommitHash = "71D8CF34026E32A3A34C2C2D4ADF25ABC8D7943A4619761BE27F196603D91B9D"
|
||||||
|
|
||||||
var (
|
var seed = int64(233)
|
||||||
seed = int64(233)
|
|
||||||
)
|
|
||||||
|
|
||||||
func (suite *KeeperTestSuite) TestGrpcGetAllAuctions() {
|
func (suite *KeeperTestSuite) TestGrpcGetAllAuctions() {
|
||||||
client, ctx, k := suite.queryClient, suite.ctx, suite.app.AuctionKeeper
|
client, ctx, k := suite.queryClient, suite.ctx, suite.app.AuctionKeeper
|
||||||
|
@ -99,7 +99,7 @@ func GetBidIndexKey(auctionID string, bidder string) []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func GetAuctionBidsIndexPrefix(auctionID string) []byte {
|
func GetAuctionBidsIndexPrefix(auctionID string) []byte {
|
||||||
return append(append(PrefixAuctionBidsIndex, []byte(auctionID)...))
|
return append(PrefixAuctionBidsIndex, []byte(auctionID)...)
|
||||||
}
|
}
|
||||||
|
|
||||||
// SaveAuction - saves a auction to the store.
|
// SaveAuction - saves a auction to the store.
|
||||||
@ -226,7 +226,7 @@ func (k Keeper) ListAuctions(ctx sdk.Context) []types.Auction {
|
|||||||
func (k Keeper) QueryAuctionsByOwner(ctx sdk.Context, ownerAddress string) []types.Auction {
|
func (k Keeper) QueryAuctionsByOwner(ctx sdk.Context, ownerAddress string) []types.Auction {
|
||||||
auctions := []types.Auction{}
|
auctions := []types.Auction{}
|
||||||
|
|
||||||
ownerPrefix := append(prefixOwnerToAuctionsIndex, []byte(ownerAddress)...)
|
ownerPrefix := append(prefixOwnerToAuctionsIndex, []byte(ownerAddress)...) //nolint: all
|
||||||
store := ctx.KVStore(k.storeKey)
|
store := ctx.KVStore(k.storeKey)
|
||||||
itr := sdk.KVStorePrefixIterator(store, ownerPrefix)
|
itr := sdk.KVStorePrefixIterator(store, ownerPrefix)
|
||||||
defer itr.Close()
|
defer itr.Close()
|
||||||
@ -247,9 +247,9 @@ func (k Keeper) QueryAuctionsByOwner(ctx sdk.Context, ownerAddress string) []typ
|
|||||||
func (k Keeper) QueryAuctionsByBidder(ctx sdk.Context, bidderAddress string) []types.Auction {
|
func (k Keeper) QueryAuctionsByBidder(ctx sdk.Context, bidderAddress string) []types.Auction {
|
||||||
auctions := []types.Auction{}
|
auctions := []types.Auction{}
|
||||||
|
|
||||||
bidderPrefix := append(PrefixBidderToAuctionsIndex, []byte(bidderAddress)...)
|
bidderPrefix := append(PrefixBidderToAuctionsIndex, []byte(bidderAddress)...) //nolint: all
|
||||||
store := ctx.KVStore(k.storeKey)
|
store := ctx.KVStore(k.storeKey)
|
||||||
itr := sdk.KVStorePrefixIterator(store, []byte(bidderPrefix))
|
itr := sdk.KVStorePrefixIterator(store, bidderPrefix)
|
||||||
defer itr.Close()
|
defer itr.Close()
|
||||||
for ; itr.Valid(); itr.Next() {
|
for ; itr.Valid(); itr.Next() {
|
||||||
auctionID := itr.Key()[len(bidderPrefix):]
|
auctionID := itr.Key()[len(bidderPrefix):]
|
||||||
@ -312,8 +312,8 @@ func (k Keeper) CreateAuction(ctx sdk.Context, msg types.MsgCreateAuction) (*typ
|
|||||||
|
|
||||||
// Compute timestamps.
|
// Compute timestamps.
|
||||||
now := ctx.BlockTime()
|
now := ctx.BlockTime()
|
||||||
commitsEndTime := now.Add(time.Duration(msg.CommitsDuration))
|
commitsEndTime := now.Add(msg.CommitsDuration)
|
||||||
revealsEndTime := now.Add(time.Duration(msg.CommitsDuration + msg.RevealsDuration))
|
revealsEndTime := now.Add(msg.CommitsDuration + msg.RevealsDuration)
|
||||||
|
|
||||||
auction := types.Auction{
|
auction := types.Auction{
|
||||||
Id: auctionID,
|
Id: auctionID,
|
||||||
@ -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.")
|
||||||
@ -553,6 +553,7 @@ func (k Keeper) pickAuctionWinner(ctx sdk.Context, auction *types.Auction) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//nolint: all
|
||||||
if highestBid.BidAmount.IsLT(bid.BidAmount) {
|
if highestBid.BidAmount.IsLT(bid.BidAmount) {
|
||||||
ctx.Logger().Info(fmt.Sprintf("New highest bid %s %s", bid.BidderAddress, bid.BidAmount.String()))
|
ctx.Logger().Info(fmt.Sprintf("New highest bid %s %s", bid.BidderAddress, bid.BidAmount.String()))
|
||||||
|
|
||||||
@ -637,7 +638,7 @@ func (k Keeper) pickAuctionWinner(ctx sdk.Context, auction *types.Auction) {
|
|||||||
// Burn anything over the min. bid amount.
|
// Burn anything over the min. bid amount.
|
||||||
amountToBurn := auction.WinningPrice.Sub(auction.MinimumBid)
|
amountToBurn := auction.WinningPrice.Sub(auction.MinimumBid)
|
||||||
if amountToBurn.IsNegative() {
|
if amountToBurn.IsNegative() {
|
||||||
ctx.Logger().Error(fmt.Sprintf("Auction coins to burn cannot be negative."))
|
ctx.Logger().Error("Auction coins to burn cannot be negative.")
|
||||||
panic("Auction coins to burn cannot be negative.")
|
panic("Auction coins to burn cannot be negative.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,6 +50,7 @@ func (s msgServer) CreateAuction(c context.Context, msg *types.MsgCreateAuction)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CommitBid is the command for committing a bid
|
// CommitBid is the command for committing a bid
|
||||||
|
//nolint: all
|
||||||
func (s msgServer) CommitBid(c context.Context, msg *types.MsgCommitBid) (*types.MsgCommitBidResponse, error) {
|
func (s msgServer) CommitBid(c context.Context, msg *types.MsgCommitBid) (*types.MsgCommitBidResponse, error) {
|
||||||
ctx := sdk.UnwrapSDKContext(c)
|
ctx := sdk.UnwrapSDKContext(c)
|
||||||
|
|
||||||
@ -80,6 +81,7 @@ func (s msgServer) CommitBid(c context.Context, msg *types.MsgCommitBid) (*types
|
|||||||
}
|
}
|
||||||
|
|
||||||
//RevealBid is the command for revealing a bid
|
//RevealBid is the command for revealing a bid
|
||||||
|
//nolint: all
|
||||||
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)
|
||||||
|
|
||||||
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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,
|
||||||
|
@ -24,7 +24,7 @@ func GetQueryCmd() *cobra.Command {
|
|||||||
bondQueryCmd.AddCommand(
|
bondQueryCmd.AddCommand(
|
||||||
GetQueryParamsCmd(),
|
GetQueryParamsCmd(),
|
||||||
GetQueryBondLists(),
|
GetQueryBondLists(),
|
||||||
GetBondByIdCmd(),
|
GetBondByIDCmd(),
|
||||||
GetBondListByOwnerCmd(),
|
GetBondListByOwnerCmd(),
|
||||||
GetBondModuleBalanceCmd(),
|
GetBondModuleBalanceCmd(),
|
||||||
)
|
)
|
||||||
@ -99,7 +99,7 @@ $ %s query %s list
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetBondByIdCmd implements the bond info by id query command.
|
// GetBondByIdCmd implements the bond info by id query command.
|
||||||
func GetBondByIdCmd() *cobra.Command {
|
func GetBondByIDCmd() *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "get [bond Id]",
|
Use: "get [bond Id]",
|
||||||
Short: "Get bond.",
|
Short: "Get bond.",
|
||||||
@ -122,7 +122,7 @@ $ %s query bond get {BOND ID}
|
|||||||
|
|
||||||
id := args[0]
|
id := args[0]
|
||||||
|
|
||||||
res, err := queryClient.GetBondById(cmd.Context(), &types.QueryGetBondByIdRequest{Id: id})
|
res, err := queryClient.GetBondByID(cmd.Context(), &types.QueryGetBondByIDRequest{Id: id})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ func NewCreateBondCmd() *cobra.Command {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
flags.AddTxFlags(cmd)
|
cmd, _ = flags.AddTxFlags(cmd)
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,18 +65,18 @@ func RefillBondCmd() *cobra.Command {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
bondId := args[0]
|
bondID := args[0]
|
||||||
coin, err := sdk.ParseCoinNormalized(args[1])
|
coin, err := sdk.ParseCoinNormalized(args[1])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
msg := types.NewMsgRefillBond(bondId, coin, clientCtx.GetFromAddress())
|
msg := types.NewMsgRefillBond(bondID, coin, clientCtx.GetFromAddress())
|
||||||
return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg)
|
return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
flags.AddTxFlags(cmd)
|
|
||||||
|
|
||||||
|
cmd, _ = flags.AddTxFlags(cmd)
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,22 +91,22 @@ func WithdrawBondCmd() *cobra.Command {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
bondId := args[0]
|
bondID := args[0]
|
||||||
coin, err := sdk.ParseCoinNormalized(args[1])
|
coin, err := sdk.ParseCoinNormalized(args[1])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
msg := types.NewMsgWithdrawBond(bondId, coin, clientCtx.GetFromAddress())
|
msg := types.NewMsgWithdrawBond(bondID, coin, clientCtx.GetFromAddress())
|
||||||
return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg)
|
return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
flags.AddTxFlags(cmd)
|
|
||||||
|
|
||||||
|
cmd, _ = flags.AddTxFlags(cmd)
|
||||||
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]",
|
||||||
@ -117,11 +117,12 @@ func CancelBondCmd() *cobra.Command {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
bondId := args[0]
|
bondID := args[0]
|
||||||
msg := types.NewMsgCancelBond(bondId, clientCtx.GetFromAddress())
|
msg := types.NewMsgCancelBond(bondID, clientCtx.GetFromAddress())
|
||||||
return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg)
|
return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
flags.AddTxFlags(cmd)
|
|
||||||
|
cmd, _ = flags.AddTxFlags(cmd)
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ import (
|
|||||||
func (s *IntegrationTestSuite) TestGRPCGetBonds() {
|
func (s *IntegrationTestSuite) TestGRPCGetBonds() {
|
||||||
val := s.network.Validators[0]
|
val := s.network.Validators[0]
|
||||||
sr := s.Require()
|
sr := s.Require()
|
||||||
reqUrl := fmt.Sprintf("%s/vulcanize/bond/v1beta1/bonds", val.APIAddress)
|
reqURL := fmt.Sprintf("%s/vulcanize/bond/v1beta1/bonds", val.APIAddress)
|
||||||
|
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
name string
|
name string
|
||||||
@ -24,16 +24,15 @@ func (s *IntegrationTestSuite) TestGRPCGetBonds() {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"invalid request with headers",
|
"invalid request with headers",
|
||||||
reqUrl + "asdasdas",
|
reqURL + "asdasdas",
|
||||||
true,
|
true,
|
||||||
"",
|
"",
|
||||||
func() {
|
func() {
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"valid request",
|
"valid request",
|
||||||
reqUrl,
|
reqURL,
|
||||||
false,
|
false,
|
||||||
"",
|
"",
|
||||||
func() {
|
func() {
|
||||||
@ -59,9 +58,9 @@ func (s *IntegrationTestSuite) TestGRPCGetBonds() {
|
|||||||
func (s *IntegrationTestSuite) TestGRPCGetParams() {
|
func (s *IntegrationTestSuite) TestGRPCGetParams() {
|
||||||
val := s.network.Validators[0]
|
val := s.network.Validators[0]
|
||||||
sr := s.Require()
|
sr := s.Require()
|
||||||
reqUrl := fmt.Sprintf("%s/vulcanize/bond/v1beta1/params", val.APIAddress)
|
reqURL := fmt.Sprintf("%s/vulcanize/bond/v1beta1/params", val.APIAddress)
|
||||||
|
|
||||||
resp, err := rest.GetRequest(reqUrl)
|
resp, err := rest.GetRequest(reqURL)
|
||||||
s.Require().NoError(err)
|
s.Require().NoError(err)
|
||||||
|
|
||||||
var params bondtypes.QueryParamsResponse
|
var params bondtypes.QueryParamsResponse
|
||||||
@ -74,7 +73,7 @@ func (s *IntegrationTestSuite) TestGRPCGetParams() {
|
|||||||
func (s *IntegrationTestSuite) TestGRPCGetBondsByOwner() {
|
func (s *IntegrationTestSuite) TestGRPCGetBondsByOwner() {
|
||||||
val := s.network.Validators[0]
|
val := s.network.Validators[0]
|
||||||
sr := s.Require()
|
sr := s.Require()
|
||||||
reqUrl := val.APIAddress + "/vulcanize/bond/v1beta1/by-owner/%s"
|
reqURL := val.APIAddress + "/vulcanize/bond/v1beta1/by-owner/%s"
|
||||||
|
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
name string
|
name string
|
||||||
@ -84,15 +83,14 @@ func (s *IntegrationTestSuite) TestGRPCGetBondsByOwner() {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"empty list",
|
"empty list",
|
||||||
fmt.Sprintf(reqUrl, "asdasd"),
|
fmt.Sprintf(reqURL, "asdasd"),
|
||||||
true,
|
true,
|
||||||
func() {
|
func() {
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"valid request",
|
"valid request",
|
||||||
fmt.Sprintf(reqUrl, s.accountAddress),
|
fmt.Sprintf(reqURL, s.accountAddress),
|
||||||
false,
|
false,
|
||||||
func() {
|
func() {
|
||||||
s.createBond()
|
s.createBond()
|
||||||
@ -123,10 +121,10 @@ func (s *IntegrationTestSuite) TestGRPCGetBondsByOwner() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *IntegrationTestSuite) TestGRPCGetBondById() {
|
func (s *IntegrationTestSuite) TestGRPCGetBondByID() {
|
||||||
val := s.network.Validators[0]
|
val := s.network.Validators[0]
|
||||||
sr := s.Require()
|
sr := s.Require()
|
||||||
reqUrl := val.APIAddress + "/vulcanize/bond/v1beta1/bonds/%s"
|
reqURL := val.APIAddress + "/vulcanize/bond/v1beta1/bonds/%s"
|
||||||
|
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
name string
|
name string
|
||||||
@ -136,7 +134,7 @@ func (s *IntegrationTestSuite) TestGRPCGetBondById() {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"invalid request",
|
"invalid request",
|
||||||
fmt.Sprintf(reqUrl, "asdadad"),
|
fmt.Sprintf(reqURL, "asdadad"),
|
||||||
true,
|
true,
|
||||||
func() string {
|
func() string {
|
||||||
return ""
|
return ""
|
||||||
@ -144,7 +142,7 @@ func (s *IntegrationTestSuite) TestGRPCGetBondById() {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"valid request",
|
"valid request",
|
||||||
reqUrl,
|
reqURL,
|
||||||
false,
|
false,
|
||||||
func() string {
|
func() string {
|
||||||
// creating the bond
|
// creating the bond
|
||||||
@ -164,30 +162,30 @@ func (s *IntegrationTestSuite) TestGRPCGetBondById() {
|
|||||||
|
|
||||||
// extract bond id from bonds list
|
// extract bond id from bonds list
|
||||||
bond := queryResponse.GetBonds()[0]
|
bond := queryResponse.GetBonds()[0]
|
||||||
return bond.GetId()
|
return bond.GetID()
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
s.Run(tc.name, func() {
|
s.Run(tc.name, func() {
|
||||||
var bondId string
|
var bondID string
|
||||||
if !tc.expErr {
|
if !tc.expErr {
|
||||||
bondId = tc.preRun()
|
bondID = tc.preRun()
|
||||||
tc.url = fmt.Sprintf(reqUrl, bondId)
|
tc.url = fmt.Sprintf(reqURL, bondID)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := rest.GetRequest(tc.url)
|
resp, err := rest.GetRequest(tc.url)
|
||||||
s.Require().NoError(err)
|
s.Require().NoError(err)
|
||||||
|
|
||||||
var bonds bondtypes.QueryGetBondByIdResponse
|
var bonds bondtypes.QueryGetBondByIDResponse
|
||||||
err = val.ClientCtx.Codec.UnmarshalJSON(resp, &bonds)
|
err = val.ClientCtx.Codec.UnmarshalJSON(resp, &bonds)
|
||||||
|
|
||||||
if tc.expErr {
|
if tc.expErr {
|
||||||
sr.Empty(bonds.GetBond().GetId())
|
sr.Empty(bonds.GetBond().GetID())
|
||||||
} else {
|
} else {
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
sr.NotZero(bonds.GetBond().GetId())
|
sr.NotZero(bonds.GetBond().GetID())
|
||||||
sr.Equal(bonds.GetBond().GetId(), bondId)
|
sr.Equal(bonds.GetBond().GetID(), bondID)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -196,13 +194,13 @@ func (s *IntegrationTestSuite) TestGRPCGetBondById() {
|
|||||||
func (s *IntegrationTestSuite) TestGRPCGetBondModuleBalance() {
|
func (s *IntegrationTestSuite) TestGRPCGetBondModuleBalance() {
|
||||||
val := s.network.Validators[0]
|
val := s.network.Validators[0]
|
||||||
sr := s.Require()
|
sr := s.Require()
|
||||||
reqUrl := fmt.Sprintf("%s/vulcanize/bond/v1beta1/balance", val.APIAddress)
|
reqURL := fmt.Sprintf("%s/vulcanize/bond/v1beta1/balance", val.APIAddress)
|
||||||
|
|
||||||
// creating the bond
|
// creating the bond
|
||||||
s.createBond()
|
s.createBond()
|
||||||
|
|
||||||
s.Run("valid request", func() {
|
s.Run("valid request", func() {
|
||||||
resp, err := rest.GetRequest(reqUrl)
|
resp, err := rest.GetRequest(reqURL)
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
|
|
||||||
var response bondtypes.QueryGetBondModuleBalanceResponse
|
var response bondtypes.QueryGetBondModuleBalanceResponse
|
||||||
|
@ -163,7 +163,7 @@ func (s *IntegrationTestSuite) TestGetQueryBondLists() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *IntegrationTestSuite) TestGetQueryBondById() {
|
func (s *IntegrationTestSuite) TestGetQueryBondByID() {
|
||||||
val := s.network.Validators[0]
|
val := s.network.Validators[0]
|
||||||
sr := s.Require()
|
sr := s.Require()
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
@ -205,7 +205,7 @@ func (s *IntegrationTestSuite) TestGetQueryBondById() {
|
|||||||
|
|
||||||
// extract bond id from bonds list
|
// extract bond id from bonds list
|
||||||
bond := queryResponse.GetBonds()[0]
|
bond := queryResponse.GetBonds()[0]
|
||||||
return bond.GetId()
|
return bond.GetID()
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -214,20 +214,20 @@ func (s *IntegrationTestSuite) TestGetQueryBondById() {
|
|||||||
s.Run(fmt.Sprintf("Case %s", tc.name), func() {
|
s.Run(fmt.Sprintf("Case %s", tc.name), func() {
|
||||||
clientCtx := val.ClientCtx
|
clientCtx := val.ClientCtx
|
||||||
if !tc.err {
|
if !tc.err {
|
||||||
bondId := tc.preRun()
|
bondID := tc.preRun()
|
||||||
tc.args = append([]string{bondId}, tc.args...)
|
tc.args = append([]string{bondID}, tc.args...)
|
||||||
}
|
}
|
||||||
cmd := cli.GetBondByIdCmd()
|
cmd := cli.GetBondByIDCmd()
|
||||||
|
|
||||||
out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args)
|
out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args)
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
var queryResponse types.QueryGetBondByIdResponse
|
var queryResponse types.QueryGetBondByIDResponse
|
||||||
err = clientCtx.Codec.UnmarshalJSON(out.Bytes(), &queryResponse)
|
err = clientCtx.Codec.UnmarshalJSON(out.Bytes(), &queryResponse)
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
if tc.err {
|
if tc.err {
|
||||||
sr.Zero(len(queryResponse.GetBond().GetId()))
|
sr.Zero(len(queryResponse.GetBond().GetID()))
|
||||||
} else {
|
} else {
|
||||||
sr.NotZero(len(queryResponse.GetBond().GetId()))
|
sr.NotZero(len(queryResponse.GetBond().GetID()))
|
||||||
sr.Equal(s.accountAddress, queryResponse.GetBond().GetOwner())
|
sr.Equal(s.accountAddress, queryResponse.GetBond().GetOwner())
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -251,7 +251,6 @@ func (s *IntegrationTestSuite) TestGetQueryBondListsByOwner() {
|
|||||||
},
|
},
|
||||||
true,
|
true,
|
||||||
func() {
|
func() {
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -63,6 +63,7 @@ func (s *IntegrationTestSuite) TestTxCreateBond() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//nolint: all
|
||||||
func (s *IntegrationTestSuite) TestTxRefillBond() {
|
func (s *IntegrationTestSuite) TestTxRefillBond() {
|
||||||
val := s.network.Validators[0]
|
val := s.network.Validators[0]
|
||||||
sr := s.Require()
|
sr := s.Require()
|
||||||
@ -117,7 +118,7 @@ func (s *IntegrationTestSuite) TestTxRefillBond() {
|
|||||||
|
|
||||||
// extract bond id from bonds list
|
// extract bond id from bonds list
|
||||||
bond := queryResponse.GetBonds()[0]
|
bond := queryResponse.GetBonds()[0]
|
||||||
tc.args = append([]string{bond.GetId()}, tc.args...)
|
tc.args = append([]string{bond.GetID()}, tc.args...)
|
||||||
}
|
}
|
||||||
out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args)
|
out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args)
|
||||||
if tc.err {
|
if tc.err {
|
||||||
@ -130,14 +131,14 @@ func (s *IntegrationTestSuite) TestTxRefillBond() {
|
|||||||
sr.Zero(d.Code)
|
sr.Zero(d.Code)
|
||||||
|
|
||||||
// checking the balance of bond
|
// checking the balance of bond
|
||||||
cmd := cli.GetBondByIdCmd()
|
cmd := cli.GetBondByIDCmd()
|
||||||
|
|
||||||
out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, []string{
|
out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, []string{
|
||||||
fmt.Sprintf(tc.args[0]),
|
fmt.Sprintf(tc.args[0]),
|
||||||
fmt.Sprintf("--%s=json", tmcli.OutputFlag),
|
fmt.Sprintf("--%s=json", tmcli.OutputFlag),
|
||||||
})
|
})
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
var queryResponse types.QueryGetBondByIdResponse
|
var queryResponse types.QueryGetBondByIDResponse
|
||||||
err = clientCtx.Codec.UnmarshalJSON(out.Bytes(), &queryResponse)
|
err = clientCtx.Codec.UnmarshalJSON(out.Bytes(), &queryResponse)
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
|
|
||||||
@ -148,6 +149,7 @@ func (s *IntegrationTestSuite) TestTxRefillBond() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//nolint: all
|
||||||
func (s *IntegrationTestSuite) TestTxWithdrawAmountFromBond() {
|
func (s *IntegrationTestSuite) TestTxWithdrawAmountFromBond() {
|
||||||
val := s.network.Validators[0]
|
val := s.network.Validators[0]
|
||||||
sr := s.Require()
|
sr := s.Require()
|
||||||
@ -202,7 +204,7 @@ func (s *IntegrationTestSuite) TestTxWithdrawAmountFromBond() {
|
|||||||
|
|
||||||
// extract bond id from bonds list
|
// extract bond id from bonds list
|
||||||
bond := queryResponse.GetBonds()[0]
|
bond := queryResponse.GetBonds()[0]
|
||||||
tc.args = append([]string{bond.GetId()}, tc.args...)
|
tc.args = append([]string{bond.GetID()}, tc.args...)
|
||||||
}
|
}
|
||||||
out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args)
|
out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args)
|
||||||
if tc.err {
|
if tc.err {
|
||||||
@ -215,14 +217,14 @@ func (s *IntegrationTestSuite) TestTxWithdrawAmountFromBond() {
|
|||||||
sr.Zero(d.Code)
|
sr.Zero(d.Code)
|
||||||
|
|
||||||
// checking the balance of bond
|
// checking the balance of bond
|
||||||
cmd := cli.GetBondByIdCmd()
|
cmd := cli.GetBondByIDCmd()
|
||||||
|
|
||||||
out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, []string{
|
out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, []string{
|
||||||
fmt.Sprintf(tc.args[0]),
|
fmt.Sprintf(tc.args[0]),
|
||||||
fmt.Sprintf("--%s=json", tmcli.OutputFlag),
|
fmt.Sprintf("--%s=json", tmcli.OutputFlag),
|
||||||
})
|
})
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
var queryResponse types.QueryGetBondByIdResponse
|
var queryResponse types.QueryGetBondByIDResponse
|
||||||
err = clientCtx.Codec.UnmarshalJSON(out.Bytes(), &queryResponse)
|
err = clientCtx.Codec.UnmarshalJSON(out.Bytes(), &queryResponse)
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
|
|
||||||
@ -240,7 +242,7 @@ func (s *IntegrationTestSuite) TestTxCancelBond() {
|
|||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
name string
|
name string
|
||||||
args []string
|
args []string
|
||||||
getBondId bool
|
getBondID bool
|
||||||
err bool
|
err bool
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
@ -273,7 +275,7 @@ func (s *IntegrationTestSuite) TestTxCancelBond() {
|
|||||||
s.Run(fmt.Sprintf("Case %s", tc.name), func() {
|
s.Run(fmt.Sprintf("Case %s", tc.name), func() {
|
||||||
clientCtx := val.ClientCtx
|
clientCtx := val.ClientCtx
|
||||||
cmd := cli.CancelBondCmd()
|
cmd := cli.CancelBondCmd()
|
||||||
if tc.getBondId {
|
if tc.getBondID {
|
||||||
cmd := cli.GetQueryBondLists()
|
cmd := cli.GetQueryBondLists()
|
||||||
|
|
||||||
out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, []string{
|
out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, []string{
|
||||||
@ -286,7 +288,7 @@ func (s *IntegrationTestSuite) TestTxCancelBond() {
|
|||||||
|
|
||||||
// extract bond id from bonds list
|
// extract bond id from bonds list
|
||||||
bond := queryResponse.GetBonds()[0]
|
bond := queryResponse.GetBonds()[0]
|
||||||
tc.args = append([]string{bond.GetId()}, tc.args...)
|
tc.args = append([]string{bond.GetID()}, tc.args...)
|
||||||
}
|
}
|
||||||
out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args)
|
out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args)
|
||||||
if tc.err {
|
if tc.err {
|
||||||
@ -299,18 +301,18 @@ func (s *IntegrationTestSuite) TestTxCancelBond() {
|
|||||||
sr.Zero(d.Code)
|
sr.Zero(d.Code)
|
||||||
|
|
||||||
// checking the bond exists or not after cancel
|
// checking the bond exists or not after cancel
|
||||||
cmd := cli.GetBondByIdCmd()
|
cmd := cli.GetBondByIDCmd()
|
||||||
|
|
||||||
out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, []string{
|
out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, []string{
|
||||||
fmt.Sprintf(tc.args[0]),
|
fmt.Sprintf(tc.args[0]),
|
||||||
fmt.Sprintf("--%s=json", tmcli.OutputFlag),
|
fmt.Sprintf("--%s=json", tmcli.OutputFlag),
|
||||||
})
|
})
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
var queryResponse types.QueryGetBondByIdResponse
|
var queryResponse types.QueryGetBondByIDResponse
|
||||||
err = clientCtx.Codec.UnmarshalJSON(out.Bytes(), &queryResponse)
|
err = clientCtx.Codec.UnmarshalJSON(out.Bytes(), &queryResponse)
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
|
|
||||||
sr.Zero(queryResponse.GetBond().GetId())
|
sr.Zero(queryResponse.GetBond().GetID())
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -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 {
|
||||||
|
@ -26,14 +26,14 @@ func (q Querier) Params(c context.Context, _ *types.QueryParamsRequest) (*types.
|
|||||||
return &types.QueryParamsResponse{Params: ¶ms}, nil
|
return &types.QueryParamsResponse{Params: ¶ms}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (q Querier) GetBondById(c context.Context, req *types.QueryGetBondByIdRequest) (*types.QueryGetBondByIdResponse, error) {
|
func (q Querier) GetBondByID(c context.Context, req *types.QueryGetBondByIDRequest) (*types.QueryGetBondByIDResponse, error) {
|
||||||
ctx := sdk.UnwrapSDKContext(c)
|
ctx := sdk.UnwrapSDKContext(c)
|
||||||
bondId := req.GetId()
|
bondID := req.GetID()
|
||||||
if len(bondId) == 0 {
|
if len(bondID) == 0 {
|
||||||
return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "bond id required")
|
return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "bond id required")
|
||||||
}
|
}
|
||||||
bond := q.Keeper.GetBond(ctx, req.GetId())
|
bond := q.Keeper.GetBond(ctx, req.GetID())
|
||||||
return &types.QueryGetBondByIdResponse{Bond: &bond}, nil
|
return &types.QueryGetBondByIDResponse{Bond: &bond}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (q Querier) GetBondsByOwner(c context.Context, req *types.QueryGetBondsByOwnerRequest) (*types.QueryGetBondsByOwnerResponse, error) {
|
func (q Querier) GetBondsByOwner(c context.Context, req *types.QueryGetBondsByOwnerRequest) (*types.QueryGetBondsByOwnerResponse, error) {
|
||||||
|
@ -11,9 +11,7 @@ import (
|
|||||||
"github.com/cosmos/cosmos-sdk/x/bank/testutil"
|
"github.com/cosmos/cosmos-sdk/x/bank/testutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var seed = int64(233)
|
||||||
seed = int64(233)
|
|
||||||
)
|
|
||||||
|
|
||||||
func (suite *KeeperTestSuite) TestGrpcQueryBondsList() {
|
func (suite *KeeperTestSuite) TestGrpcQueryBondsList() {
|
||||||
grpcClient, ctx, k := suite.queryClient, suite.ctx, suite.app.BondKeeper
|
grpcClient, ctx, k := suite.queryClient, suite.ctx, suite.app.BondKeeper
|
||||||
@ -86,21 +84,21 @@ func (suite *KeeperTestSuite) TestGrpcQueryBondBondId() {
|
|||||||
|
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
msg string
|
msg string
|
||||||
req *types.QueryGetBondByIdRequest
|
req *types.QueryGetBondByIDRequest
|
||||||
createBonds bool
|
createBonds bool
|
||||||
errResponse bool
|
errResponse bool
|
||||||
bondId string
|
bondId string
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"empty request",
|
"empty request",
|
||||||
&types.QueryGetBondByIdRequest{},
|
&types.QueryGetBondByIDRequest{},
|
||||||
false,
|
false,
|
||||||
true,
|
true,
|
||||||
"",
|
"",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Get Bond By ID",
|
"Get Bond By ID",
|
||||||
&types.QueryGetBondByIdRequest{},
|
&types.QueryGetBondByIDRequest{},
|
||||||
true,
|
true,
|
||||||
false,
|
false,
|
||||||
"",
|
"",
|
||||||
@ -122,11 +120,11 @@ func (suite *KeeperTestSuite) TestGrpcQueryBondBondId() {
|
|||||||
suiteRequire.NoError(err)
|
suiteRequire.NoError(err)
|
||||||
test.req.Id = bond.Id
|
test.req.Id = bond.Id
|
||||||
}
|
}
|
||||||
resp, err := grpcClient.GetBondById(context.Background(), test.req)
|
resp, err := grpcClient.GetBondByID(context.Background(), test.req)
|
||||||
if !test.errResponse {
|
if !test.errResponse {
|
||||||
suiteRequire.Nil(err)
|
suiteRequire.Nil(err)
|
||||||
suiteRequire.NotNil(resp.GetBond())
|
suiteRequire.NotNil(resp.GetBond())
|
||||||
suiteRequire.Equal(test.req.Id, resp.GetBond().GetId())
|
suiteRequire.Equal(test.req.Id, resp.GetBond().GetID())
|
||||||
} else {
|
} else {
|
||||||
suiteRequire.NotNil(err)
|
suiteRequire.NotNil(err)
|
||||||
suiteRequire.Error(err)
|
suiteRequire.Error(err)
|
||||||
|
@ -119,10 +119,7 @@ func (k Keeper) CreateBond(ctx sdk.Context, ownerAddress sdk.AccAddress, coins s
|
|||||||
Sequence: account.GetSequence(),
|
Sequence: account.GetSequence(),
|
||||||
}.Generate()
|
}.Generate()
|
||||||
|
|
||||||
maxBondAmount, err := k.getMaxBondAmount(ctx)
|
maxBondAmount := k.getMaxBondAmount(ctx)
|
||||||
if err != nil {
|
|
||||||
return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Invalid max bond amount.")
|
|
||||||
}
|
|
||||||
|
|
||||||
bond := types.Bond{Id: bondID, Owner: ownerAddress.String(), Balance: coins}
|
bond := types.Bond{Id: bondID, Owner: ownerAddress.String(), Balance: coins}
|
||||||
if bond.Balance.IsAnyGT(maxBondAmount) {
|
if bond.Balance.IsAnyGT(maxBondAmount) {
|
||||||
@ -130,7 +127,7 @@ func (k Keeper) CreateBond(ctx sdk.Context, ownerAddress sdk.AccAddress, coins s
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Move funds into the bond account module.
|
// Move funds into the bond account module.
|
||||||
err = k.bankKeeper.SendCoinsFromAccountToModule(ctx, ownerAddress, types.ModuleName, bond.Balance)
|
err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, ownerAddress, types.ModuleName, bond.Balance)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -198,7 +195,7 @@ func (k Keeper) ListBonds(ctx sdk.Context) []*types.Bond {
|
|||||||
func (k Keeper) QueryBondsByOwner(ctx sdk.Context, ownerAddress string) []types.Bond {
|
func (k Keeper) QueryBondsByOwner(ctx sdk.Context, ownerAddress string) []types.Bond {
|
||||||
var bonds []types.Bond
|
var bonds []types.Bond
|
||||||
|
|
||||||
ownerPrefix := append(prefixOwnerToBondsIndex, []byte(ownerAddress)...)
|
ownerPrefix := append(prefixOwnerToBondsIndex, []byte(ownerAddress)...) //nolint: all
|
||||||
store := ctx.KVStore(k.storeKey)
|
store := ctx.KVStore(k.storeKey)
|
||||||
itr := sdk.KVStorePrefixIterator(store, ownerPrefix)
|
itr := sdk.KVStorePrefixIterator(store, ownerPrefix)
|
||||||
defer itr.Close()
|
defer itr.Close()
|
||||||
@ -233,10 +230,7 @@ func (k Keeper) RefillBond(ctx sdk.Context, id string, ownerAddress sdk.AccAddre
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
maxBondAmount, err := k.getMaxBondAmount(ctx)
|
maxBondAmount := k.getMaxBondAmount(ctx)
|
||||||
if err != nil {
|
|
||||||
return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Invalid max bond amount.")
|
|
||||||
}
|
|
||||||
|
|
||||||
updatedBalance := bond.Balance.Add(coins...)
|
updatedBalance := bond.Balance.Add(coins...)
|
||||||
if updatedBalance.IsAnyGT(maxBondAmount) {
|
if updatedBalance.IsAnyGT(maxBondAmount) {
|
||||||
@ -244,7 +238,7 @@ func (k Keeper) RefillBond(ctx sdk.Context, id string, ownerAddress sdk.AccAddre
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Move funds into the bond account module.
|
// Move funds into the bond account module.
|
||||||
err = k.bankKeeper.SendCoinsFromAccountToModule(ctx, ownerAddress, types.ModuleName, coins)
|
err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, ownerAddress, types.ModuleName, coins)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -314,10 +308,10 @@ func (k Keeper) CancelBond(ctx sdk.Context, id string, ownerAddress sdk.AccAddre
|
|||||||
return &bond, nil
|
return &bond, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (k Keeper) getMaxBondAmount(ctx sdk.Context) (sdk.Coins, error) {
|
func (k Keeper) getMaxBondAmount(ctx sdk.Context) sdk.Coins {
|
||||||
params := k.GetParams(ctx)
|
params := k.GetParams(ctx)
|
||||||
maxBondAmount := params.MaxBondAmount
|
maxBondAmount := params.MaxBondAmount
|
||||||
return sdk.NewCoins(maxBondAmount), nil
|
return sdk.NewCoins(maxBondAmount)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetBondModuleBalances gets the bond module account(s) balances.
|
// GetBondModuleBalances gets the bond module account(s) balances.
|
||||||
|
@ -45,6 +45,7 @@ func (k msgServer) CreateBond(c context.Context, msg *types.MsgCreateBond) (*typ
|
|||||||
return &types.MsgCreateBondResponse{}, nil
|
return &types.MsgCreateBondResponse{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//nolint: all
|
||||||
func (k msgServer) RefillBond(c context.Context, msg *types.MsgRefillBond) (*types.MsgRefillBondResponse, error) {
|
func (k msgServer) RefillBond(c context.Context, msg *types.MsgRefillBond) (*types.MsgRefillBondResponse, error) {
|
||||||
ctx := sdk.UnwrapSDKContext(c)
|
ctx := sdk.UnwrapSDKContext(c)
|
||||||
signerAddress, err := sdk.AccAddressFromBech32(msg.Signer)
|
signerAddress, err := sdk.AccAddressFromBech32(msg.Signer)
|
||||||
@ -61,7 +62,7 @@ func (k msgServer) RefillBond(c context.Context, msg *types.MsgRefillBond) (*typ
|
|||||||
sdk.NewEvent(
|
sdk.NewEvent(
|
||||||
types.EventTypeRefillBond,
|
types.EventTypeRefillBond,
|
||||||
sdk.NewAttribute(types.AttributeKeySigner, msg.Signer),
|
sdk.NewAttribute(types.AttributeKeySigner, msg.Signer),
|
||||||
sdk.NewAttribute(types.AttributeKeyBondId, msg.Id),
|
sdk.NewAttribute(types.AttributeKeyBondID, msg.Id),
|
||||||
sdk.NewAttribute(sdk.AttributeKeyAmount, msg.Coins.String()),
|
sdk.NewAttribute(sdk.AttributeKeyAmount, msg.Coins.String()),
|
||||||
),
|
),
|
||||||
sdk.NewEvent(
|
sdk.NewEvent(
|
||||||
@ -74,6 +75,7 @@ func (k msgServer) RefillBond(c context.Context, msg *types.MsgRefillBond) (*typ
|
|||||||
return &types.MsgRefillBondResponse{}, nil
|
return &types.MsgRefillBondResponse{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//nolint: all
|
||||||
func (k msgServer) WithdrawBond(c context.Context, msg *types.MsgWithdrawBond) (*types.MsgWithdrawBondResponse, error) {
|
func (k msgServer) WithdrawBond(c context.Context, msg *types.MsgWithdrawBond) (*types.MsgWithdrawBondResponse, error) {
|
||||||
ctx := sdk.UnwrapSDKContext(c)
|
ctx := sdk.UnwrapSDKContext(c)
|
||||||
signerAddress, err := sdk.AccAddressFromBech32(msg.Signer)
|
signerAddress, err := sdk.AccAddressFromBech32(msg.Signer)
|
||||||
@ -90,7 +92,7 @@ func (k msgServer) WithdrawBond(c context.Context, msg *types.MsgWithdrawBond) (
|
|||||||
sdk.NewEvent(
|
sdk.NewEvent(
|
||||||
types.EventTypeWithdrawBond,
|
types.EventTypeWithdrawBond,
|
||||||
sdk.NewAttribute(types.AttributeKeySigner, msg.Signer),
|
sdk.NewAttribute(types.AttributeKeySigner, msg.Signer),
|
||||||
sdk.NewAttribute(types.AttributeKeyBondId, msg.Id),
|
sdk.NewAttribute(types.AttributeKeyBondID, msg.Id),
|
||||||
sdk.NewAttribute(sdk.AttributeKeyAmount, msg.Coins.String()),
|
sdk.NewAttribute(sdk.AttributeKeyAmount, msg.Coins.String()),
|
||||||
),
|
),
|
||||||
sdk.NewEvent(
|
sdk.NewEvent(
|
||||||
@ -118,7 +120,7 @@ func (k msgServer) CancelBond(c context.Context, msg *types.MsgCancelBond) (*typ
|
|||||||
sdk.NewEvent(
|
sdk.NewEvent(
|
||||||
types.EventTypeCancelBond,
|
types.EventTypeCancelBond,
|
||||||
sdk.NewAttribute(types.AttributeKeySigner, msg.Signer),
|
sdk.NewAttribute(types.AttributeKeySigner, msg.Signer),
|
||||||
sdk.NewAttribute(types.AttributeKeyBondId, msg.Id),
|
sdk.NewAttribute(types.AttributeKeyBondID, msg.Id),
|
||||||
),
|
),
|
||||||
sdk.NewEvent(
|
sdk.NewEvent(
|
||||||
sdk.EventTypeMessage,
|
sdk.EventTypeMessage,
|
||||||
|
2
x/bond/types/bond.pb.go
generated
2
x/bond/types/bond.pb.go
generated
@ -114,7 +114,7 @@ func (m *Bond) XXX_DiscardUnknown() {
|
|||||||
|
|
||||||
var xxx_messageInfo_Bond proto.InternalMessageInfo
|
var xxx_messageInfo_Bond proto.InternalMessageInfo
|
||||||
|
|
||||||
func (m *Bond) GetId() string {
|
func (m *Bond) GetID() string {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
return m.Id
|
return m.Id
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,6 @@ const (
|
|||||||
|
|
||||||
AttributeKeySigner = "signer"
|
AttributeKeySigner = "signer"
|
||||||
AttributeKeyAmount = "amount"
|
AttributeKeyAmount = "amount"
|
||||||
AttributeKeyBondId = "bond_id"
|
AttributeKeyBondID = "bond_id"
|
||||||
AttributeValueCategory = ModuleName
|
AttributeValueCategory = ModuleName
|
||||||
)
|
)
|
||||||
|
@ -8,5 +8,5 @@ import (
|
|||||||
// Used to, for example, prevent deletion of a bond that's in use.
|
// Used to, for example, prevent deletion of a bond that's in use.
|
||||||
type BondUsageKeeper interface {
|
type BondUsageKeeper interface {
|
||||||
ModuleName() string
|
ModuleName() string
|
||||||
UsesBond(ctx sdk.Context, bondId string) bool
|
UsesBond(ctx sdk.Context, bondID string) bool
|
||||||
}
|
}
|
||||||
|
@ -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"
|
||||||
)
|
)
|
||||||
|
222
x/bond/types/query.pb.go
generated
222
x/bond/types/query.pb.go
generated
@ -214,23 +214,23 @@ func (m *QueryGetBondsResponse) GetPagination() *query.PageResponse {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// QueryGetBondById
|
// QueryGetBondByID
|
||||||
type QueryGetBondByIdRequest struct {
|
type QueryGetBondByIDRequest struct {
|
||||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty" json:"id" yaml:"id"`
|
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty" json:"id" yaml:"id"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *QueryGetBondByIdRequest) Reset() { *m = QueryGetBondByIdRequest{} }
|
func (m *QueryGetBondByIDRequest) Reset() { *m = QueryGetBondByIDRequest{} }
|
||||||
func (m *QueryGetBondByIdRequest) String() string { return proto.CompactTextString(m) }
|
func (m *QueryGetBondByIDRequest) String() string { return proto.CompactTextString(m) }
|
||||||
func (*QueryGetBondByIdRequest) ProtoMessage() {}
|
func (*QueryGetBondByIDRequest) ProtoMessage() {}
|
||||||
func (*QueryGetBondByIdRequest) Descriptor() ([]byte, []int) {
|
func (*QueryGetBondByIDRequest) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_2f225717b20da431, []int{4}
|
return fileDescriptor_2f225717b20da431, []int{4}
|
||||||
}
|
}
|
||||||
func (m *QueryGetBondByIdRequest) XXX_Unmarshal(b []byte) error {
|
func (m *QueryGetBondByIDRequest) XXX_Unmarshal(b []byte) error {
|
||||||
return m.Unmarshal(b)
|
return m.Unmarshal(b)
|
||||||
}
|
}
|
||||||
func (m *QueryGetBondByIdRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
func (m *QueryGetBondByIDRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
if deterministic {
|
if deterministic {
|
||||||
return xxx_messageInfo_QueryGetBondByIdRequest.Marshal(b, m, deterministic)
|
return xxx_messageInfo_QueryGetBondByIDRequest.Marshal(b, m, deterministic)
|
||||||
} else {
|
} else {
|
||||||
b = b[:cap(b)]
|
b = b[:cap(b)]
|
||||||
n, err := m.MarshalToSizedBuffer(b)
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
@ -240,42 +240,42 @@ func (m *QueryGetBondByIdRequest) XXX_Marshal(b []byte, deterministic bool) ([]b
|
|||||||
return b[:n], nil
|
return b[:n], nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func (m *QueryGetBondByIdRequest) XXX_Merge(src proto.Message) {
|
func (m *QueryGetBondByIDRequest) XXX_Merge(src proto.Message) {
|
||||||
xxx_messageInfo_QueryGetBondByIdRequest.Merge(m, src)
|
xxx_messageInfo_QueryGetBondByIDRequest.Merge(m, src)
|
||||||
}
|
}
|
||||||
func (m *QueryGetBondByIdRequest) XXX_Size() int {
|
func (m *QueryGetBondByIDRequest) XXX_Size() int {
|
||||||
return m.Size()
|
return m.Size()
|
||||||
}
|
}
|
||||||
func (m *QueryGetBondByIdRequest) XXX_DiscardUnknown() {
|
func (m *QueryGetBondByIDRequest) XXX_DiscardUnknown() {
|
||||||
xxx_messageInfo_QueryGetBondByIdRequest.DiscardUnknown(m)
|
xxx_messageInfo_QueryGetBondByIDRequest.DiscardUnknown(m)
|
||||||
}
|
}
|
||||||
|
|
||||||
var xxx_messageInfo_QueryGetBondByIdRequest proto.InternalMessageInfo
|
var xxx_messageInfo_QueryGetBondByIDRequest proto.InternalMessageInfo
|
||||||
|
|
||||||
func (m *QueryGetBondByIdRequest) GetId() string {
|
func (m *QueryGetBondByIDRequest) GetID() string {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
return m.Id
|
return m.Id
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
// QueryGetBondByIdResponse returns QueryGetBondById query response
|
// QueryGetBondByIDResponse returns QueryGetBondByID query response
|
||||||
type QueryGetBondByIdResponse struct {
|
type QueryGetBondByIDResponse struct {
|
||||||
Bond *Bond `protobuf:"bytes,1,opt,name=bond,proto3" json:"bond,omitempty" json:"bond" yaml:"bond"`
|
Bond *Bond `protobuf:"bytes,1,opt,name=bond,proto3" json:"bond,omitempty" json:"bond" yaml:"bond"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *QueryGetBondByIdResponse) Reset() { *m = QueryGetBondByIdResponse{} }
|
func (m *QueryGetBondByIDResponse) Reset() { *m = QueryGetBondByIDResponse{} }
|
||||||
func (m *QueryGetBondByIdResponse) String() string { return proto.CompactTextString(m) }
|
func (m *QueryGetBondByIDResponse) String() string { return proto.CompactTextString(m) }
|
||||||
func (*QueryGetBondByIdResponse) ProtoMessage() {}
|
func (*QueryGetBondByIDResponse) ProtoMessage() {}
|
||||||
func (*QueryGetBondByIdResponse) Descriptor() ([]byte, []int) {
|
func (*QueryGetBondByIDResponse) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_2f225717b20da431, []int{5}
|
return fileDescriptor_2f225717b20da431, []int{5}
|
||||||
}
|
}
|
||||||
func (m *QueryGetBondByIdResponse) XXX_Unmarshal(b []byte) error {
|
func (m *QueryGetBondByIDResponse) XXX_Unmarshal(b []byte) error {
|
||||||
return m.Unmarshal(b)
|
return m.Unmarshal(b)
|
||||||
}
|
}
|
||||||
func (m *QueryGetBondByIdResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
func (m *QueryGetBondByIDResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
if deterministic {
|
if deterministic {
|
||||||
return xxx_messageInfo_QueryGetBondByIdResponse.Marshal(b, m, deterministic)
|
return xxx_messageInfo_QueryGetBondByIDResponse.Marshal(b, m, deterministic)
|
||||||
} else {
|
} else {
|
||||||
b = b[:cap(b)]
|
b = b[:cap(b)]
|
||||||
n, err := m.MarshalToSizedBuffer(b)
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
@ -285,19 +285,19 @@ func (m *QueryGetBondByIdResponse) XXX_Marshal(b []byte, deterministic bool) ([]
|
|||||||
return b[:n], nil
|
return b[:n], nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func (m *QueryGetBondByIdResponse) XXX_Merge(src proto.Message) {
|
func (m *QueryGetBondByIDResponse) XXX_Merge(src proto.Message) {
|
||||||
xxx_messageInfo_QueryGetBondByIdResponse.Merge(m, src)
|
xxx_messageInfo_QueryGetBondByIDResponse.Merge(m, src)
|
||||||
}
|
}
|
||||||
func (m *QueryGetBondByIdResponse) XXX_Size() int {
|
func (m *QueryGetBondByIDResponse) XXX_Size() int {
|
||||||
return m.Size()
|
return m.Size()
|
||||||
}
|
}
|
||||||
func (m *QueryGetBondByIdResponse) XXX_DiscardUnknown() {
|
func (m *QueryGetBondByIDResponse) XXX_DiscardUnknown() {
|
||||||
xxx_messageInfo_QueryGetBondByIdResponse.DiscardUnknown(m)
|
xxx_messageInfo_QueryGetBondByIDResponse.DiscardUnknown(m)
|
||||||
}
|
}
|
||||||
|
|
||||||
var xxx_messageInfo_QueryGetBondByIdResponse proto.InternalMessageInfo
|
var xxx_messageInfo_QueryGetBondByIDResponse proto.InternalMessageInfo
|
||||||
|
|
||||||
func (m *QueryGetBondByIdResponse) GetBond() *Bond {
|
func (m *QueryGetBondByIDResponse) GetBond() *Bond {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
return m.Bond
|
return m.Bond
|
||||||
}
|
}
|
||||||
@ -499,8 +499,8 @@ func init() {
|
|||||||
proto.RegisterType((*QueryParamsResponse)(nil), "vulcanize.bond.v1beta1.QueryParamsResponse")
|
proto.RegisterType((*QueryParamsResponse)(nil), "vulcanize.bond.v1beta1.QueryParamsResponse")
|
||||||
proto.RegisterType((*QueryGetBondsRequest)(nil), "vulcanize.bond.v1beta1.QueryGetBondsRequest")
|
proto.RegisterType((*QueryGetBondsRequest)(nil), "vulcanize.bond.v1beta1.QueryGetBondsRequest")
|
||||||
proto.RegisterType((*QueryGetBondsResponse)(nil), "vulcanize.bond.v1beta1.QueryGetBondsResponse")
|
proto.RegisterType((*QueryGetBondsResponse)(nil), "vulcanize.bond.v1beta1.QueryGetBondsResponse")
|
||||||
proto.RegisterType((*QueryGetBondByIdRequest)(nil), "vulcanize.bond.v1beta1.QueryGetBondByIdRequest")
|
proto.RegisterType((*QueryGetBondByIDRequest)(nil), "vulcanize.bond.v1beta1.QueryGetBondByIDRequest")
|
||||||
proto.RegisterType((*QueryGetBondByIdResponse)(nil), "vulcanize.bond.v1beta1.QueryGetBondByIdResponse")
|
proto.RegisterType((*QueryGetBondByIDResponse)(nil), "vulcanize.bond.v1beta1.QueryGetBondByIDResponse")
|
||||||
proto.RegisterType((*QueryGetBondsByOwnerRequest)(nil), "vulcanize.bond.v1beta1.QueryGetBondsByOwnerRequest")
|
proto.RegisterType((*QueryGetBondsByOwnerRequest)(nil), "vulcanize.bond.v1beta1.QueryGetBondsByOwnerRequest")
|
||||||
proto.RegisterType((*QueryGetBondsByOwnerResponse)(nil), "vulcanize.bond.v1beta1.QueryGetBondsByOwnerResponse")
|
proto.RegisterType((*QueryGetBondsByOwnerResponse)(nil), "vulcanize.bond.v1beta1.QueryGetBondsByOwnerResponse")
|
||||||
proto.RegisterType((*QueryGetBondModuleBalanceRequest)(nil), "vulcanize.bond.v1beta1.QueryGetBondModuleBalanceRequest")
|
proto.RegisterType((*QueryGetBondModuleBalanceRequest)(nil), "vulcanize.bond.v1beta1.QueryGetBondModuleBalanceRequest")
|
||||||
@ -512,55 +512,55 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var fileDescriptor_2f225717b20da431 = []byte{
|
var fileDescriptor_2f225717b20da431 = []byte{
|
||||||
// 759 bytes of a gzipped FileDescriptorProto
|
// 761 bytes of a gzipped FileDescriptorProto
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x95, 0xbf, 0x6f, 0xd3, 0x40,
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x95, 0x3f, 0x6f, 0xd3, 0x4e,
|
||||||
0x14, 0xc7, 0xe3, 0x40, 0x82, 0xb8, 0x0e, 0x48, 0xd7, 0x94, 0xb6, 0x69, 0x6b, 0x27, 0x27, 0x68,
|
0x18, 0xc7, 0xe3, 0xfc, 0x7e, 0x09, 0xe2, 0x3a, 0x20, 0x5d, 0x53, 0xda, 0xa6, 0xad, 0x9d, 0x9c,
|
||||||
0xa3, 0x40, 0x7c, 0xfd, 0xc1, 0x00, 0x8c, 0x46, 0xa2, 0x62, 0xa8, 0xa0, 0x96, 0x10, 0x12, 0x03,
|
0xa0, 0x8d, 0x02, 0xf1, 0xf5, 0x0f, 0x03, 0x30, 0x1a, 0x44, 0xc5, 0x50, 0x41, 0x2d, 0x21, 0x24,
|
||||||
0x92, 0x63, 0x9f, 0xc2, 0x41, 0x72, 0x97, 0xc6, 0x4e, 0x21, 0x94, 0x2e, 0xdd, 0x10, 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4c,
|
||||||
0x89, 0xd1, 0x80, 0xd7, 0x47, 0x21, 0x38, 0x69, 0xe4, 0xf2, 0x37, 0xfe, 0x22, 0x52, 0x19, 0x58,
|
0x44, 0xd9, 0x12, 0xa3, 0x01, 0xaf, 0x8e, 0x42, 0x70, 0xd2, 0xc8, 0xe5, 0xaf, 0xfd, 0x41, 0xa4,
|
||||||
0x10, 0x06, 0x8a, 0xd0, 0x18, 0x68, 0x40, 0x06, 0x58, 0xd6, 0xee, 0xbe, 0xae, 0xed, 0xed, 0xeb,
|
0x32, 0xb0, 0x20, 0x0c, 0x14, 0xa1, 0x31, 0xd0, 0x80, 0x0c, 0xb0, 0xac, 0xdd, 0x7d, 0x5d, 0xdb,
|
||||||
0xda, 0xcf, 0x7d, 0x5d, 0x7b, 0x73, 0xa0, 0xa7, 0xf6, 0x0e, 0xf4, 0xd4, 0xf7, 0x03, 0x3d, 0xf5,
|
0xdb, 0xd7, 0xb5, 0x1f, 0xfb, 0xba, 0xf6, 0xfa, 0x40, 0x4f, 0xed, 0x1d, 0xe8, 0xa9, 0x6f, 0x07,
|
||||||
0x30, 0x31, 0x78, 0xa4, 0xe5, 0x56, 0x28, 0xc7, 0x75, 0xc7, 0xe5, 0x8c, 0xba, 0x1e, 0x7e, 0x2e,
|
0x7a, 0xea, 0x41, 0x62, 0xf0, 0x48, 0xcb, 0xad, 0x50, 0x8e, 0xeb, 0x8e, 0xcb, 0x19, 0x75, 0x3d,
|
||||||
0xb3, 0x89, 0xf1, 0xab, 0x66, 0xc5, 0xff, 0xf9, 0xca, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xdb,
|
0xfc, 0x4c, 0x66, 0x13, 0xe3, 0x57, 0xcd, 0x8a, 0xff, 0xf3, 0x95, 0x5f, 0x01, 0x00, 0x00, 0xff,
|
||||||
0x62, 0x7c, 0x63, 0xb0, 0x08, 0x00, 0x00,
|
0xff, 0xd8, 0xd4, 0xc7, 0x22, 0xb0, 0x08, 0x00, 0x00,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
@ -580,7 +580,7 @@ type QueryClient interface {
|
|||||||
// Bonds queries bonds list.
|
// Bonds queries bonds list.
|
||||||
Bonds(ctx context.Context, in *QueryGetBondsRequest, opts ...grpc.CallOption) (*QueryGetBondsResponse, error)
|
Bonds(ctx context.Context, in *QueryGetBondsRequest, opts ...grpc.CallOption) (*QueryGetBondsResponse, error)
|
||||||
// GetBondById
|
// GetBondById
|
||||||
GetBondById(ctx context.Context, in *QueryGetBondByIdRequest, opts ...grpc.CallOption) (*QueryGetBondByIdResponse, error)
|
GetBondByID(ctx context.Context, in *QueryGetBondByIDRequest, opts ...grpc.CallOption) (*QueryGetBondByIDResponse, error)
|
||||||
// Get Bonds List by Owner
|
// Get Bonds List by Owner
|
||||||
GetBondsByOwner(ctx context.Context, in *QueryGetBondsByOwnerRequest, opts ...grpc.CallOption) (*QueryGetBondsByOwnerResponse, error)
|
GetBondsByOwner(ctx context.Context, in *QueryGetBondsByOwnerRequest, opts ...grpc.CallOption) (*QueryGetBondsByOwnerResponse, error)
|
||||||
// Get Bonds module balance
|
// Get Bonds module balance
|
||||||
@ -613,9 +613,9 @@ func (c *queryClient) Bonds(ctx context.Context, in *QueryGetBondsRequest, opts
|
|||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *queryClient) GetBondById(ctx context.Context, in *QueryGetBondByIdRequest, opts ...grpc.CallOption) (*QueryGetBondByIdResponse, error) {
|
func (c *queryClient) GetBondByID(ctx context.Context, in *QueryGetBondByIDRequest, opts ...grpc.CallOption) (*QueryGetBondByIDResponse, error) {
|
||||||
out := new(QueryGetBondByIdResponse)
|
out := new(QueryGetBondByIDResponse)
|
||||||
err := c.cc.Invoke(ctx, "/vulcanize.bond.v1beta1.Query/GetBondById", in, out, opts...)
|
err := c.cc.Invoke(ctx, "/vulcanize.bond.v1beta1.Query/GetBondByID", in, out, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -647,7 +647,7 @@ type QueryServer interface {
|
|||||||
// Bonds queries bonds list.
|
// Bonds queries bonds list.
|
||||||
Bonds(context.Context, *QueryGetBondsRequest) (*QueryGetBondsResponse, error)
|
Bonds(context.Context, *QueryGetBondsRequest) (*QueryGetBondsResponse, error)
|
||||||
// GetBondById
|
// GetBondById
|
||||||
GetBondById(context.Context, *QueryGetBondByIdRequest) (*QueryGetBondByIdResponse, error)
|
GetBondByID(context.Context, *QueryGetBondByIDRequest) (*QueryGetBondByIDResponse, error)
|
||||||
// Get Bonds List by Owner
|
// Get Bonds List by Owner
|
||||||
GetBondsByOwner(context.Context, *QueryGetBondsByOwnerRequest) (*QueryGetBondsByOwnerResponse, error)
|
GetBondsByOwner(context.Context, *QueryGetBondsByOwnerRequest) (*QueryGetBondsByOwnerResponse, error)
|
||||||
// Get Bonds module balance
|
// Get Bonds module balance
|
||||||
@ -664,8 +664,8 @@ func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsReq
|
|||||||
func (*UnimplementedQueryServer) Bonds(ctx context.Context, req *QueryGetBondsRequest) (*QueryGetBondsResponse, error) {
|
func (*UnimplementedQueryServer) Bonds(ctx context.Context, req *QueryGetBondsRequest) (*QueryGetBondsResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method Bonds not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method Bonds not implemented")
|
||||||
}
|
}
|
||||||
func (*UnimplementedQueryServer) GetBondById(ctx context.Context, req *QueryGetBondByIdRequest) (*QueryGetBondByIdResponse, error) {
|
func (*UnimplementedQueryServer) GetBondByID(ctx context.Context, req *QueryGetBondByIDRequest) (*QueryGetBondByIDResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method GetBondById not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method GetBondByID not implemented")
|
||||||
}
|
}
|
||||||
func (*UnimplementedQueryServer) GetBondsByOwner(ctx context.Context, req *QueryGetBondsByOwnerRequest) (*QueryGetBondsByOwnerResponse, error) {
|
func (*UnimplementedQueryServer) GetBondsByOwner(ctx context.Context, req *QueryGetBondsByOwnerRequest) (*QueryGetBondsByOwnerResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method GetBondsByOwner not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method GetBondsByOwner not implemented")
|
||||||
@ -714,20 +714,20 @@ func _Query_Bonds_Handler(srv interface{}, ctx context.Context, dec func(interfa
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
func _Query_GetBondById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
func _Query_GetBondByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(QueryGetBondByIdRequest)
|
in := new(QueryGetBondByIDRequest)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if interceptor == nil {
|
if interceptor == nil {
|
||||||
return srv.(QueryServer).GetBondById(ctx, in)
|
return srv.(QueryServer).GetBondByID(ctx, in)
|
||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: "/vulcanize.bond.v1beta1.Query/GetBondById",
|
FullMethod: "/vulcanize.bond.v1beta1.Query/GetBondByID",
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(QueryServer).GetBondById(ctx, req.(*QueryGetBondByIdRequest))
|
return srv.(QueryServer).GetBondByID(ctx, req.(*QueryGetBondByIDRequest))
|
||||||
}
|
}
|
||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
@ -781,8 +781,8 @@ var _Query_serviceDesc = grpc.ServiceDesc{
|
|||||||
Handler: _Query_Bonds_Handler,
|
Handler: _Query_Bonds_Handler,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
MethodName: "GetBondById",
|
MethodName: "GetBondByID",
|
||||||
Handler: _Query_GetBondById_Handler,
|
Handler: _Query_GetBondByID_Handler,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
MethodName: "GetBondsByOwner",
|
MethodName: "GetBondsByOwner",
|
||||||
@ -939,7 +939,7 @@ func (m *QueryGetBondsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||||||
return len(dAtA) - i, nil
|
return len(dAtA) - i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *QueryGetBondByIdRequest) Marshal() (dAtA []byte, err error) {
|
func (m *QueryGetBondByIDRequest) Marshal() (dAtA []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
@ -949,12 +949,12 @@ func (m *QueryGetBondByIdRequest) Marshal() (dAtA []byte, err error) {
|
|||||||
return dAtA[:n], nil
|
return dAtA[:n], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *QueryGetBondByIdRequest) MarshalTo(dAtA []byte) (int, error) {
|
func (m *QueryGetBondByIDRequest) MarshalTo(dAtA []byte) (int, error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *QueryGetBondByIdRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
func (m *QueryGetBondByIDRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
i := len(dAtA)
|
i := len(dAtA)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
@ -969,7 +969,7 @@ func (m *QueryGetBondByIdRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
|
|||||||
return len(dAtA) - i, nil
|
return len(dAtA) - i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *QueryGetBondByIdResponse) Marshal() (dAtA []byte, err error) {
|
func (m *QueryGetBondByIDResponse) Marshal() (dAtA []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
@ -979,12 +979,12 @@ func (m *QueryGetBondByIdResponse) Marshal() (dAtA []byte, err error) {
|
|||||||
return dAtA[:n], nil
|
return dAtA[:n], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *QueryGetBondByIdResponse) MarshalTo(dAtA []byte) (int, error) {
|
func (m *QueryGetBondByIDResponse) MarshalTo(dAtA []byte) (int, error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *QueryGetBondByIdResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
func (m *QueryGetBondByIDResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
i := len(dAtA)
|
i := len(dAtA)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
@ -1220,7 +1220,7 @@ func (m *QueryGetBondsResponse) Size() (n int) {
|
|||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *QueryGetBondByIdRequest) Size() (n int) {
|
func (m *QueryGetBondByIDRequest) Size() (n int) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -1233,7 +1233,7 @@ func (m *QueryGetBondByIdRequest) Size() (n int) {
|
|||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *QueryGetBondByIdResponse) Size() (n int) {
|
func (m *QueryGetBondByIDResponse) Size() (n int) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -1654,7 +1654,7 @@ func (m *QueryGetBondsResponse) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (m *QueryGetBondByIdRequest) Unmarshal(dAtA []byte) error {
|
func (m *QueryGetBondByIDRequest) Unmarshal(dAtA []byte) error {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
for iNdEx < l {
|
for iNdEx < l {
|
||||||
@ -1677,10 +1677,10 @@ func (m *QueryGetBondByIdRequest) Unmarshal(dAtA []byte) error {
|
|||||||
fieldNum := int32(wire >> 3)
|
fieldNum := int32(wire >> 3)
|
||||||
wireType := int(wire & 0x7)
|
wireType := int(wire & 0x7)
|
||||||
if wireType == 4 {
|
if wireType == 4 {
|
||||||
return fmt.Errorf("proto: QueryGetBondByIdRequest: wiretype end group for non-group")
|
return fmt.Errorf("proto: QueryGetBondByIDRequest: wiretype end group for non-group")
|
||||||
}
|
}
|
||||||
if fieldNum <= 0 {
|
if fieldNum <= 0 {
|
||||||
return fmt.Errorf("proto: QueryGetBondByIdRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
return fmt.Errorf("proto: QueryGetBondByIDRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
}
|
}
|
||||||
switch fieldNum {
|
switch fieldNum {
|
||||||
case 1:
|
case 1:
|
||||||
@ -1736,7 +1736,7 @@ func (m *QueryGetBondByIdRequest) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (m *QueryGetBondByIdResponse) Unmarshal(dAtA []byte) error {
|
func (m *QueryGetBondByIDResponse) Unmarshal(dAtA []byte) error {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
for iNdEx < l {
|
for iNdEx < l {
|
||||||
@ -1759,10 +1759,10 @@ func (m *QueryGetBondByIdResponse) Unmarshal(dAtA []byte) error {
|
|||||||
fieldNum := int32(wire >> 3)
|
fieldNum := int32(wire >> 3)
|
||||||
wireType := int(wire & 0x7)
|
wireType := int(wire & 0x7)
|
||||||
if wireType == 4 {
|
if wireType == 4 {
|
||||||
return fmt.Errorf("proto: QueryGetBondByIdResponse: wiretype end group for non-group")
|
return fmt.Errorf("proto: QueryGetBondByIDResponse: wiretype end group for non-group")
|
||||||
}
|
}
|
||||||
if fieldNum <= 0 {
|
if fieldNum <= 0 {
|
||||||
return fmt.Errorf("proto: QueryGetBondByIdResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
return fmt.Errorf("proto: QueryGetBondByIDResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
}
|
}
|
||||||
switch fieldNum {
|
switch fieldNum {
|
||||||
case 1:
|
case 1:
|
||||||
|
28
x/bond/types/query.pb.gw.go
generated
28
x/bond/types/query.pb.gw.go
generated
@ -85,8 +85,8 @@ func local_request_Query_Bonds_0(ctx context.Context, marshaler runtime.Marshale
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func request_Query_GetBondById_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
func request_Query_GetBondByID_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
var protoReq QueryGetBondByIdRequest
|
var protoReq QueryGetBondByIDRequest
|
||||||
var metadata runtime.ServerMetadata
|
var metadata runtime.ServerMetadata
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -107,13 +107,13 @@ func request_Query_GetBondById_0(ctx context.Context, marshaler runtime.Marshale
|
|||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
msg, err := client.GetBondById(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.GetBondByID(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func local_request_Query_GetBondById_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
func local_request_Query_GetBondByID_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
var protoReq QueryGetBondByIdRequest
|
var protoReq QueryGetBondByIDRequest
|
||||||
var metadata runtime.ServerMetadata
|
var metadata runtime.ServerMetadata
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -134,7 +134,7 @@ func local_request_Query_GetBondById_0(ctx context.Context, marshaler runtime.Ma
|
|||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
msg, err := server.GetBondById(ctx, &protoReq)
|
msg, err := server.GetBondByID(ctx, &protoReq)
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -275,7 +275,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
mux.Handle("GET", pattern_Query_GetBondById_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
mux.Handle("GET", pattern_Query_GetBondByID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
ctx, cancel := context.WithCancel(req.Context())
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
@ -284,14 +284,14 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
|
|||||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
resp, md, err := local_request_Query_GetBondById_0(rctx, inboundMarshaler, server, req, pathParams)
|
resp, md, err := local_request_Query_GetBondByID_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
forward_Query_GetBondById_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
forward_Query_GetBondByID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -416,7 +416,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
mux.Handle("GET", pattern_Query_GetBondById_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
mux.Handle("GET", pattern_Query_GetBondByID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
ctx, cancel := context.WithCancel(req.Context())
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
@ -425,14 +425,14 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
|
|||||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
resp, md, err := request_Query_GetBondById_0(rctx, inboundMarshaler, client, req, pathParams)
|
resp, md, err := request_Query_GetBondByID_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
forward_Query_GetBondById_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
forward_Query_GetBondByID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -484,7 +484,7 @@ var (
|
|||||||
|
|
||||||
pattern_Query_Bonds_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"vulcanize", "bond", "v1beta1", "bonds"}, "", runtime.AssumeColonVerbOpt(true)))
|
pattern_Query_Bonds_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"vulcanize", "bond", "v1beta1", "bonds"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||||
|
|
||||||
pattern_Query_GetBondById_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"vulcanize", "bond", "v1beta1", "bonds", "id"}, "", runtime.AssumeColonVerbOpt(true)))
|
pattern_Query_GetBondByID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"vulcanize", "bond", "v1beta1", "bonds", "id"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||||
|
|
||||||
pattern_Query_GetBondsByOwner_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"vulcanize", "bond", "v1beta1", "by-owner", "owner"}, "", runtime.AssumeColonVerbOpt(true)))
|
pattern_Query_GetBondsByOwner_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"vulcanize", "bond", "v1beta1", "by-owner", "owner"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||||
|
|
||||||
@ -496,7 +496,7 @@ var (
|
|||||||
|
|
||||||
forward_Query_Bonds_0 = runtime.ForwardResponseMessage
|
forward_Query_Bonds_0 = runtime.ForwardResponseMessage
|
||||||
|
|
||||||
forward_Query_GetBondById_0 = runtime.ForwardResponseMessage
|
forward_Query_GetBondByID_0 = runtime.ForwardResponseMessage
|
||||||
|
|
||||||
forward_Query_GetBondsByOwner_0 = runtime.ForwardResponseMessage
|
forward_Query_GetBondsByOwner_0 = runtime.ForwardResponseMessage
|
||||||
|
|
||||||
|
@ -227,7 +227,7 @@ func (k Keeper) GetAccountStorage(ctx sdk.Context, address common.Address) types
|
|||||||
// SetHooks sets the hooks for the EVM module
|
// SetHooks sets the hooks for the EVM module
|
||||||
// It should be called only once during initialization, it panic if called more than once.
|
// It should be called only once during initialization, it panic if called more than once.
|
||||||
func (k *Keeper) SetHooks(eh types.EvmHooks) *Keeper {
|
func (k *Keeper) SetHooks(eh types.EvmHooks) *Keeper {
|
||||||
if k.hooks != nil {
|
if k.hooks != types.EvmHooks(nil) {
|
||||||
panic("cannot set evm hooks twice")
|
panic("cannot set evm hooks twice")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -237,7 +237,7 @@ func (k *Keeper) SetHooks(eh types.EvmHooks) *Keeper {
|
|||||||
|
|
||||||
// PostTxProcessing delegate the call to the hooks. If no hook has been registered, this function returns with a `nil` error
|
// PostTxProcessing delegate the call to the hooks. If no hook has been registered, this function returns with a `nil` error
|
||||||
func (k *Keeper) PostTxProcessing(ctx sdk.Context, msg core.Message, receipt *ethtypes.Receipt) error {
|
func (k *Keeper) PostTxProcessing(ctx sdk.Context, msg core.Message, receipt *ethtypes.Receipt) error {
|
||||||
if k.hooks == nil {
|
if k.hooks == types.EvmHooks(nil) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return k.hooks.PostTxProcessing(ctx, msg, receipt)
|
return k.hooks.PostTxProcessing(ctx, msg, receipt)
|
||||||
|
@ -215,7 +215,7 @@ func (k *Keeper) ApplyTransaction(ctx sdk.Context, tx *ethtypes.Transaction) (*t
|
|||||||
// snapshot to contain the tx processing and post processing in same scope
|
// snapshot to contain the tx processing and post processing in same scope
|
||||||
var commit func()
|
var commit func()
|
||||||
tmpCtx := ctx
|
tmpCtx := ctx
|
||||||
if k.hooks != nil {
|
if k.hooks != types.EvmHooks(nil) {
|
||||||
// Create a cache context to revert state when tx hooks fails,
|
// Create a cache context to revert state when tx hooks fails,
|
||||||
// the cache context is only committed when both tx and hooks executed successfully.
|
// the cache context is only committed when both tx and hooks executed successfully.
|
||||||
// Didn't use `Snapshot` because the context stack has exponential complexity on certain operations,
|
// Didn't use `Snapshot` because the context stack has exponential complexity on certain operations,
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"math/rand"
|
"math/rand" // #nosec G702
|
||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
||||||
|
@ -32,12 +32,10 @@ import (
|
|||||||
"github.com/ethereum/go-ethereum/crypto"
|
"github.com/ethereum/go-ethereum/crypto"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// #nosec 101
|
||||||
const (
|
const (
|
||||||
/* #nosec */
|
|
||||||
OpWeightMsgEthSimpleTransfer = "op_weight_msg_eth_simple_transfer"
|
OpWeightMsgEthSimpleTransfer = "op_weight_msg_eth_simple_transfer"
|
||||||
/* #nosec */
|
|
||||||
OpWeightMsgEthCreateContract = "op_weight_msg_eth_create_contract"
|
OpWeightMsgEthCreateContract = "op_weight_msg_eth_create_contract"
|
||||||
/* #nosec */
|
|
||||||
OpWeightMsgEthCallContract = "op_weight_msg_eth_call_contract"
|
OpWeightMsgEthCallContract = "op_weight_msg_eth_call_contract"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -53,6 +53,7 @@ func newJournal() *journal {
|
|||||||
func (j *journal) sortedDirties() []common.Address {
|
func (j *journal) sortedDirties() []common.Address {
|
||||||
keys := make([]common.Address, len(j.dirties))
|
keys := make([]common.Address, len(j.dirties))
|
||||||
i := 0
|
i := 0
|
||||||
|
// #nosec G705
|
||||||
for k := range j.dirties {
|
for k := range j.dirties {
|
||||||
keys[i] = k
|
keys[i] = k
|
||||||
i++
|
i++
|
||||||
|
@ -39,6 +39,7 @@ type Storage map[common.Hash]common.Hash
|
|||||||
func (s Storage) SortedKeys() []common.Hash {
|
func (s Storage) SortedKeys() []common.Hash {
|
||||||
keys := make([]common.Hash, len(s))
|
keys := make([]common.Hash, len(s))
|
||||||
i := 0
|
i := 0
|
||||||
|
// #nosec G705
|
||||||
for k := range s {
|
for k := range s {
|
||||||
keys[i] = k
|
keys[i] = k
|
||||||
i++
|
i++
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"math/rand"
|
"math/rand" // #nosec G702
|
||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
||||||
|
@ -197,7 +197,7 @@ $ %s query %s get [ID]
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
queryClient := types.NewQueryClient(clientCtx)
|
queryClient := types.NewQueryClient(clientCtx)
|
||||||
record, err := queryClient.GetRecord(cmd.Context(), &types.QueryRecordByIdRequest{Id: args[0]})
|
record, err := queryClient.GetRecord(cmd.Context(), &types.QueryRecordByIDRequest{Id: args[0]})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -261,12 +261,11 @@ $ %s query %s query-by-bond [bond id]
|
|||||||
queryClient := types.NewQueryClient(clientCtx)
|
queryClient := types.NewQueryClient(clientCtx)
|
||||||
|
|
||||||
bondID := args[0]
|
bondID := args[0]
|
||||||
res, err := queryClient.GetRecordByBondId(cmd.Context(), &types.QueryRecordByBondIdRequest{Id: bondID})
|
res, err := queryClient.GetRecordByBondID(cmd.Context(), &types.QueryRecordByBondIDRequest{Id: bondID})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return clientCtx.PrintProto(res)
|
return clientCtx.PrintProto(res)
|
||||||
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
flags.AddQueryFlagsToCmd(cmd)
|
flags.AddQueryFlagsToCmd(cmd)
|
||||||
|
@ -75,7 +75,7 @@ $ %s tx %s set [payload file path] [bond-id]
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
flags.AddTxFlags(cmd)
|
cmd, _ = flags.AddTxFlags(cmd)
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,7 +107,7 @@ $ %s tx %s renew-record [record-id]
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
flags.AddTxFlags(cmd)
|
cmd, _ = flags.AddTxFlags(cmd)
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,7 +139,7 @@ $ %s tx %s associate-bond [record-id] [bond-id]
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
flags.AddTxFlags(cmd)
|
cmd, _ = flags.AddTxFlags(cmd)
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -171,7 +171,7 @@ $ %s tx %s dissociate-bond [record-id]
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
flags.AddTxFlags(cmd)
|
cmd, _ = flags.AddTxFlags(cmd)
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -203,7 +203,7 @@ $ %s tx %s dissociate-bond [record-id]
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
flags.AddTxFlags(cmd)
|
cmd, _ = flags.AddTxFlags(cmd)
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -235,7 +235,7 @@ $ %s tx %s reassociate-records [old-bond-id] [new-bond-id]
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
flags.AddTxFlags(cmd)
|
cmd, _ = flags.AddTxFlags(cmd)
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -268,7 +268,7 @@ $ %s tx %s set-name [crn] [cid]
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
flags.AddTxFlags(cmd)
|
cmd, _ = flags.AddTxFlags(cmd)
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -312,7 +312,7 @@ $ %s tx %s reserve-name [name] --owner [ownerAddress]
|
|||||||
|
|
||||||
cmd.Flags().String("owner", "", "Owner address, if creating a sub-authority.")
|
cmd.Flags().String("owner", "", "Owner address, if creating a sub-authority.")
|
||||||
|
|
||||||
flags.AddTxFlags(cmd)
|
cmd, _ = flags.AddTxFlags(cmd)
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -340,7 +340,7 @@ $ %s tx %s authority-bond [name] [bond-id]
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
flags.AddTxFlags(cmd)
|
cmd, _ = flags.AddTxFlags(cmd)
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -367,15 +367,15 @@ $ %s tx %s delete-name [crn]
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
flags.AddTxFlags(cmd)
|
cmd, _ = flags.AddTxFlags(cmd)
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
//GetPayloadFromFile Load payload object from YAML file.
|
// 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
|
||||||
|
|
||||||
data, err := ioutil.ReadFile(filePath)
|
data, err := ioutil.ReadFile(filePath) // #nosec G304
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ import (
|
|||||||
func (s *IntegrationTestSuite) TestGRPCQueryParams() {
|
func (s *IntegrationTestSuite) TestGRPCQueryParams() {
|
||||||
val := s.network.Validators[0]
|
val := s.network.Validators[0]
|
||||||
sr := s.Require()
|
sr := s.Require()
|
||||||
reqUrl := val.APIAddress + "/vulcanize/nameservice/v1beta1/params"
|
reqURL := val.APIAddress + "/vulcanize/nameservice/v1beta1/params"
|
||||||
|
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
name string
|
name string
|
||||||
@ -28,13 +28,13 @@ func (s *IntegrationTestSuite) TestGRPCQueryParams() {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"invalid url",
|
"invalid url",
|
||||||
reqUrl + "/asdasd",
|
reqURL + "/asdasd",
|
||||||
true,
|
true,
|
||||||
"",
|
"",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Success",
|
"Success",
|
||||||
reqUrl,
|
reqURL,
|
||||||
false,
|
false,
|
||||||
"",
|
"",
|
||||||
},
|
},
|
||||||
@ -60,11 +60,12 @@ func (s *IntegrationTestSuite) TestGRPCQueryParams() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//nolint: all
|
||||||
func (s *IntegrationTestSuite) TestGRPCQueryWhoIs() {
|
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 +79,6 @@ func (s *IntegrationTestSuite) TestGRPCQueryWhoIs() {
|
|||||||
true,
|
true,
|
||||||
"",
|
"",
|
||||||
func(authorityName string) {
|
func(authorityName string) {
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -131,8 +131,8 @@ func (s *IntegrationTestSuite) TestGRPCQueryWhoIs() {
|
|||||||
func (s *IntegrationTestSuite) TestGRPCQueryLookup() {
|
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
|
||||||
@ -143,16 +143,15 @@ func (s *IntegrationTestSuite) TestGRPCQueryLookup() {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"invalid url",
|
"invalid url",
|
||||||
reqUrl + "/asdasd",
|
reqURL + "/asdasd",
|
||||||
true,
|
true,
|
||||||
"",
|
"",
|
||||||
func(authorityName string) {
|
func(authorityName string) {
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Success",
|
"Success",
|
||||||
reqUrl,
|
reqURL,
|
||||||
false,
|
false,
|
||||||
"",
|
"",
|
||||||
func(authorityName string) {
|
func(authorityName string) {
|
||||||
@ -166,7 +165,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryLookup() {
|
|||||||
s.Run(tc.name, func() {
|
s.Run(tc.name, func() {
|
||||||
if !tc.expectErr {
|
if !tc.expectErr {
|
||||||
tc.preRun(authorityName)
|
tc.preRun(authorityName)
|
||||||
tc.url = fmt.Sprintf(reqUrl, fmt.Sprintf("crn://%s/", authorityName))
|
tc.url = fmt.Sprintf(reqURL, fmt.Sprintf("crn://%s/", authorityName))
|
||||||
}
|
}
|
||||||
resp, _ := rest.GetRequest(tc.url)
|
resp, _ := rest.GetRequest(tc.url)
|
||||||
if tc.expectErr {
|
if tc.expectErr {
|
||||||
@ -181,6 +180,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryLookup() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//nolint: all
|
||||||
func (s *IntegrationTestSuite) TestGRPCQueryRecordExpiryQueue() {
|
func (s *IntegrationTestSuite) TestGRPCQueryRecordExpiryQueue() {
|
||||||
val := s.network.Validators[0]
|
val := s.network.Validators[0]
|
||||||
sr := s.Require()
|
sr := s.Require()
|
||||||
@ -199,7 +199,6 @@ func (s *IntegrationTestSuite) TestGRPCQueryRecordExpiryQueue() {
|
|||||||
true,
|
true,
|
||||||
"",
|
"",
|
||||||
func(bondId string) {
|
func(bondId string) {
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -235,7 +234,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryRecordExpiryQueue() {
|
|||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
s.Run(tc.name, func() {
|
s.Run(tc.name, func() {
|
||||||
if !tc.expectErr {
|
if !tc.expectErr {
|
||||||
tc.preRun(s.bondId)
|
tc.preRun(s.bondID)
|
||||||
}
|
}
|
||||||
// wait 12 seconds for records expires
|
// wait 12 seconds for records expires
|
||||||
time.Sleep(time.Second * 12)
|
time.Sleep(time.Second * 12)
|
||||||
@ -253,6 +252,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryRecordExpiryQueue() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//nolint: all
|
||||||
func (s *IntegrationTestSuite) TestGRPCQueryAuthorityExpiryQueue() {
|
func (s *IntegrationTestSuite) TestGRPCQueryAuthorityExpiryQueue() {
|
||||||
val := s.network.Validators[0]
|
val := s.network.Validators[0]
|
||||||
sr := s.Require()
|
sr := s.Require()
|
||||||
@ -271,7 +271,6 @@ func (s *IntegrationTestSuite) TestGRPCQueryAuthorityExpiryQueue() {
|
|||||||
true,
|
true,
|
||||||
"",
|
"",
|
||||||
func(authorityName string) {
|
func(authorityName string) {
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -325,6 +324,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryAuthorityExpiryQueue() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//nolint: all
|
||||||
func (s *IntegrationTestSuite) TestGRPCQueryListRecords() {
|
func (s *IntegrationTestSuite) TestGRPCQueryListRecords() {
|
||||||
val := s.network.Validators[0]
|
val := s.network.Validators[0]
|
||||||
sr := s.Require()
|
sr := s.Require()
|
||||||
@ -343,7 +343,6 @@ func (s *IntegrationTestSuite) TestGRPCQueryListRecords() {
|
|||||||
true,
|
true,
|
||||||
"",
|
"",
|
||||||
func(bondId string) {
|
func(bondId string) {
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -379,7 +378,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryListRecords() {
|
|||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
s.Run(tc.name, func() {
|
s.Run(tc.name, func() {
|
||||||
if !tc.expectErr {
|
if !tc.expectErr {
|
||||||
tc.preRun(s.bondId)
|
tc.preRun(s.bondID)
|
||||||
}
|
}
|
||||||
resp, _ := rest.GetRequest(tc.url)
|
resp, _ := rest.GetRequest(tc.url)
|
||||||
require := s.Require()
|
require := s.Require()
|
||||||
@ -390,7 +389,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryListRecords() {
|
|||||||
err := val.ClientCtx.Codec.UnmarshalJSON(resp, &response)
|
err := val.ClientCtx.Codec.UnmarshalJSON(resp, &response)
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
sr.NotZero(len(response.GetRecords()))
|
sr.NotZero(len(response.GetRecords()))
|
||||||
sr.Equal(s.bondId, response.GetRecords()[0].GetBondId())
|
sr.Equal(s.bondID, response.GetRecords()[0].GetBondId())
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -399,7 +398,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryListRecords() {
|
|||||||
func (s *IntegrationTestSuite) TestGRPCQueryGetRecordByID() {
|
func (s *IntegrationTestSuite) TestGRPCQueryGetRecordByID() {
|
||||||
val := s.network.Validators[0]
|
val := s.network.Validators[0]
|
||||||
sr := s.Require()
|
sr := s.Require()
|
||||||
reqUrl := val.APIAddress + "/vulcanize/nameservice/v1beta1/records/%s"
|
reqURL := val.APIAddress + "/vulcanize/nameservice/v1beta1/records/%s"
|
||||||
|
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
name string
|
name string
|
||||||
@ -410,7 +409,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryGetRecordByID() {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"invalid url",
|
"invalid url",
|
||||||
reqUrl + "/asdasd",
|
reqURL + "/asdasd",
|
||||||
true,
|
true,
|
||||||
"",
|
"",
|
||||||
func(bondId string) string {
|
func(bondId string) string {
|
||||||
@ -419,7 +418,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryGetRecordByID() {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Success",
|
"Success",
|
||||||
reqUrl,
|
reqURL,
|
||||||
false,
|
false,
|
||||||
"",
|
"",
|
||||||
func(bondId string) string {
|
func(bondId string) string {
|
||||||
@ -437,29 +436,29 @@ func (s *IntegrationTestSuite) TestGRPCQueryGetRecordByID() {
|
|||||||
var records []nstypes.RecordType
|
var records []nstypes.RecordType
|
||||||
err = json.Unmarshal(out.Bytes(), &records)
|
err = json.Unmarshal(out.Bytes(), &records)
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
return records[0].Id
|
return records[0].ID
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
s.Run(tc.name, func() {
|
s.Run(tc.name, func() {
|
||||||
var recordId string
|
var recordID string
|
||||||
if !tc.expectErr {
|
if !tc.expectErr {
|
||||||
recordId = tc.preRun(s.bondId)
|
recordID = tc.preRun(s.bondID)
|
||||||
tc.url = fmt.Sprintf(reqUrl, recordId)
|
tc.url = fmt.Sprintf(reqURL, recordID)
|
||||||
}
|
}
|
||||||
resp, _ := rest.GetRequest(tc.url)
|
resp, _ := rest.GetRequest(tc.url)
|
||||||
require := s.Require()
|
require := s.Require()
|
||||||
if tc.expectErr {
|
if tc.expectErr {
|
||||||
require.Contains(string(resp), tc.errorMsg)
|
require.Contains(string(resp), tc.errorMsg)
|
||||||
} else {
|
} else {
|
||||||
var response nstypes.QueryRecordByIdResponse
|
var response nstypes.QueryRecordByIDResponse
|
||||||
err := val.ClientCtx.Codec.UnmarshalJSON(resp, &response)
|
err := val.ClientCtx.Codec.UnmarshalJSON(resp, &response)
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
record := response.GetRecord()
|
record := response.GetRecord()
|
||||||
sr.NotZero(len(record.GetId()))
|
sr.NotZero(len(record.GetID()))
|
||||||
sr.Equal(record.GetId(), recordId)
|
sr.Equal(record.GetID(), recordID)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -468,7 +467,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryGetRecordByID() {
|
|||||||
func (s *IntegrationTestSuite) TestGRPCQueryGetRecordByBondID() {
|
func (s *IntegrationTestSuite) TestGRPCQueryGetRecordByBondID() {
|
||||||
val := s.network.Validators[0]
|
val := s.network.Validators[0]
|
||||||
sr := s.Require()
|
sr := s.Require()
|
||||||
reqUrl := val.APIAddress + "/vulcanize/nameservice/v1beta1/records-by-bond-id/%s"
|
reqURL := val.APIAddress + "/vulcanize/nameservice/v1beta1/records-by-bond-id/%s"
|
||||||
|
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
name string
|
name string
|
||||||
@ -479,16 +478,15 @@ func (s *IntegrationTestSuite) TestGRPCQueryGetRecordByBondID() {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"invalid url",
|
"invalid url",
|
||||||
reqUrl + "/asdasd",
|
reqURL + "/asdasd",
|
||||||
true,
|
true,
|
||||||
"",
|
"",
|
||||||
func(bondId string) {
|
func(bondId string) {
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Success",
|
"Success",
|
||||||
reqUrl,
|
reqURL,
|
||||||
false,
|
false,
|
||||||
"",
|
"",
|
||||||
func(bondId string) {
|
func(bondId string) {
|
||||||
@ -501,20 +499,20 @@ func (s *IntegrationTestSuite) TestGRPCQueryGetRecordByBondID() {
|
|||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
s.Run(tc.name, func() {
|
s.Run(tc.name, func() {
|
||||||
if !tc.expectErr {
|
if !tc.expectErr {
|
||||||
tc.preRun(s.bondId)
|
tc.preRun(s.bondID)
|
||||||
tc.url = fmt.Sprintf(reqUrl, s.bondId)
|
tc.url = fmt.Sprintf(reqURL, s.bondID)
|
||||||
}
|
}
|
||||||
resp, _ := rest.GetRequest(tc.url)
|
resp, _ := rest.GetRequest(tc.url)
|
||||||
require := s.Require()
|
require := s.Require()
|
||||||
if tc.expectErr {
|
if tc.expectErr {
|
||||||
require.Contains(string(resp), tc.errorMsg)
|
require.Contains(string(resp), tc.errorMsg)
|
||||||
} else {
|
} else {
|
||||||
var response nstypes.QueryRecordByBondIdResponse
|
var response nstypes.QueryRecordByBondIDResponse
|
||||||
err := val.ClientCtx.Codec.UnmarshalJSON(resp, &response)
|
err := val.ClientCtx.Codec.UnmarshalJSON(resp, &response)
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
records := response.GetRecords()
|
records := response.GetRecords()
|
||||||
sr.NotZero(len(records))
|
sr.NotZero(len(records))
|
||||||
sr.Equal(records[0].GetBondId(), s.bondId)
|
sr.Equal(records[0].GetBondId(), s.bondID)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -523,7 +521,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryGetRecordByBondID() {
|
|||||||
func (s *IntegrationTestSuite) TestGRPCQueryGetNameServiceModuleBalance() {
|
func (s *IntegrationTestSuite) TestGRPCQueryGetNameServiceModuleBalance() {
|
||||||
val := s.network.Validators[0]
|
val := s.network.Validators[0]
|
||||||
sr := s.Require()
|
sr := s.Require()
|
||||||
reqUrl := val.APIAddress + "/vulcanize/nameservice/v1beta1/balance"
|
reqURL := val.APIAddress + "/vulcanize/nameservice/v1beta1/balance"
|
||||||
|
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
name string
|
name string
|
||||||
@ -534,16 +532,15 @@ func (s *IntegrationTestSuite) TestGRPCQueryGetNameServiceModuleBalance() {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"invalid url",
|
"invalid url",
|
||||||
reqUrl + "/asdasd",
|
reqURL + "/asdasd",
|
||||||
true,
|
true,
|
||||||
"",
|
"",
|
||||||
func(bondId string) {
|
func(bondId string) {
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Success",
|
"Success",
|
||||||
reqUrl,
|
reqURL,
|
||||||
false,
|
false,
|
||||||
"",
|
"",
|
||||||
func(bondId string) {
|
func(bondId string) {
|
||||||
@ -556,7 +553,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryGetNameServiceModuleBalance() {
|
|||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
s.Run(tc.name, func() {
|
s.Run(tc.name, func() {
|
||||||
if !tc.expectErr {
|
if !tc.expectErr {
|
||||||
tc.preRun(s.bondId)
|
tc.preRun(s.bondID)
|
||||||
}
|
}
|
||||||
resp, _ := rest.GetRequest(tc.url)
|
resp, _ := rest.GetRequest(tc.url)
|
||||||
require := s.Require()
|
require := s.Require()
|
||||||
@ -575,7 +572,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryGetNameServiceModuleBalance() {
|
|||||||
func (s *IntegrationTestSuite) TestGRPCQueryNamesList() {
|
func (s *IntegrationTestSuite) TestGRPCQueryNamesList() {
|
||||||
val := s.network.Validators[0]
|
val := s.network.Validators[0]
|
||||||
sr := s.Require()
|
sr := s.Require()
|
||||||
reqUrl := val.APIAddress + "/vulcanize/nameservice/v1beta1/names"
|
reqURL := val.APIAddress + "/vulcanize/nameservice/v1beta1/names"
|
||||||
|
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
name string
|
name string
|
||||||
@ -586,16 +583,15 @@ func (s *IntegrationTestSuite) TestGRPCQueryNamesList() {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"invalid url",
|
"invalid url",
|
||||||
reqUrl + "/asdasd",
|
reqURL + "/asdasd",
|
||||||
true,
|
true,
|
||||||
"",
|
"",
|
||||||
func(authorityName string) {
|
func(authorityName string) {
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"Success",
|
"Success",
|
||||||
reqUrl,
|
reqURL,
|
||||||
false,
|
false,
|
||||||
"",
|
"",
|
||||||
func(authorityName string) {
|
func(authorityName string) {
|
||||||
@ -624,7 +620,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryNamesList() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func createRecord(bondId string, s *IntegrationTestSuite) {
|
func createRecord(bondID string, s *IntegrationTestSuite) {
|
||||||
val := s.network.Validators[0]
|
val := s.network.Validators[0]
|
||||||
sr := s.Require()
|
sr := s.Require()
|
||||||
|
|
||||||
@ -638,7 +634,7 @@ func createRecord(bondId string, s *IntegrationTestSuite) {
|
|||||||
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock),
|
fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock),
|
||||||
fmt.Sprintf("--%s=%s", flags.FlagFees, fmt.Sprintf("3%s", s.cfg.BondDenom)),
|
fmt.Sprintf("--%s=%s", flags.FlagFees, fmt.Sprintf("3%s", s.cfg.BondDenom)),
|
||||||
}
|
}
|
||||||
args = append([]string{payloadPath, bondId}, args...)
|
args = append([]string{payloadPath, bondID}, args...)
|
||||||
clientCtx := val.ClientCtx
|
clientCtx := val.ClientCtx
|
||||||
cmd := cli.GetCmdSetRecord()
|
cmd := cli.GetCmdSetRecord()
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ func (s *IntegrationTestSuite) TestGetCmdQueryForRecords() {
|
|||||||
val := s.network.Validators[0]
|
val := s.network.Validators[0]
|
||||||
sr := s.Require()
|
sr := s.Require()
|
||||||
var recordID string
|
var recordID string
|
||||||
var bondId string
|
var bondID string
|
||||||
|
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
name string
|
name string
|
||||||
@ -66,7 +66,6 @@ func (s *IntegrationTestSuite) TestGetCmdQueryForRecords() {
|
|||||||
true,
|
true,
|
||||||
0,
|
0,
|
||||||
func() {
|
func() {
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -77,12 +76,12 @@ func (s *IntegrationTestSuite) TestGetCmdQueryForRecords() {
|
|||||||
func() {
|
func() {
|
||||||
CreateBond(s)
|
CreateBond(s)
|
||||||
// get the bond id from bond list
|
// get the bond id from bond list
|
||||||
bondId := GetBondId(s)
|
bondID := GetBondID(s)
|
||||||
dir, err := os.Getwd()
|
dir, err := os.Getwd()
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
payloadPath := dir + "/example1.yml"
|
payloadPath := dir + "/example1.yml"
|
||||||
args := []string{
|
args := []string{
|
||||||
payloadPath, bondId,
|
payloadPath, bondID,
|
||||||
fmt.Sprintf("--%s=%s", flags.FlagFrom, accountName),
|
fmt.Sprintf("--%s=%s", flags.FlagFrom, accountName),
|
||||||
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
|
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
|
||||||
fmt.Sprintf("--%s=json", tmcli.OutputFlag),
|
fmt.Sprintf("--%s=json", tmcli.OutputFlag),
|
||||||
@ -119,8 +118,8 @@ func (s *IntegrationTestSuite) TestGetCmdQueryForRecords() {
|
|||||||
err := json.Unmarshal(out.Bytes(), &records)
|
err := json.Unmarshal(out.Bytes(), &records)
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
sr.Equal(tc.noOfRecords, len(records))
|
sr.Equal(tc.noOfRecords, len(records))
|
||||||
recordID = records[0].Id
|
recordID = records[0].ID
|
||||||
bondId = GetBondId(s)
|
bondID = GetBondID(s)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -153,7 +152,7 @@ func (s *IntegrationTestSuite) TestGetCmdQueryForRecords() {
|
|||||||
sr.Error(err)
|
sr.Error(err)
|
||||||
} else {
|
} else {
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
var response types.QueryRecordByIdResponse
|
var response types.QueryRecordByIDResponse
|
||||||
err = clientCtx.Codec.UnmarshalJSON(out.Bytes(), &response)
|
err = clientCtx.Codec.UnmarshalJSON(out.Bytes(), &response)
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
sr.NotNil(response.GetRecord())
|
sr.NotNil(response.GetRecord())
|
||||||
@ -174,7 +173,7 @@ func (s *IntegrationTestSuite) TestGetCmdQueryForRecords() {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"get records by bond-id",
|
"get records by bond-id",
|
||||||
[]string{bondId, fmt.Sprintf("--%s=json", tmcli.OutputFlag)},
|
[]string{bondID, fmt.Sprintf("--%s=json", tmcli.OutputFlag)},
|
||||||
false,
|
false,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -189,7 +188,7 @@ func (s *IntegrationTestSuite) TestGetCmdQueryForRecords() {
|
|||||||
sr.Error(err)
|
sr.Error(err)
|
||||||
} else {
|
} else {
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
var response types.QueryRecordByBondIdResponse
|
var response types.QueryRecordByBondIDResponse
|
||||||
err = clientCtx.Codec.UnmarshalJSON(out.Bytes(), &response)
|
err = clientCtx.Codec.UnmarshalJSON(out.Bytes(), &response)
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
}
|
}
|
||||||
@ -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) {
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -546,11 +542,11 @@ func createNameRecord(authorityName string, s *IntegrationTestSuite) {
|
|||||||
CreateBond(s)
|
CreateBond(s)
|
||||||
|
|
||||||
// Get the bond-id
|
// Get the bond-id
|
||||||
bondId := GetBondId(s)
|
bondID := GetBondID(s)
|
||||||
|
|
||||||
// adding bond-id to name authority
|
// adding bond-id to name authority
|
||||||
args = []string{
|
args = []string{
|
||||||
authorityName, bondId,
|
authorityName, bondID,
|
||||||
fmt.Sprintf("--%s=%s", flags.FlagFrom, accountName),
|
fmt.Sprintf("--%s=%s", flags.FlagFrom, accountName),
|
||||||
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
|
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
|
||||||
fmt.Sprintf("--%s=json", tmcli.OutputFlag),
|
fmt.Sprintf("--%s=json", tmcli.OutputFlag),
|
||||||
|
@ -32,7 +32,7 @@ type IntegrationTestSuite struct {
|
|||||||
|
|
||||||
cfg network.Config
|
cfg network.Config
|
||||||
network *network.Network
|
network *network.Network
|
||||||
bondId string
|
bondID string
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewIntegrationTestSuite(cfg network.Config) *IntegrationTestSuite {
|
func NewIntegrationTestSuite(cfg network.Config) *IntegrationTestSuite {
|
||||||
@ -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))
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ func (s *IntegrationTestSuite) SetupSuite() {
|
|||||||
// setting up random account
|
// setting up random account
|
||||||
s.createAccountWithBalance(accountName)
|
s.createAccountWithBalance(accountName)
|
||||||
CreateBond(s)
|
CreateBond(s)
|
||||||
s.bondId = GetBondId(s)
|
s.bondID = GetBondID(s)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *IntegrationTestSuite) createAccountWithBalance(accountName string) {
|
func (s *IntegrationTestSuite) createAccountWithBalance(accountName string) {
|
||||||
@ -139,7 +139,7 @@ func CreateBond(s *IntegrationTestSuite) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetBondId(s *IntegrationTestSuite) string {
|
func GetBondID(s *IntegrationTestSuite) string {
|
||||||
cmd := bondcli.GetQueryBondLists()
|
cmd := bondcli.GetQueryBondLists()
|
||||||
val := s.network.Validators[0]
|
val := s.network.Validators[0]
|
||||||
sr := s.Require()
|
sr := s.Require()
|
||||||
@ -153,7 +153,7 @@ func GetBondId(s *IntegrationTestSuite) string {
|
|||||||
|
|
||||||
// extract bond id from bonds list
|
// extract bond id from bonds list
|
||||||
bond := queryResponse.GetBonds()[0]
|
bond := queryResponse.GetBonds()[0]
|
||||||
return bond.GetId()
|
return bond.GetID()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *IntegrationTestSuite) TestGetCmdSetRecord() {
|
func (s *IntegrationTestSuite) TestGetCmdSetRecord() {
|
||||||
@ -195,12 +195,12 @@ func (s *IntegrationTestSuite) TestGetCmdSetRecord() {
|
|||||||
// create the bond
|
// create the bond
|
||||||
CreateBond(s)
|
CreateBond(s)
|
||||||
// get the bond id from bond list
|
// get the bond id from bond list
|
||||||
bondId := GetBondId(s)
|
bondID := GetBondID(s)
|
||||||
dir, err := os.Getwd()
|
dir, err := os.Getwd()
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
payloadPath := dir + "/example1.yml"
|
payloadPath := dir + "/example1.yml"
|
||||||
|
|
||||||
tc.args = append([]string{payloadPath, bondId}, tc.args...)
|
tc.args = append([]string{payloadPath, bondID}, tc.args...)
|
||||||
}
|
}
|
||||||
clientCtx := val.ClientCtx
|
clientCtx := val.ClientCtx
|
||||||
cmd := cli.GetCmdSetRecord()
|
cmd := cli.GetCmdSetRecord()
|
||||||
@ -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) {
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -346,11 +345,11 @@ func (s *IntegrationTestSuite) TestGetCmdSetName() {
|
|||||||
CreateBond(s)
|
CreateBond(s)
|
||||||
|
|
||||||
// Get the bond-id
|
// Get the bond-id
|
||||||
bondId := GetBondId(s)
|
bondID := GetBondID(s)
|
||||||
|
|
||||||
// adding bond-id to name authority
|
// adding bond-id to name authority
|
||||||
args = []string{
|
args = []string{
|
||||||
authorityName, bondId,
|
authorityName, bondID,
|
||||||
fmt.Sprintf("--%s=%s", flags.FlagFrom, accountName),
|
fmt.Sprintf("--%s=%s", flags.FlagFrom, accountName),
|
||||||
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
|
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
|
||||||
fmt.Sprintf("--%s=json", tmcli.OutputFlag),
|
fmt.Sprintf("--%s=json", tmcli.OutputFlag),
|
||||||
@ -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) {
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -457,8 +455,8 @@ func (s *IntegrationTestSuite) TestGetCmdSetAuthorityBond() {
|
|||||||
// creating the bond
|
// creating the bond
|
||||||
CreateBond(s)
|
CreateBond(s)
|
||||||
// getting the bond-id
|
// getting the bond-id
|
||||||
bondId := GetBondId(s)
|
bondID := GetBondID(s)
|
||||||
tc.args = append([]string{authorityName, bondId}, tc.args...)
|
tc.args = append([]string{authorityName, bondID}, tc.args...)
|
||||||
}
|
}
|
||||||
clientCtx := val.ClientCtx
|
clientCtx := val.ClientCtx
|
||||||
cmd := cli.GetCmdSetAuthorityBond()
|
cmd := cli.GetCmdSetAuthorityBond()
|
||||||
@ -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) {
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -581,13 +577,13 @@ func (s *IntegrationTestSuite) TestGetCmdDissociateBond() {
|
|||||||
// create the bond
|
// create the bond
|
||||||
CreateBond(s)
|
CreateBond(s)
|
||||||
// get the bond id from bond list
|
// get the bond id from bond list
|
||||||
bondId := GetBondId(s)
|
bondID := GetBondID(s)
|
||||||
dir, err := os.Getwd()
|
dir, err := os.Getwd()
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
payloadPath := dir + "/example1.yml"
|
payloadPath := dir + "/example1.yml"
|
||||||
|
|
||||||
args := []string{
|
args := []string{
|
||||||
payloadPath, bondId,
|
payloadPath, bondID,
|
||||||
fmt.Sprintf("--%s=%s", flags.FlagFrom, accountName),
|
fmt.Sprintf("--%s=%s", flags.FlagFrom, accountName),
|
||||||
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
|
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
|
||||||
fmt.Sprintf("--%s=json", tmcli.OutputFlag),
|
fmt.Sprintf("--%s=json", tmcli.OutputFlag),
|
||||||
@ -613,7 +609,7 @@ func (s *IntegrationTestSuite) TestGetCmdDissociateBond() {
|
|||||||
var records []nstypes.RecordType
|
var records []nstypes.RecordType
|
||||||
err = json.Unmarshal(out.Bytes(), &records)
|
err = json.Unmarshal(out.Bytes(), &records)
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
return records[0].Id
|
return records[0].ID
|
||||||
},
|
},
|
||||||
func(recordId string, s *IntegrationTestSuite) {
|
func(recordId string, s *IntegrationTestSuite) {
|
||||||
// checking the bond-id removed or not
|
// checking the bond-id removed or not
|
||||||
@ -622,7 +618,7 @@ func (s *IntegrationTestSuite) TestGetCmdDissociateBond() {
|
|||||||
cmd := cli.GetCmdGetResource()
|
cmd := cli.GetCmdGetResource()
|
||||||
out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, args)
|
out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, args)
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
var response nstypes.QueryRecordByIdResponse
|
var response nstypes.QueryRecordByIDResponse
|
||||||
err = clientCtx.Codec.UnmarshalJSON(out.Bytes(), &response)
|
err = clientCtx.Codec.UnmarshalJSON(out.Bytes(), &response)
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
record := response.GetRecord()
|
record := response.GetRecord()
|
||||||
@ -634,10 +630,10 @@ func (s *IntegrationTestSuite) TestGetCmdDissociateBond() {
|
|||||||
|
|
||||||
for _, tc := range testCasesForDeletingName {
|
for _, tc := range testCasesForDeletingName {
|
||||||
s.Run(fmt.Sprintf("Case %s", tc.name), func() {
|
s.Run(fmt.Sprintf("Case %s", tc.name), func() {
|
||||||
var recordId string
|
var recordID string
|
||||||
if !tc.err {
|
if !tc.err {
|
||||||
recordId = tc.preRun(s)
|
recordID = tc.preRun(s)
|
||||||
tc.args = append([]string{recordId}, tc.args...)
|
tc.args = append([]string{recordID}, tc.args...)
|
||||||
}
|
}
|
||||||
clientCtx := val.ClientCtx
|
clientCtx := val.ClientCtx
|
||||||
cmd := cli.GetCmdDissociateBond()
|
cmd := cli.GetCmdDissociateBond()
|
||||||
@ -652,14 +648,14 @@ func (s *IntegrationTestSuite) TestGetCmdDissociateBond() {
|
|||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
sr.Zero(d.Code)
|
sr.Zero(d.Code)
|
||||||
// post-run
|
// post-run
|
||||||
tc.postRun(recordId, s)
|
tc.postRun(recordID, s)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
//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 {
|
||||||
@ -683,7 +679,7 @@ func (s *IntegrationTestSuite) TestGetCmdDissociateBond() {
|
|||||||
// return "", ""
|
// return "", ""
|
||||||
// },
|
// },
|
||||||
// func(recordId string, s *IntegrationTestSuite) {
|
// func(recordId string, s *IntegrationTestSuite) {
|
||||||
//
|
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
// {
|
// {
|
||||||
@ -704,7 +700,7 @@ func (s *IntegrationTestSuite) TestGetCmdDissociateBond() {
|
|||||||
// dir, err := os.Getwd()
|
// dir, err := os.Getwd()
|
||||||
// sr.NoError(err)
|
// sr.NoError(err)
|
||||||
// payloadPath := dir + "/example1.yml"
|
// payloadPath := dir + "/example1.yml"
|
||||||
//
|
|
||||||
// args := []string{
|
// args := []string{
|
||||||
// payloadPath, bondId,
|
// payloadPath, bondId,
|
||||||
// fmt.Sprintf("--%s=%s", flags.FlagFrom, accountName),
|
// fmt.Sprintf("--%s=%s", flags.FlagFrom, accountName),
|
||||||
@ -713,17 +709,17 @@ func (s *IntegrationTestSuite) TestGetCmdDissociateBond() {
|
|||||||
// fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock),
|
// fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock),
|
||||||
// fmt.Sprintf("--%s=%s", flags.FlagFees, fmt.Sprintf("3%s", s.cfg.BondDenom)),
|
// fmt.Sprintf("--%s=%s", flags.FlagFees, fmt.Sprintf("3%s", s.cfg.BondDenom)),
|
||||||
// }
|
// }
|
||||||
//
|
|
||||||
// clientCtx := val.ClientCtx
|
// clientCtx := val.ClientCtx
|
||||||
// cmd := cli.GetCmdSetRecord()
|
// cmd := cli.GetCmdSetRecord()
|
||||||
//
|
|
||||||
// out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, args)
|
// out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, args)
|
||||||
// sr.NoError(err)
|
// sr.NoError(err)
|
||||||
// var d sdk.TxResponse
|
// var d sdk.TxResponse
|
||||||
// err = val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &d)
|
// err = val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &d)
|
||||||
// sr.NoError(err)
|
// sr.NoError(err)
|
||||||
// sr.Zero(d.Code)
|
// sr.Zero(d.Code)
|
||||||
//
|
|
||||||
// // retrieving the record-id
|
// // retrieving the record-id
|
||||||
// args = []string{fmt.Sprintf("--%s=json", tmcli.OutputFlag)}
|
// args = []string{fmt.Sprintf("--%s=json", tmcli.OutputFlag)}
|
||||||
// cmd = cli.GetCmdList()
|
// cmd = cli.GetCmdList()
|
||||||
@ -755,7 +751,7 @@ func (s *IntegrationTestSuite) TestGetCmdDissociateBond() {
|
|||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
// }
|
// }
|
||||||
//
|
|
||||||
// for _, tc := range testCasesForDeletingName {
|
// for _, tc := range testCasesForDeletingName {
|
||||||
// s.Run(fmt.Sprintf("Case %s", tc.name), func() {
|
// s.Run(fmt.Sprintf("Case %s", tc.name), func() {
|
||||||
// var bondId string
|
// var bondId string
|
||||||
@ -766,7 +762,7 @@ func (s *IntegrationTestSuite) TestGetCmdDissociateBond() {
|
|||||||
// }
|
// }
|
||||||
// clientCtx := val.ClientCtx
|
// clientCtx := val.ClientCtx
|
||||||
// cmd := cli.GetCmdDissociateRecords()
|
// cmd := cli.GetCmdDissociateRecords()
|
||||||
//
|
|
||||||
// out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args)
|
// out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args)
|
||||||
// if tc.err {
|
// if tc.err {
|
||||||
// sr.Error(err)
|
// sr.Error(err)
|
||||||
@ -781,7 +777,7 @@ func (s *IntegrationTestSuite) TestGetCmdDissociateBond() {
|
|||||||
// }
|
// }
|
||||||
// })
|
// })
|
||||||
// }
|
// }
|
||||||
//}
|
// }
|
||||||
|
|
||||||
func (s *IntegrationTestSuite) TestGetCmdAssociateBond() {
|
func (s *IntegrationTestSuite) TestGetCmdAssociateBond() {
|
||||||
val := s.network.Validators[0]
|
val := s.network.Validators[0]
|
||||||
@ -807,7 +803,6 @@ func (s *IntegrationTestSuite) TestGetCmdAssociateBond() {
|
|||||||
return "", ""
|
return "", ""
|
||||||
},
|
},
|
||||||
func(recordId, bondId string, s *IntegrationTestSuite) {
|
func(recordId, bondId string, s *IntegrationTestSuite) {
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -824,13 +819,13 @@ func (s *IntegrationTestSuite) TestGetCmdAssociateBond() {
|
|||||||
// create the bond
|
// create the bond
|
||||||
CreateBond(s)
|
CreateBond(s)
|
||||||
// get the bond id from bond list
|
// get the bond id from bond list
|
||||||
bondId := GetBondId(s)
|
bondID := GetBondID(s)
|
||||||
dir, err := os.Getwd()
|
dir, err := os.Getwd()
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
payloadPath := dir + "/example1.yml"
|
payloadPath := dir + "/example1.yml"
|
||||||
|
|
||||||
txArgs := []string{
|
txArgs := []string{
|
||||||
payloadPath, bondId,
|
payloadPath, bondID,
|
||||||
fmt.Sprintf("--%s=%s", flags.FlagFrom, accountName),
|
fmt.Sprintf("--%s=%s", flags.FlagFrom, accountName),
|
||||||
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
|
fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation),
|
||||||
fmt.Sprintf("--%s=json", tmcli.OutputFlag),
|
fmt.Sprintf("--%s=json", tmcli.OutputFlag),
|
||||||
@ -859,14 +854,14 @@ func (s *IntegrationTestSuite) TestGetCmdAssociateBond() {
|
|||||||
|
|
||||||
// GetCmdDissociateBond bond
|
// GetCmdDissociateBond bond
|
||||||
cmd = cli.GetCmdDissociateBond()
|
cmd = cli.GetCmdDissociateBond()
|
||||||
txArgs = append([]string{records[0].Id}, txArgs[2:]...)
|
txArgs = append([]string{records[0].ID}, txArgs[2:]...)
|
||||||
out, err = clitestutil.ExecTestCLICmd(clientCtx, cmd, txArgs)
|
out, err = clitestutil.ExecTestCLICmd(clientCtx, cmd, txArgs)
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
err = val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &d)
|
err = val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &d)
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
sr.Zero(d.Code)
|
sr.Zero(d.Code)
|
||||||
|
|
||||||
return records[0].Id, records[0].BondId
|
return records[0].ID, records[0].BondID
|
||||||
},
|
},
|
||||||
func(recordId, bondId string, s *IntegrationTestSuite) {
|
func(recordId, bondId string, s *IntegrationTestSuite) {
|
||||||
// checking the bond-id removed or not
|
// checking the bond-id removed or not
|
||||||
@ -875,7 +870,7 @@ func (s *IntegrationTestSuite) TestGetCmdAssociateBond() {
|
|||||||
cmd := cli.GetCmdGetResource()
|
cmd := cli.GetCmdGetResource()
|
||||||
out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, args)
|
out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, args)
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
var response nstypes.QueryRecordByIdResponse
|
var response nstypes.QueryRecordByIDResponse
|
||||||
err = clientCtx.Codec.UnmarshalJSON(out.Bytes(), &response)
|
err = clientCtx.Codec.UnmarshalJSON(out.Bytes(), &response)
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
record := response.GetRecord()
|
record := response.GetRecord()
|
||||||
@ -887,11 +882,11 @@ func (s *IntegrationTestSuite) TestGetCmdAssociateBond() {
|
|||||||
|
|
||||||
for _, tc := range testCasesForDeletingName {
|
for _, tc := range testCasesForDeletingName {
|
||||||
s.Run(fmt.Sprintf("Case %s", tc.name), func() {
|
s.Run(fmt.Sprintf("Case %s", tc.name), func() {
|
||||||
var recordId string
|
var recordID string
|
||||||
var bondId string
|
var bondID string
|
||||||
if !tc.err {
|
if !tc.err {
|
||||||
recordId, bondId = tc.preRun(s)
|
recordID, bondID = tc.preRun(s)
|
||||||
tc.args = append([]string{recordId, bondId}, tc.args...)
|
tc.args = append([]string{recordID, bondID}, tc.args...)
|
||||||
}
|
}
|
||||||
clientCtx := val.ClientCtx
|
clientCtx := val.ClientCtx
|
||||||
cmd := cli.GetCmdAssociateBond()
|
cmd := cli.GetCmdAssociateBond()
|
||||||
@ -906,7 +901,7 @@ func (s *IntegrationTestSuite) TestGetCmdAssociateBond() {
|
|||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
sr.Zero(d.Code)
|
sr.Zero(d.Code)
|
||||||
// post-run
|
// post-run
|
||||||
tc.postRun(recordId, bondId, s)
|
tc.postRun(recordID, bondID, s)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -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,7 @@ 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.
|
// 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)
|
||||||
|
|
||||||
@ -60,12 +59,13 @@ func ExportGenesis(ctx sdk.Context, keeper keeper.Keeper) types.GenesisState {
|
|||||||
records := keeper.ListRecords(ctx)
|
records := keeper.ListRecords(ctx)
|
||||||
|
|
||||||
authorities := keeper.ListNameAuthorityRecords(ctx)
|
authorities := keeper.ListNameAuthorityRecords(ctx)
|
||||||
var authorityEntries []types.AuthorityEntry
|
authorityEntries := []types.AuthorityEntry{}
|
||||||
|
// #nosec G705
|
||||||
for name, record := range authorities {
|
for name, record := range authorities {
|
||||||
authorityEntries = append(authorityEntries, types.AuthorityEntry{
|
authorityEntries = append(authorityEntries, types.AuthorityEntry{
|
||||||
Name: name,
|
Name: name,
|
||||||
Entry: &record,
|
Entry: &record, //nolint: all
|
||||||
})
|
}) // #nosec G601
|
||||||
}
|
}
|
||||||
|
|
||||||
names := keeper.ListNameRecords(ctx)
|
names := keeper.ListNameRecords(ctx)
|
||||||
|
@ -7,11 +7,10 @@ import (
|
|||||||
"encoding/gob"
|
"encoding/gob"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"sort"
|
||||||
|
|
||||||
wnsUtils "github.com/cerc-io/laconicd/utils"
|
wnsUtils "github.com/cerc-io/laconicd/utils"
|
||||||
set "github.com/deckarep/golang-set"
|
set "github.com/deckarep/golang-set"
|
||||||
|
|
||||||
"sort"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func StringToBytes(val string) []byte {
|
func StringToBytes(val string) []byte {
|
||||||
@ -44,7 +43,7 @@ func BytesArrToStringArr(val []byte) ([]string, error) {
|
|||||||
|
|
||||||
func Int64ToBytes(num int64) []byte {
|
func Int64ToBytes(num int64) []byte {
|
||||||
buf := new(bytes.Buffer)
|
buf := new(bytes.Buffer)
|
||||||
binary.Write(buf, binary.BigEndian, num)
|
_ = binary.Write(buf, binary.BigEndian, num)
|
||||||
return buf.Bytes()
|
return buf.Bytes()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -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.")
|
||||||
}
|
}
|
||||||
|
@ -30,8 +30,7 @@ func (q Querier) ListRecords(c context.Context, req *types.QueryListRecordsReque
|
|||||||
ctx := sdk.UnwrapSDKContext(c)
|
ctx := sdk.UnwrapSDKContext(c)
|
||||||
attributes := req.GetAttributes()
|
attributes := req.GetAttributes()
|
||||||
all := req.GetAll()
|
all := req.GetAll()
|
||||||
records := []types.Record{}
|
var records []types.Record
|
||||||
|
|
||||||
if len(attributes) > 0 {
|
if len(attributes) > 0 {
|
||||||
records = q.Keeper.MatchRecords(ctx, func(record *types.RecordType) bool {
|
records = q.Keeper.MatchRecords(ctx, func(record *types.RecordType) bool {
|
||||||
return MatchOnAttributes(record, attributes, all)
|
return MatchOnAttributes(record, attributes, all)
|
||||||
@ -43,20 +42,20 @@ func (q Querier) ListRecords(c context.Context, req *types.QueryListRecordsReque
|
|||||||
return &types.QueryListRecordsResponse{Records: records}, nil
|
return &types.QueryListRecordsResponse{Records: records}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (q Querier) GetRecord(c context.Context, req *types.QueryRecordByIdRequest) (*types.QueryRecordByIdResponse, error) {
|
func (q Querier) GetRecord(c context.Context, req *types.QueryRecordByIDRequest) (*types.QueryRecordByIDResponse, error) {
|
||||||
ctx := sdk.UnwrapSDKContext(c)
|
ctx := sdk.UnwrapSDKContext(c)
|
||||||
id := req.GetId()
|
id := req.GetId()
|
||||||
if !q.Keeper.HasRecord(ctx, id) {
|
if !q.Keeper.HasRecord(ctx, id) {
|
||||||
return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "Record not found.")
|
return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "Record not found.")
|
||||||
}
|
}
|
||||||
record := q.Keeper.GetRecord(ctx, id)
|
record := q.Keeper.GetRecord(ctx, id)
|
||||||
return &types.QueryRecordByIdResponse{Record: record}, nil
|
return &types.QueryRecordByIDResponse{Record: record}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (q Querier) GetRecordByBondId(c context.Context, req *types.QueryRecordByBondIdRequest) (*types.QueryRecordByBondIdResponse, error) {
|
func (q Querier) GetRecordByBondID(c context.Context, req *types.QueryRecordByBondIDRequest) (*types.QueryRecordByBondIDResponse, error) {
|
||||||
ctx := sdk.UnwrapSDKContext(c)
|
ctx := sdk.UnwrapSDKContext(c)
|
||||||
records := q.recordKeeper.QueryRecordsByBond(ctx, req.GetId())
|
records := q.recordKeeper.QueryRecordsByBond(ctx, req.GetId())
|
||||||
return &types.QueryRecordByBondIdResponse{Records: records}, nil
|
return &types.QueryRecordByBondIDResponse{Records: records}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (q Querier) GetNameServiceModuleBalance(c context.Context, _ *types.GetNameServiceModuleBalanceRequest) (*types.GetNameServiceModuleBalanceResponse, error) {
|
func (q Querier) GetNameServiceModuleBalance(c context.Context, _ *types.GetNameServiceModuleBalanceRequest) (*types.GetNameServiceModuleBalanceResponse, error) {
|
||||||
@ -122,7 +121,7 @@ func matchOnRecordField(record *types.RecordType, attr *types.QueryListRecordsRe
|
|||||||
case BondIDAttributeName:
|
case BondIDAttributeName:
|
||||||
{
|
{
|
||||||
fieldFound = true
|
fieldFound = true
|
||||||
if record.BondId != attr.Value.GetString_() {
|
if record.BondID != attr.Value.GetString_() {
|
||||||
matched = false
|
matched = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -64,12 +64,12 @@ func (suite *KeeperTestSuite) TestGrpcGetRecordLists() {
|
|||||||
payload, err := cli.GetPayloadFromFile(dir + "/../helpers/examples/example1.yml")
|
payload, err := cli.GetPayloadFromFile(dir + "/../helpers/examples/example1.yml")
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
record, err := suite.app.NameServiceKeeper.ProcessSetRecord(ctx, nameservicetypes.MsgSetRecord{
|
record, err := suite.app.NameServiceKeeper.ProcessSetRecord(ctx, nameservicetypes.MsgSetRecord{
|
||||||
BondId: suite.bond.GetId(),
|
BondId: suite.bond.GetID(),
|
||||||
Signer: suite.accounts[0].String(),
|
Signer: suite.accounts[0].String(),
|
||||||
Payload: payload.ToPayload(),
|
Payload: payload.ToPayload(),
|
||||||
})
|
})
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
sr.NotNil(record.Id)
|
sr.NotNil(record.ID)
|
||||||
}
|
}
|
||||||
resp, err := grpcClient.ListRecords(context.Background(), test.req)
|
resp, err := grpcClient.ListRecords(context.Background(), test.req)
|
||||||
if test.expErr {
|
if test.expErr {
|
||||||
@ -78,9 +78,9 @@ func (suite *KeeperTestSuite) TestGrpcGetRecordLists() {
|
|||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
sr.Equal(test.noOfRecords, len(resp.GetRecords()))
|
sr.Equal(test.noOfRecords, len(resp.GetRecords()))
|
||||||
if test.createRecord {
|
if test.createRecord {
|
||||||
recordId = resp.GetRecords()[0].GetId()
|
recordId = resp.GetRecords()[0].GetID()
|
||||||
sr.NotZero(resp.GetRecords())
|
sr.NotZero(resp.GetRecords())
|
||||||
sr.Equal(resp.GetRecords()[0].GetBondId(), suite.bond.GetId())
|
sr.Equal(resp.GetRecords()[0].GetBondId(), suite.bond.GetID())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -89,21 +89,21 @@ func (suite *KeeperTestSuite) TestGrpcGetRecordLists() {
|
|||||||
// Get the records by record id
|
// Get the records by record id
|
||||||
testCases1 := []struct {
|
testCases1 := []struct {
|
||||||
msg string
|
msg string
|
||||||
req *nameservicetypes.QueryRecordByIdRequest
|
req *nameservicetypes.QueryRecordByIDRequest
|
||||||
createRecord bool
|
createRecord bool
|
||||||
expErr bool
|
expErr bool
|
||||||
noOfRecords int
|
noOfRecords int
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"Invalid Request without record id",
|
"Invalid Request without record id",
|
||||||
&nameservicetypes.QueryRecordByIdRequest{},
|
&nameservicetypes.QueryRecordByIDRequest{},
|
||||||
false,
|
false,
|
||||||
true,
|
true,
|
||||||
0,
|
0,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"With Record ID",
|
"With Record ID",
|
||||||
&nameservicetypes.QueryRecordByIdRequest{
|
&nameservicetypes.QueryRecordByIDRequest{
|
||||||
Id: recordId,
|
Id: recordId,
|
||||||
},
|
},
|
||||||
true,
|
true,
|
||||||
@ -120,7 +120,7 @@ func (suite *KeeperTestSuite) TestGrpcGetRecordLists() {
|
|||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
sr.NotNil(resp.GetRecord())
|
sr.NotNil(resp.GetRecord())
|
||||||
if test.createRecord {
|
if test.createRecord {
|
||||||
sr.Equal(resp.GetRecord().BondId, suite.bond.GetId())
|
sr.Equal(resp.GetRecord().BondId, suite.bond.GetID())
|
||||||
sr.Equal(resp.GetRecord().Id, recordId)
|
sr.Equal(resp.GetRecord().Id, recordId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -130,22 +130,22 @@ func (suite *KeeperTestSuite) TestGrpcGetRecordLists() {
|
|||||||
// Get the records by record id
|
// Get the records by record id
|
||||||
testCasesByBondID := []struct {
|
testCasesByBondID := []struct {
|
||||||
msg string
|
msg string
|
||||||
req *nameservicetypes.QueryRecordByBondIdRequest
|
req *nameservicetypes.QueryRecordByBondIDRequest
|
||||||
createRecord bool
|
createRecord bool
|
||||||
expErr bool
|
expErr bool
|
||||||
noOfRecords int
|
noOfRecords int
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"Invalid Request without bond id",
|
"Invalid Request without bond id",
|
||||||
&nameservicetypes.QueryRecordByBondIdRequest{},
|
&nameservicetypes.QueryRecordByBondIDRequest{},
|
||||||
false,
|
false,
|
||||||
true,
|
true,
|
||||||
0,
|
0,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"With Bond ID",
|
"With Bond ID",
|
||||||
&nameservicetypes.QueryRecordByBondIdRequest{
|
&nameservicetypes.QueryRecordByBondIDRequest{
|
||||||
Id: suite.bond.GetId(),
|
Id: suite.bond.GetID(),
|
||||||
},
|
},
|
||||||
true,
|
true,
|
||||||
false,
|
false,
|
||||||
@ -154,7 +154,7 @@ func (suite *KeeperTestSuite) TestGrpcGetRecordLists() {
|
|||||||
}
|
}
|
||||||
for _, test := range testCasesByBondID {
|
for _, test := range testCasesByBondID {
|
||||||
suite.Run(fmt.Sprintf("Case %s ", test.msg), func() {
|
suite.Run(fmt.Sprintf("Case %s ", test.msg), func() {
|
||||||
resp, err := grpcClient.GetRecordByBondId(context.Background(), test.req)
|
resp, err := grpcClient.GetRecordByBondID(context.Background(), test.req)
|
||||||
if test.expErr {
|
if test.expErr {
|
||||||
sr.Zero(resp.GetRecords())
|
sr.Zero(resp.GetRecords())
|
||||||
} else {
|
} else {
|
||||||
@ -162,7 +162,7 @@ func (suite *KeeperTestSuite) TestGrpcGetRecordLists() {
|
|||||||
sr.NotNil(resp.GetRecords())
|
sr.NotNil(resp.GetRecords())
|
||||||
if test.createRecord {
|
if test.createRecord {
|
||||||
sr.NotZero(resp.GetRecords())
|
sr.NotZero(resp.GetRecords())
|
||||||
sr.Equal(resp.GetRecords()[0].GetBondId(), suite.bond.GetId())
|
sr.Equal(resp.GetRecords()[0].GetBondId(), suite.bond.GetID())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -195,12 +195,12 @@ func (suite *KeeperTestSuite) TestGrpcQueryNameserviceModuleBalance() {
|
|||||||
payload, err := cli.GetPayloadFromFile(dir + "/../helpers/examples/example1.yml")
|
payload, err := cli.GetPayloadFromFile(dir + "/../helpers/examples/example1.yml")
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
record, err := suite.app.NameServiceKeeper.ProcessSetRecord(ctx, nameservicetypes.MsgSetRecord{
|
record, err := suite.app.NameServiceKeeper.ProcessSetRecord(ctx, nameservicetypes.MsgSetRecord{
|
||||||
BondId: suite.bond.GetId(),
|
BondId: suite.bond.GetID(),
|
||||||
Signer: suite.accounts[0].String(),
|
Signer: suite.accounts[0].String(),
|
||||||
Payload: payload.ToPayload(),
|
Payload: payload.ToPayload(),
|
||||||
})
|
})
|
||||||
sr.NoError(err)
|
sr.NoError(err)
|
||||||
sr.NotNil(record.Id)
|
sr.NotNil(record.ID)
|
||||||
}
|
}
|
||||||
resp, err := grpcClient.GetNameServiceModuleBalance(context.Background(), test.req)
|
resp, err := grpcClient.GetNameServiceModuleBalance(context.Background(), test.req)
|
||||||
if test.expErr {
|
if test.expErr {
|
||||||
@ -220,7 +220,7 @@ func (suite *KeeperTestSuite) TestGrpcQueryNameserviceModuleBalance() {
|
|||||||
func (suite *KeeperTestSuite) TestGrpcQueryWhoIS() {
|
func (suite *KeeperTestSuite) TestGrpcQueryWhoIS() {
|
||||||
grpcClient, ctx := suite.queryClient, suite.ctx
|
grpcClient, ctx := suite.queryClient, suite.ctx
|
||||||
sr := suite.Require()
|
sr := suite.Require()
|
||||||
var authorityName = "TestGrpcQueryWhoIS"
|
authorityName := "TestGrpcQueryWhoIS"
|
||||||
|
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
msg string
|
msg string
|
||||||
|
@ -15,21 +15,21 @@ 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())
|
||||||
// if bz != nil {
|
// if bz != nil {
|
||||||
// var obj types.RecordObj
|
// var obj types.RecordObj
|
||||||
// k.cdc.MustUnmarshalBinaryBare(bz, &obj)
|
// k.cdc.MustUnmarshalBinaryBare(bz, &obj)
|
||||||
// record := obj.ToRecord()
|
// record := obj.ToRecord()
|
||||||
//
|
|
||||||
// if record.BondID != "" && !k.bondKeeper.HasBond(ctx, record.BondID) {
|
// if record.BondID != "" && !k.bondKeeper.HasBond(ctx, record.BondID) {
|
||||||
// return sdk.FormatInvariant(types.ModuleName, "record-bond", fmt.Sprintf("Bond not found for record ID: '%s'.", record.ID)), true
|
// return sdk.FormatInvariant(types.ModuleName, "record-bond", fmt.Sprintf("Bond not found for record ID: '%s'.", record.ID)), true
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
//}
|
// }
|
||||||
|
|
||||||
return "", false
|
return "", false
|
||||||
}
|
}
|
||||||
|
@ -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())
|
||||||
@ -121,7 +122,7 @@ func (k Keeper) ListRecords(ctx sdk.Context) []types.Record {
|
|||||||
if bz != nil {
|
if bz != nil {
|
||||||
var obj types.Record
|
var obj types.Record
|
||||||
k.cdc.MustUnmarshal(bz, &obj)
|
k.cdc.MustUnmarshal(bz, &obj)
|
||||||
records = append(records, recordObjToRecord(store, k.cdc, obj))
|
records = append(records, recordObjToRecord(store, obj))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -140,7 +141,7 @@ func (k Keeper) MatchRecords(ctx sdk.Context, matchFn func(*types.RecordType) bo
|
|||||||
if bz != nil {
|
if bz != nil {
|
||||||
var obj types.Record
|
var obj types.Record
|
||||||
k.cdc.MustUnmarshal(bz, &obj)
|
k.cdc.MustUnmarshal(bz, &obj)
|
||||||
obj = recordObjToRecord(store, k.cdc, obj)
|
obj = recordObjToRecord(store, obj)
|
||||||
record := obj.ToRecordType()
|
record := obj.ToRecordType()
|
||||||
if matchFn(&record) {
|
if matchFn(&record) {
|
||||||
records = append(records, obj)
|
records = append(records, obj)
|
||||||
@ -174,7 +175,7 @@ func (k Keeper) GetRecordExpiryQueue(ctx sdk.Context) []*types.ExpiryQueueRecord
|
|||||||
// ProcessSetRecord creates a record.
|
// ProcessSetRecord creates a record.
|
||||||
func (k Keeper) ProcessSetRecord(ctx sdk.Context, msg types.MsgSetRecord) (*types.RecordType, error) {
|
func (k Keeper) ProcessSetRecord(ctx sdk.Context, msg types.MsgSetRecord) (*types.RecordType, error) {
|
||||||
payload := msg.Payload.ToReadablePayload()
|
payload := msg.Payload.ToReadablePayload()
|
||||||
record := types.RecordType{Attributes: payload.Record, BondId: msg.BondId}
|
record := types.RecordType{Attributes: payload.Record, BondID: msg.BondId}
|
||||||
|
|
||||||
// Check signatures.
|
// Check signatures.
|
||||||
resourceSignBytes, _ := record.GetSignBytes()
|
resourceSignBytes, _ := record.GetSignBytes()
|
||||||
@ -183,9 +184,9 @@ func (k Keeper) ProcessSetRecord(ctx sdk.Context, msg types.MsgSetRecord) (*type
|
|||||||
return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Invalid record JSON")
|
return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Invalid record JSON")
|
||||||
}
|
}
|
||||||
|
|
||||||
record.Id = cid
|
record.ID = cid
|
||||||
|
|
||||||
if exists := k.HasRecord(ctx, record.Id); exists {
|
if exists := k.HasRecord(ctx, record.ID); exists {
|
||||||
// Immutable record already exists. No-op.
|
// Immutable record already exists. No-op.
|
||||||
return &record, nil
|
return &record, nil
|
||||||
}
|
}
|
||||||
@ -219,7 +220,7 @@ func (k Keeper) processRecord(ctx sdk.Context, record *types.RecordType, isRenew
|
|||||||
params := k.GetParams(ctx)
|
params := k.GetParams(ctx)
|
||||||
rent := params.RecordRent
|
rent := params.RecordRent
|
||||||
|
|
||||||
err := k.bondKeeper.TransferCoinsToModuleAccount(ctx, record.BondId, types.RecordRentModuleAccountName, sdk.NewCoins(rent))
|
err := k.bondKeeper.TransferCoinsToModuleAccount(ctx, record.BondID, types.RecordRentModuleAccountName, sdk.NewCoins(rent))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -233,7 +234,7 @@ func (k Keeper) processRecord(ctx sdk.Context, record *types.RecordType, isRenew
|
|||||||
|
|
||||||
// Renewal doesn't change the name and bond indexes.
|
// Renewal doesn't change the name and bond indexes.
|
||||||
if !isRenewal {
|
if !isRenewal {
|
||||||
k.AddBondToRecordIndexEntry(ctx, record.BondId, record.Id)
|
k.AddBondToRecordIndexEntry(ctx, record.BondID, record.ID)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
@ -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)
|
||||||
}
|
}
|
||||||
@ -421,12 +419,11 @@ func (k Keeper) GetModuleBalances(ctx sdk.Context) []*types.AccountBalance {
|
|||||||
return balances
|
return balances
|
||||||
}
|
}
|
||||||
|
|
||||||
func recordObjToRecord(store sdk.KVStore, codec codec.BinaryCodec, record types.Record) types.Record {
|
func recordObjToRecord(store sdk.KVStore, record types.Record) types.Record {
|
||||||
reverseNameIndexKey := GetCIDToNamesIndexKey(record.Id)
|
reverseNameIndexKey := GetCIDToNamesIndexKey(record.Id)
|
||||||
|
|
||||||
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)
|
||||||
}
|
}
|
||||||
|
@ -17,9 +17,7 @@ import (
|
|||||||
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
|
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var seed = int64(233)
|
||||||
seed = int64(233)
|
|
||||||
)
|
|
||||||
|
|
||||||
type KeeperTestSuite struct {
|
type KeeperTestSuite struct {
|
||||||
suite.Suite
|
suite.Suite
|
||||||
|
@ -38,7 +38,7 @@ func (m msgServer) SetRecord(c context.Context, msg *types.MsgSetRecord) (*types
|
|||||||
sdk.NewEvent(
|
sdk.NewEvent(
|
||||||
types.EventTypeSetRecord,
|
types.EventTypeSetRecord,
|
||||||
sdk.NewAttribute(types.AttributeKeySigner, msg.GetSigner()),
|
sdk.NewAttribute(types.AttributeKeySigner, msg.GetSigner()),
|
||||||
sdk.NewAttribute(types.AttributeKeyBondId, msg.GetBondId()),
|
sdk.NewAttribute(types.AttributeKeyBondID, msg.GetBondId()),
|
||||||
sdk.NewAttribute(types.AttributeKeyPayload, msg.Payload.String()),
|
sdk.NewAttribute(types.AttributeKeyPayload, msg.Payload.String()),
|
||||||
),
|
),
|
||||||
sdk.NewEvent(
|
sdk.NewEvent(
|
||||||
@ -48,9 +48,10 @@ func (m msgServer) SetRecord(c context.Context, msg *types.MsgSetRecord) (*types
|
|||||||
),
|
),
|
||||||
})
|
})
|
||||||
|
|
||||||
return &types.MsgSetRecordResponse{Id: record.Id}, nil
|
return &types.MsgSetRecordResponse{Id: record.ID}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//nolint: all
|
||||||
func (m msgServer) SetName(c context.Context, msg *types.MsgSetName) (*types.MsgSetNameResponse, error) {
|
func (m msgServer) SetName(c context.Context, msg *types.MsgSetName) (*types.MsgSetNameResponse, error) {
|
||||||
ctx := sdk.UnwrapSDKContext(c)
|
ctx := sdk.UnwrapSDKContext(c)
|
||||||
_, err := sdk.AccAddressFromBech32(msg.Signer)
|
_, err := sdk.AccAddressFromBech32(msg.Signer)
|
||||||
@ -107,6 +108,7 @@ func (m msgServer) ReserveName(c context.Context, msg *types.MsgReserveAuthority
|
|||||||
return &types.MsgReserveAuthorityResponse{}, nil
|
return &types.MsgReserveAuthorityResponse{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//nolint: all
|
||||||
func (m msgServer) SetAuthorityBond(c context.Context, msg *types.MsgSetAuthorityBond) (*types.MsgSetAuthorityBondResponse, error) {
|
func (m msgServer) SetAuthorityBond(c context.Context, msg *types.MsgSetAuthorityBond) (*types.MsgSetAuthorityBondResponse, error) {
|
||||||
ctx := sdk.UnwrapSDKContext(c)
|
ctx := sdk.UnwrapSDKContext(c)
|
||||||
_, err := sdk.AccAddressFromBech32(msg.Signer)
|
_, err := sdk.AccAddressFromBech32(msg.Signer)
|
||||||
@ -122,7 +124,7 @@ func (m msgServer) SetAuthorityBond(c context.Context, msg *types.MsgSetAuthorit
|
|||||||
types.EventTypeAuthorityBond,
|
types.EventTypeAuthorityBond,
|
||||||
sdk.NewAttribute(types.AttributeKeySigner, msg.Signer),
|
sdk.NewAttribute(types.AttributeKeySigner, msg.Signer),
|
||||||
sdk.NewAttribute(types.AttributeKeyName, msg.Name),
|
sdk.NewAttribute(types.AttributeKeyName, msg.Name),
|
||||||
sdk.NewAttribute(types.AttributeKeyBondId, msg.BondId),
|
sdk.NewAttribute(types.AttributeKeyBondID, msg.BondId),
|
||||||
),
|
),
|
||||||
sdk.NewEvent(
|
sdk.NewEvent(
|
||||||
sdk.EventTypeMessage,
|
sdk.EventTypeMessage,
|
||||||
@ -161,6 +163,9 @@ func (m msgServer) DeleteName(c context.Context, msg *types.MsgDeleteNameAuthori
|
|||||||
func (m msgServer) RenewRecord(c context.Context, msg *types.MsgRenewRecord) (*types.MsgRenewRecordResponse, error) {
|
func (m msgServer) RenewRecord(c context.Context, msg *types.MsgRenewRecord) (*types.MsgRenewRecordResponse, error) {
|
||||||
ctx := sdk.UnwrapSDKContext(c)
|
ctx := sdk.UnwrapSDKContext(c)
|
||||||
_, err := sdk.AccAddressFromBech32(msg.Signer)
|
_, err := sdk.AccAddressFromBech32(msg.Signer)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
err = m.Keeper.ProcessRenewRecord(ctx, *msg)
|
err = m.Keeper.ProcessRenewRecord(ctx, *msg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -169,7 +174,7 @@ func (m msgServer) RenewRecord(c context.Context, msg *types.MsgRenewRecord) (*t
|
|||||||
sdk.NewEvent(
|
sdk.NewEvent(
|
||||||
types.EventTypeRenewRecord,
|
types.EventTypeRenewRecord,
|
||||||
sdk.NewAttribute(types.AttributeKeySigner, msg.Signer),
|
sdk.NewAttribute(types.AttributeKeySigner, msg.Signer),
|
||||||
sdk.NewAttribute(types.AttributeKeyRecordId, msg.RecordId),
|
sdk.NewAttribute(types.AttributeKeyRecordID, msg.RecordId),
|
||||||
),
|
),
|
||||||
sdk.NewEvent(
|
sdk.NewEvent(
|
||||||
sdk.EventTypeMessage,
|
sdk.EventTypeMessage,
|
||||||
@ -180,6 +185,7 @@ func (m msgServer) RenewRecord(c context.Context, msg *types.MsgRenewRecord) (*t
|
|||||||
return &types.MsgRenewRecordResponse{}, nil
|
return &types.MsgRenewRecordResponse{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//nolint: all
|
||||||
func (m msgServer) AssociateBond(c context.Context, msg *types.MsgAssociateBond) (*types.MsgAssociateBondResponse, error) {
|
func (m msgServer) AssociateBond(c context.Context, msg *types.MsgAssociateBond) (*types.MsgAssociateBondResponse, error) {
|
||||||
ctx := sdk.UnwrapSDKContext(c)
|
ctx := sdk.UnwrapSDKContext(c)
|
||||||
_, err := sdk.AccAddressFromBech32(msg.Signer)
|
_, err := sdk.AccAddressFromBech32(msg.Signer)
|
||||||
@ -195,8 +201,8 @@ func (m msgServer) AssociateBond(c context.Context, msg *types.MsgAssociateBond)
|
|||||||
sdk.NewEvent(
|
sdk.NewEvent(
|
||||||
types.EventTypeAssociateBond,
|
types.EventTypeAssociateBond,
|
||||||
sdk.NewAttribute(types.AttributeKeySigner, msg.Signer),
|
sdk.NewAttribute(types.AttributeKeySigner, msg.Signer),
|
||||||
sdk.NewAttribute(types.AttributeKeyRecordId, msg.RecordId),
|
sdk.NewAttribute(types.AttributeKeyRecordID, msg.RecordId),
|
||||||
sdk.NewAttribute(types.AttributeKeyBondId, msg.BondId),
|
sdk.NewAttribute(types.AttributeKeyBondID, msg.BondId),
|
||||||
),
|
),
|
||||||
sdk.NewEvent(
|
sdk.NewEvent(
|
||||||
sdk.EventTypeMessage,
|
sdk.EventTypeMessage,
|
||||||
@ -221,7 +227,7 @@ func (m msgServer) DissociateBond(c context.Context, msg *types.MsgDissociateBon
|
|||||||
sdk.NewEvent(
|
sdk.NewEvent(
|
||||||
types.EventTypeDissociateBond,
|
types.EventTypeDissociateBond,
|
||||||
sdk.NewAttribute(types.AttributeKeySigner, msg.Signer),
|
sdk.NewAttribute(types.AttributeKeySigner, msg.Signer),
|
||||||
sdk.NewAttribute(types.AttributeKeyRecordId, msg.RecordId),
|
sdk.NewAttribute(types.AttributeKeyRecordID, msg.RecordId),
|
||||||
),
|
),
|
||||||
sdk.NewEvent(
|
sdk.NewEvent(
|
||||||
sdk.EventTypeMessage,
|
sdk.EventTypeMessage,
|
||||||
@ -246,7 +252,7 @@ func (m msgServer) DissociateRecords(c context.Context, msg *types.MsgDissociate
|
|||||||
sdk.NewEvent(
|
sdk.NewEvent(
|
||||||
types.EventTypeDissociateRecords,
|
types.EventTypeDissociateRecords,
|
||||||
sdk.NewAttribute(types.AttributeKeySigner, msg.Signer),
|
sdk.NewAttribute(types.AttributeKeySigner, msg.Signer),
|
||||||
sdk.NewAttribute(types.AttributeKeyBondId, msg.BondId),
|
sdk.NewAttribute(types.AttributeKeyBondID, msg.BondId),
|
||||||
),
|
),
|
||||||
sdk.NewEvent(
|
sdk.NewEvent(
|
||||||
sdk.EventTypeMessage,
|
sdk.EventTypeMessage,
|
||||||
@ -257,19 +263,23 @@ func (m msgServer) DissociateRecords(c context.Context, msg *types.MsgDissociate
|
|||||||
return &types.MsgDissociateRecordsResponse{}, nil
|
return &types.MsgDissociateRecordsResponse{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m msgServer) ReAssociateRecords(c context.Context, msg *types.MsgReAssociateRecords) (*types.MsgReAssociateRecordsResponse, error) {
|
func (m msgServer) ReAssociateRecords(c context.Context, msg *types.MsgReAssociateRecords) (*types.MsgReAssociateRecordsResponse, error) { //nolint: all
|
||||||
ctx := sdk.UnwrapSDKContext(c)
|
ctx := sdk.UnwrapSDKContext(c)
|
||||||
_, err := sdk.AccAddressFromBech32(msg.Signer)
|
_, err := sdk.AccAddressFromBech32(msg.Signer)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
err = m.Keeper.ProcessReAssociateRecords(ctx, *msg)
|
err = m.Keeper.ProcessReAssociateRecords(ctx, *msg)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
ctx.EventManager().EmitEvents(sdk.Events{
|
ctx.EventManager().EmitEvents(sdk.Events{
|
||||||
sdk.NewEvent(
|
sdk.NewEvent(
|
||||||
types.EventTypeReAssociateRecords,
|
types.EventTypeReAssociateRecords,
|
||||||
sdk.NewAttribute(types.AttributeKeySigner, msg.Signer),
|
sdk.NewAttribute(types.AttributeKeySigner, msg.Signer),
|
||||||
sdk.NewAttribute(types.AttributeKeyOldBondId, msg.OldBondId),
|
sdk.NewAttribute(types.AttributeKeyOldBondID, msg.OldBondId),
|
||||||
sdk.NewAttribute(types.AttributeKeyNewBondId, msg.NewBondId),
|
sdk.NewAttribute(types.AttributeKeyNewBondID, msg.NewBondId),
|
||||||
),
|
),
|
||||||
sdk.NewEvent(
|
sdk.NewEvent(
|
||||||
sdk.EventTypeMessage,
|
sdk.EventTypeMessage,
|
||||||
|
@ -651,9 +651,7 @@ func (k Keeper) GetAllExpiredAuthorities(ctx sdk.Context, currTime time.Time) (e
|
|||||||
defer itr.Close()
|
defer itr.Close()
|
||||||
|
|
||||||
for ; itr.Valid(); itr.Next() {
|
for ; itr.Valid(); itr.Next() {
|
||||||
timeslice := []string{}
|
|
||||||
timeslice, err := helpers.BytesArrToStringArr(itr.Value())
|
timeslice, err := helpers.BytesArrToStringArr(itr.Value())
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
@ -25,8 +25,8 @@ func (k RecordKeeper) UsesAuction(ctx sdk.Context, auctionID string) bool {
|
|||||||
return k.GetAuctionToAuthorityMapping(ctx, auctionID) != ""
|
return k.GetAuctionToAuthorityMapping(ctx, auctionID) != ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (k RecordKeeper) OnAuction(ctx sdk.Context, auctionId string) {
|
func (k RecordKeeper) OnAuction(ctx sdk.Context, auctionID string) {
|
||||||
updateBlockChangeSetForAuction(ctx, k, auctionId)
|
updateBlockChangeSetForAuction(ctx, k, auctionID)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (k RecordKeeper) OnAuctionBid(ctx sdk.Context, auctionID string, bidderAddress string) {
|
func (k RecordKeeper) OnAuctionBid(ctx sdk.Context, auctionID string, bidderAddress string) {
|
||||||
@ -89,8 +89,10 @@ func (k RecordKeeper) OnAuctionWinnerSelected(ctx sdk.Context, auctionID string)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Record keeper implements the bond usage keeper interface.
|
// Record keeper implements the bond usage keeper interface.
|
||||||
var _ bondtypes.BondUsageKeeper = (*RecordKeeper)(nil)
|
var (
|
||||||
var _ auctiontypes.AuctionUsageKeeper = (*RecordKeeper)(nil)
|
_ bondtypes.BondUsageKeeper = (*RecordKeeper)(nil)
|
||||||
|
_ auctiontypes.AuctionUsageKeeper = (*RecordKeeper)(nil)
|
||||||
|
)
|
||||||
|
|
||||||
// ModuleName returns the module name.
|
// ModuleName returns the module name.
|
||||||
func (k RecordKeeper) ModuleName() string {
|
func (k RecordKeeper) ModuleName() string {
|
||||||
@ -109,8 +111,8 @@ func (k RecordKeeper) GetAuctionToAuthorityMapping(ctx sdk.Context, auctionID st
|
|||||||
}
|
}
|
||||||
|
|
||||||
// UsesBond returns true if the bond has associated records.
|
// UsesBond returns true if the bond has associated records.
|
||||||
func (k RecordKeeper) UsesBond(ctx sdk.Context, bondId string) bool {
|
func (k RecordKeeper) UsesBond(ctx sdk.Context, bondID string) bool {
|
||||||
bondIDPrefix := append(PrefixBondIDToRecordsIndex, []byte(bondId)...)
|
bondIDPrefix := append(PrefixBondIDToRecordsIndex, []byte(bondID)...) //nolint: all
|
||||||
store := ctx.KVStore(k.storeKey)
|
store := ctx.KVStore(k.storeKey)
|
||||||
itr := sdk.KVStorePrefixIterator(store, bondIDPrefix)
|
itr := sdk.KVStorePrefixIterator(store, bondIDPrefix)
|
||||||
defer itr.Close()
|
defer itr.Close()
|
||||||
@ -136,7 +138,7 @@ func NewRecordKeeper(auctionKeeper auctionkeeper.Keeper, storeKey storetypes.Sto
|
|||||||
func (k RecordKeeper) QueryRecordsByBond(ctx sdk.Context, bondID string) []types.Record {
|
func (k RecordKeeper) QueryRecordsByBond(ctx sdk.Context, bondID string) []types.Record {
|
||||||
var records []types.Record
|
var records []types.Record
|
||||||
|
|
||||||
bondIDPrefix := append(PrefixBondIDToRecordsIndex, []byte(bondID)...)
|
bondIDPrefix := append(PrefixBondIDToRecordsIndex, []byte(bondID)...) //nolint: all
|
||||||
store := ctx.KVStore(k.storeKey)
|
store := ctx.KVStore(k.storeKey)
|
||||||
itr := sdk.KVStorePrefixIterator(store, bondIDPrefix)
|
itr := sdk.KVStorePrefixIterator(store, bondIDPrefix)
|
||||||
defer itr.Close()
|
defer itr.Close()
|
||||||
@ -146,7 +148,7 @@ func (k RecordKeeper) QueryRecordsByBond(ctx sdk.Context, bondID string) []types
|
|||||||
if bz != nil {
|
if bz != nil {
|
||||||
var obj types.Record
|
var obj types.Record
|
||||||
k.cdc.MustUnmarshal(bz, &obj)
|
k.cdc.MustUnmarshal(bz, &obj)
|
||||||
records = append(records, recordObjToRecord(store, k.cdc, obj))
|
records = append(records, recordObjToRecord(store, obj))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,7 +164,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 +183,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.")
|
||||||
}
|
}
|
||||||
|
@ -106,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)
|
||||||
|
|
||||||
|
@ -13,13 +13,13 @@ const (
|
|||||||
|
|
||||||
AttributeKeySigner = "signer"
|
AttributeKeySigner = "signer"
|
||||||
AttributeKeyOwner = "owner"
|
AttributeKeyOwner = "owner"
|
||||||
AttributeKeyBondId = "bond-id"
|
AttributeKeyBondID = "bond-id"
|
||||||
AttributeKeyPayload = "payload"
|
AttributeKeyPayload = "payload"
|
||||||
AttributeKeyOldBondId = "old-bond-id"
|
AttributeKeyOldBondID = "old-bond-id"
|
||||||
AttributeKeyNewBondId = "new-bond-id"
|
AttributeKeyNewBondID = "new-bond-id"
|
||||||
AttributeKeyCID = "cid"
|
AttributeKeyCID = "cid"
|
||||||
AttributeKeyName = "name"
|
AttributeKeyName = "name"
|
||||||
AttributeKeyCRN = "crn"
|
AttributeKeyCRN = "crn"
|
||||||
AttributeKeyRecordId = "record-id"
|
AttributeKeyRecordID = "record-id"
|
||||||
AttributeValueCategory = ModuleName
|
AttributeValueCategory = ModuleName
|
||||||
)
|
)
|
||||||
|
@ -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.")
|
||||||
}
|
}
|
||||||
@ -101,11 +99,11 @@ func (msg MsgReserveAuthority) GetSigners() []sdk.AccAddress {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewMsgSetAuthorityBond is the constructor function for MsgSetAuthorityBond.
|
// NewMsgSetAuthorityBond is the constructor function for MsgSetAuthorityBond.
|
||||||
func NewMsgSetAuthorityBond(name string, bondId string, signer sdk.AccAddress) MsgSetAuthorityBond {
|
func NewMsgSetAuthorityBond(name string, bondID string, signer sdk.AccAddress) MsgSetAuthorityBond {
|
||||||
return MsgSetAuthorityBond{
|
return MsgSetAuthorityBond{
|
||||||
Name: name,
|
Name: name,
|
||||||
Signer: signer.String(),
|
Signer: signer.String(),
|
||||||
BondId: bondId,
|
BondId: bondID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
x/nameservice/types/nameservice.pb.go
generated
2
x/nameservice/types/nameservice.pb.go
generated
@ -199,7 +199,7 @@ func (m *Record) XXX_DiscardUnknown() {
|
|||||||
|
|
||||||
var xxx_messageInfo_Record proto.InternalMessageInfo
|
var xxx_messageInfo_Record proto.InternalMessageInfo
|
||||||
|
|
||||||
func (m *Record) GetId() string {
|
func (m *Record) GetID() string {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
return m.Id
|
return m.Id
|
||||||
}
|
}
|
||||||
|
@ -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,
|
||||||
|
408
x/nameservice/types/query.pb.go
generated
408
x/nameservice/types/query.pb.go
generated
@ -421,23 +421,23 @@ func (m *QueryListRecordsResponse) GetPagination() *query.PageResponse {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// QueryRecordByIdRequest is request type for nameservice records by id
|
// QueryRecordByIDRequest is request type for nameservice records by id
|
||||||
type QueryRecordByIdRequest struct {
|
type QueryRecordByIDRequest struct {
|
||||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *QueryRecordByIdRequest) Reset() { *m = QueryRecordByIdRequest{} }
|
func (m *QueryRecordByIDRequest) Reset() { *m = QueryRecordByIDRequest{} }
|
||||||
func (m *QueryRecordByIdRequest) String() string { return proto.CompactTextString(m) }
|
func (m *QueryRecordByIDRequest) String() string { return proto.CompactTextString(m) }
|
||||||
func (*QueryRecordByIdRequest) ProtoMessage() {}
|
func (*QueryRecordByIDRequest) ProtoMessage() {}
|
||||||
func (*QueryRecordByIdRequest) Descriptor() ([]byte, []int) {
|
func (*QueryRecordByIDRequest) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_73d2465766c8f876, []int{4}
|
return fileDescriptor_73d2465766c8f876, []int{4}
|
||||||
}
|
}
|
||||||
func (m *QueryRecordByIdRequest) XXX_Unmarshal(b []byte) error {
|
func (m *QueryRecordByIDRequest) XXX_Unmarshal(b []byte) error {
|
||||||
return m.Unmarshal(b)
|
return m.Unmarshal(b)
|
||||||
}
|
}
|
||||||
func (m *QueryRecordByIdRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
func (m *QueryRecordByIDRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
if deterministic {
|
if deterministic {
|
||||||
return xxx_messageInfo_QueryRecordByIdRequest.Marshal(b, m, deterministic)
|
return xxx_messageInfo_QueryRecordByIDRequest.Marshal(b, m, deterministic)
|
||||||
} else {
|
} else {
|
||||||
b = b[:cap(b)]
|
b = b[:cap(b)]
|
||||||
n, err := m.MarshalToSizedBuffer(b)
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
@ -447,42 +447,42 @@ func (m *QueryRecordByIdRequest) XXX_Marshal(b []byte, deterministic bool) ([]by
|
|||||||
return b[:n], nil
|
return b[:n], nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func (m *QueryRecordByIdRequest) XXX_Merge(src proto.Message) {
|
func (m *QueryRecordByIDRequest) XXX_Merge(src proto.Message) {
|
||||||
xxx_messageInfo_QueryRecordByIdRequest.Merge(m, src)
|
xxx_messageInfo_QueryRecordByIDRequest.Merge(m, src)
|
||||||
}
|
}
|
||||||
func (m *QueryRecordByIdRequest) XXX_Size() int {
|
func (m *QueryRecordByIDRequest) XXX_Size() int {
|
||||||
return m.Size()
|
return m.Size()
|
||||||
}
|
}
|
||||||
func (m *QueryRecordByIdRequest) XXX_DiscardUnknown() {
|
func (m *QueryRecordByIDRequest) XXX_DiscardUnknown() {
|
||||||
xxx_messageInfo_QueryRecordByIdRequest.DiscardUnknown(m)
|
xxx_messageInfo_QueryRecordByIDRequest.DiscardUnknown(m)
|
||||||
}
|
}
|
||||||
|
|
||||||
var xxx_messageInfo_QueryRecordByIdRequest proto.InternalMessageInfo
|
var xxx_messageInfo_QueryRecordByIDRequest proto.InternalMessageInfo
|
||||||
|
|
||||||
func (m *QueryRecordByIdRequest) GetId() string {
|
func (m *QueryRecordByIDRequest) GetId() string {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
return m.Id
|
return m.Id
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
// QueryRecordByIdResponse is response type for nameservice records by id
|
// QueryRecordByIDResponse is response type for nameservice records by id
|
||||||
type QueryRecordByIdResponse struct {
|
type QueryRecordByIDResponse struct {
|
||||||
Record Record `protobuf:"bytes,1,opt,name=record,proto3" json:"record"`
|
Record Record `protobuf:"bytes,1,opt,name=record,proto3" json:"record"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *QueryRecordByIdResponse) Reset() { *m = QueryRecordByIdResponse{} }
|
func (m *QueryRecordByIDResponse) Reset() { *m = QueryRecordByIDResponse{} }
|
||||||
func (m *QueryRecordByIdResponse) String() string { return proto.CompactTextString(m) }
|
func (m *QueryRecordByIDResponse) String() string { return proto.CompactTextString(m) }
|
||||||
func (*QueryRecordByIdResponse) ProtoMessage() {}
|
func (*QueryRecordByIDResponse) ProtoMessage() {}
|
||||||
func (*QueryRecordByIdResponse) Descriptor() ([]byte, []int) {
|
func (*QueryRecordByIDResponse) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_73d2465766c8f876, []int{5}
|
return fileDescriptor_73d2465766c8f876, []int{5}
|
||||||
}
|
}
|
||||||
func (m *QueryRecordByIdResponse) XXX_Unmarshal(b []byte) error {
|
func (m *QueryRecordByIDResponse) XXX_Unmarshal(b []byte) error {
|
||||||
return m.Unmarshal(b)
|
return m.Unmarshal(b)
|
||||||
}
|
}
|
||||||
func (m *QueryRecordByIdResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
func (m *QueryRecordByIDResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
if deterministic {
|
if deterministic {
|
||||||
return xxx_messageInfo_QueryRecordByIdResponse.Marshal(b, m, deterministic)
|
return xxx_messageInfo_QueryRecordByIDResponse.Marshal(b, m, deterministic)
|
||||||
} else {
|
} else {
|
||||||
b = b[:cap(b)]
|
b = b[:cap(b)]
|
||||||
n, err := m.MarshalToSizedBuffer(b)
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
@ -492,19 +492,19 @@ func (m *QueryRecordByIdResponse) XXX_Marshal(b []byte, deterministic bool) ([]b
|
|||||||
return b[:n], nil
|
return b[:n], nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func (m *QueryRecordByIdResponse) XXX_Merge(src proto.Message) {
|
func (m *QueryRecordByIDResponse) XXX_Merge(src proto.Message) {
|
||||||
xxx_messageInfo_QueryRecordByIdResponse.Merge(m, src)
|
xxx_messageInfo_QueryRecordByIDResponse.Merge(m, src)
|
||||||
}
|
}
|
||||||
func (m *QueryRecordByIdResponse) XXX_Size() int {
|
func (m *QueryRecordByIDResponse) XXX_Size() int {
|
||||||
return m.Size()
|
return m.Size()
|
||||||
}
|
}
|
||||||
func (m *QueryRecordByIdResponse) XXX_DiscardUnknown() {
|
func (m *QueryRecordByIDResponse) XXX_DiscardUnknown() {
|
||||||
xxx_messageInfo_QueryRecordByIdResponse.DiscardUnknown(m)
|
xxx_messageInfo_QueryRecordByIDResponse.DiscardUnknown(m)
|
||||||
}
|
}
|
||||||
|
|
||||||
var xxx_messageInfo_QueryRecordByIdResponse proto.InternalMessageInfo
|
var xxx_messageInfo_QueryRecordByIDResponse proto.InternalMessageInfo
|
||||||
|
|
||||||
func (m *QueryRecordByIdResponse) GetRecord() Record {
|
func (m *QueryRecordByIDResponse) GetRecord() Record {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
return m.Record
|
return m.Record
|
||||||
}
|
}
|
||||||
@ -512,24 +512,24 @@ func (m *QueryRecordByIdResponse) GetRecord() Record {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// QueryRecordByBondIdRequest is request type for get the records by bond-id
|
// QueryRecordByBondIdRequest is request type for get the records by bond-id
|
||||||
type QueryRecordByBondIdRequest struct {
|
type QueryRecordByBondIDRequest struct {
|
||||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||||
// pagination defines an optional pagination for the request.
|
// pagination defines an optional pagination for the request.
|
||||||
Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
|
Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *QueryRecordByBondIdRequest) Reset() { *m = QueryRecordByBondIdRequest{} }
|
func (m *QueryRecordByBondIDRequest) Reset() { *m = QueryRecordByBondIDRequest{} }
|
||||||
func (m *QueryRecordByBondIdRequest) String() string { return proto.CompactTextString(m) }
|
func (m *QueryRecordByBondIDRequest) String() string { return proto.CompactTextString(m) }
|
||||||
func (*QueryRecordByBondIdRequest) ProtoMessage() {}
|
func (*QueryRecordByBondIDRequest) ProtoMessage() {}
|
||||||
func (*QueryRecordByBondIdRequest) Descriptor() ([]byte, []int) {
|
func (*QueryRecordByBondIDRequest) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_73d2465766c8f876, []int{6}
|
return fileDescriptor_73d2465766c8f876, []int{6}
|
||||||
}
|
}
|
||||||
func (m *QueryRecordByBondIdRequest) XXX_Unmarshal(b []byte) error {
|
func (m *QueryRecordByBondIDRequest) XXX_Unmarshal(b []byte) error {
|
||||||
return m.Unmarshal(b)
|
return m.Unmarshal(b)
|
||||||
}
|
}
|
||||||
func (m *QueryRecordByBondIdRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
func (m *QueryRecordByBondIDRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
if deterministic {
|
if deterministic {
|
||||||
return xxx_messageInfo_QueryRecordByBondIdRequest.Marshal(b, m, deterministic)
|
return xxx_messageInfo_QueryRecordByBondIDRequest.Marshal(b, m, deterministic)
|
||||||
} else {
|
} else {
|
||||||
b = b[:cap(b)]
|
b = b[:cap(b)]
|
||||||
n, err := m.MarshalToSizedBuffer(b)
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
@ -539,26 +539,26 @@ func (m *QueryRecordByBondIdRequest) XXX_Marshal(b []byte, deterministic bool) (
|
|||||||
return b[:n], nil
|
return b[:n], nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func (m *QueryRecordByBondIdRequest) XXX_Merge(src proto.Message) {
|
func (m *QueryRecordByBondIDRequest) XXX_Merge(src proto.Message) {
|
||||||
xxx_messageInfo_QueryRecordByBondIdRequest.Merge(m, src)
|
xxx_messageInfo_QueryRecordByBondIDRequest.Merge(m, src)
|
||||||
}
|
}
|
||||||
func (m *QueryRecordByBondIdRequest) XXX_Size() int {
|
func (m *QueryRecordByBondIDRequest) XXX_Size() int {
|
||||||
return m.Size()
|
return m.Size()
|
||||||
}
|
}
|
||||||
func (m *QueryRecordByBondIdRequest) XXX_DiscardUnknown() {
|
func (m *QueryRecordByBondIDRequest) XXX_DiscardUnknown() {
|
||||||
xxx_messageInfo_QueryRecordByBondIdRequest.DiscardUnknown(m)
|
xxx_messageInfo_QueryRecordByBondIDRequest.DiscardUnknown(m)
|
||||||
}
|
}
|
||||||
|
|
||||||
var xxx_messageInfo_QueryRecordByBondIdRequest proto.InternalMessageInfo
|
var xxx_messageInfo_QueryRecordByBondIDRequest proto.InternalMessageInfo
|
||||||
|
|
||||||
func (m *QueryRecordByBondIdRequest) GetId() string {
|
func (m *QueryRecordByBondIDRequest) GetId() string {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
return m.Id
|
return m.Id
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *QueryRecordByBondIdRequest) GetPagination() *query.PageRequest {
|
func (m *QueryRecordByBondIDRequest) GetPagination() *query.PageRequest {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
return m.Pagination
|
return m.Pagination
|
||||||
}
|
}
|
||||||
@ -566,24 +566,24 @@ func (m *QueryRecordByBondIdRequest) GetPagination() *query.PageRequest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// QueryRecordByBondIdResponse is response type for records list by bond-id
|
// QueryRecordByBondIdResponse is response type for records list by bond-id
|
||||||
type QueryRecordByBondIdResponse struct {
|
type QueryRecordByBondIDResponse struct {
|
||||||
Records []Record `protobuf:"bytes,1,rep,name=records,proto3" json:"records"`
|
Records []Record `protobuf:"bytes,1,rep,name=records,proto3" json:"records"`
|
||||||
// pagination defines the pagination in the response.
|
// pagination defines the pagination in the response.
|
||||||
Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
|
Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *QueryRecordByBondIdResponse) Reset() { *m = QueryRecordByBondIdResponse{} }
|
func (m *QueryRecordByBondIDResponse) Reset() { *m = QueryRecordByBondIDResponse{} }
|
||||||
func (m *QueryRecordByBondIdResponse) String() string { return proto.CompactTextString(m) }
|
func (m *QueryRecordByBondIDResponse) String() string { return proto.CompactTextString(m) }
|
||||||
func (*QueryRecordByBondIdResponse) ProtoMessage() {}
|
func (*QueryRecordByBondIDResponse) ProtoMessage() {}
|
||||||
func (*QueryRecordByBondIdResponse) Descriptor() ([]byte, []int) {
|
func (*QueryRecordByBondIDResponse) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_73d2465766c8f876, []int{7}
|
return fileDescriptor_73d2465766c8f876, []int{7}
|
||||||
}
|
}
|
||||||
func (m *QueryRecordByBondIdResponse) XXX_Unmarshal(b []byte) error {
|
func (m *QueryRecordByBondIDResponse) XXX_Unmarshal(b []byte) error {
|
||||||
return m.Unmarshal(b)
|
return m.Unmarshal(b)
|
||||||
}
|
}
|
||||||
func (m *QueryRecordByBondIdResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
func (m *QueryRecordByBondIDResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
if deterministic {
|
if deterministic {
|
||||||
return xxx_messageInfo_QueryRecordByBondIdResponse.Marshal(b, m, deterministic)
|
return xxx_messageInfo_QueryRecordByBondIDResponse.Marshal(b, m, deterministic)
|
||||||
} else {
|
} else {
|
||||||
b = b[:cap(b)]
|
b = b[:cap(b)]
|
||||||
n, err := m.MarshalToSizedBuffer(b)
|
n, err := m.MarshalToSizedBuffer(b)
|
||||||
@ -593,26 +593,26 @@ func (m *QueryRecordByBondIdResponse) XXX_Marshal(b []byte, deterministic bool)
|
|||||||
return b[:n], nil
|
return b[:n], nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func (m *QueryRecordByBondIdResponse) XXX_Merge(src proto.Message) {
|
func (m *QueryRecordByBondIDResponse) XXX_Merge(src proto.Message) {
|
||||||
xxx_messageInfo_QueryRecordByBondIdResponse.Merge(m, src)
|
xxx_messageInfo_QueryRecordByBondIDResponse.Merge(m, src)
|
||||||
}
|
}
|
||||||
func (m *QueryRecordByBondIdResponse) XXX_Size() int {
|
func (m *QueryRecordByBondIDResponse) XXX_Size() int {
|
||||||
return m.Size()
|
return m.Size()
|
||||||
}
|
}
|
||||||
func (m *QueryRecordByBondIdResponse) XXX_DiscardUnknown() {
|
func (m *QueryRecordByBondIDResponse) XXX_DiscardUnknown() {
|
||||||
xxx_messageInfo_QueryRecordByBondIdResponse.DiscardUnknown(m)
|
xxx_messageInfo_QueryRecordByBondIDResponse.DiscardUnknown(m)
|
||||||
}
|
}
|
||||||
|
|
||||||
var xxx_messageInfo_QueryRecordByBondIdResponse proto.InternalMessageInfo
|
var xxx_messageInfo_QueryRecordByBondIDResponse proto.InternalMessageInfo
|
||||||
|
|
||||||
func (m *QueryRecordByBondIdResponse) GetRecords() []Record {
|
func (m *QueryRecordByBondIDResponse) GetRecords() []Record {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
return m.Records
|
return m.Records
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *QueryRecordByBondIdResponse) GetPagination() *query.PageResponse {
|
func (m *QueryRecordByBondIDResponse) GetPagination() *query.PageResponse {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
return m.Pagination
|
return m.Pagination
|
||||||
}
|
}
|
||||||
@ -1385,10 +1385,10 @@ func init() {
|
|||||||
proto.RegisterType((*QueryListRecordsRequest_ValueInput)(nil), "vulcanize.nameservice.v1beta1.QueryListRecordsRequest.ValueInput")
|
proto.RegisterType((*QueryListRecordsRequest_ValueInput)(nil), "vulcanize.nameservice.v1beta1.QueryListRecordsRequest.ValueInput")
|
||||||
proto.RegisterType((*QueryListRecordsRequest_KeyValueInput)(nil), "vulcanize.nameservice.v1beta1.QueryListRecordsRequest.KeyValueInput")
|
proto.RegisterType((*QueryListRecordsRequest_KeyValueInput)(nil), "vulcanize.nameservice.v1beta1.QueryListRecordsRequest.KeyValueInput")
|
||||||
proto.RegisterType((*QueryListRecordsResponse)(nil), "vulcanize.nameservice.v1beta1.QueryListRecordsResponse")
|
proto.RegisterType((*QueryListRecordsResponse)(nil), "vulcanize.nameservice.v1beta1.QueryListRecordsResponse")
|
||||||
proto.RegisterType((*QueryRecordByIdRequest)(nil), "vulcanize.nameservice.v1beta1.QueryRecordByIdRequest")
|
proto.RegisterType((*QueryRecordByIDRequest)(nil), "vulcanize.nameservice.v1beta1.QueryRecordByIDRequest")
|
||||||
proto.RegisterType((*QueryRecordByIdResponse)(nil), "vulcanize.nameservice.v1beta1.QueryRecordByIdResponse")
|
proto.RegisterType((*QueryRecordByIDResponse)(nil), "vulcanize.nameservice.v1beta1.QueryRecordByIDResponse")
|
||||||
proto.RegisterType((*QueryRecordByBondIdRequest)(nil), "vulcanize.nameservice.v1beta1.QueryRecordByBondIdRequest")
|
proto.RegisterType((*QueryRecordByBondIDRequest)(nil), "vulcanize.nameservice.v1beta1.QueryRecordByBondIDRequest")
|
||||||
proto.RegisterType((*QueryRecordByBondIdResponse)(nil), "vulcanize.nameservice.v1beta1.QueryRecordByBondIdResponse")
|
proto.RegisterType((*QueryRecordByBondIDResponse)(nil), "vulcanize.nameservice.v1beta1.QueryRecordByBondIDResponse")
|
||||||
proto.RegisterType((*GetNameServiceModuleBalanceRequest)(nil), "vulcanize.nameservice.v1beta1.GetNameServiceModuleBalanceRequest")
|
proto.RegisterType((*GetNameServiceModuleBalanceRequest)(nil), "vulcanize.nameservice.v1beta1.GetNameServiceModuleBalanceRequest")
|
||||||
proto.RegisterType((*GetNameServiceModuleBalanceResponse)(nil), "vulcanize.nameservice.v1beta1.GetNameServiceModuleBalanceResponse")
|
proto.RegisterType((*GetNameServiceModuleBalanceResponse)(nil), "vulcanize.nameservice.v1beta1.GetNameServiceModuleBalanceResponse")
|
||||||
proto.RegisterType((*AccountBalance)(nil), "vulcanize.nameservice.v1beta1.AccountBalance")
|
proto.RegisterType((*AccountBalance)(nil), "vulcanize.nameservice.v1beta1.AccountBalance")
|
||||||
@ -1414,93 +1414,93 @@ func init() {
|
|||||||
var fileDescriptor_73d2465766c8f876 = []byte{
|
var fileDescriptor_73d2465766c8f876 = []byte{
|
||||||
// 1411 bytes of a gzipped FileDescriptorProto
|
// 1411 bytes of a gzipped FileDescriptorProto
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0x4b, 0x6c, 0x1b, 0xc5,
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0x4b, 0x6c, 0x1b, 0xc5,
|
||||||
0x1b, 0xcf, 0x24, 0xb1, 0xd3, 0x7c, 0xf9, 0x37, 0xfd, 0x77, 0x88, 0x5a, 0x77, 0xdb, 0x3a, 0x61,
|
0x1b, 0xcf, 0x24, 0xb1, 0xd3, 0x7c, 0xfe, 0x37, 0xfd, 0x77, 0x88, 0x5a, 0x77, 0xdb, 0x3a, 0x61,
|
||||||
0xfb, 0x72, 0xa0, 0xde, 0x6d, 0x52, 0xfa, 0x16, 0x88, 0x3a, 0x0d, 0x51, 0xa0, 0x20, 0xba, 0x20,
|
0xfb, 0x72, 0xa0, 0xde, 0xad, 0x53, 0xfa, 0x16, 0x88, 0x3a, 0x0d, 0x51, 0xa0, 0x20, 0xba, 0x20,
|
||||||
0x0a, 0x1c, 0xa8, 0xd6, 0xbb, 0x53, 0x77, 0xe9, 0x7a, 0xc6, 0xdd, 0x47, 0xa8, 0x5b, 0xf5, 0xc2,
|
0x0a, 0x1c, 0xa8, 0xd6, 0xeb, 0xa9, 0xbb, 0x74, 0x3d, 0xe3, 0xee, 0x23, 0xd4, 0xad, 0x7a, 0xe1,
|
||||||
0xa1, 0x67, 0x24, 0xce, 0x20, 0x90, 0x38, 0x55, 0x02, 0x2e, 0x1c, 0x2a, 0xae, 0x5c, 0x2a, 0x4e,
|
0xd0, 0x33, 0x12, 0x67, 0x10, 0x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0xc9, 0x79, 0x54, 0x46, 0x86, 0x78, 0xc0, 0x45, 0x98, 0xaa,
|
||||||
0x67, 0xcc, 0x25, 0x26, 0x2d, 0x15, 0x38, 0xc5, 0xf8, 0x11, 0x5b, 0x30, 0xe9, 0xc5, 0xf0, 0x4a,
|
0x33, 0xe6, 0x10, 0x93, 0x16, 0x73, 0x9c, 0x62, 0xf4, 0x88, 0x2d, 0x98, 0x76, 0x23, 0x78, 0xc5,
|
||||||
0x45, 0xce, 0x72, 0x79, 0xc8, 0xe8, 0x66, 0x69, 0x1a, 0x1d, 0xbb, 0xf8, 0x03, 0x28, 0xae, 0x45,
|
0x3c, 0x67, 0xb9, 0x3c, 0x62, 0x74, 0xd3, 0x34, 0x8d, 0xae, 0x5d, 0xfc, 0x01, 0xe4, 0xd7, 0x42,
|
||||||
0x04, 0xfd, 0xd2, 0x04, 0xcf, 0xdf, 0xf9, 0x21, 0x3d, 0xa4, 0x92, 0x27, 0x0d, 0x2a, 0xb7, 0x60,
|
0x82, 0x5e, 0x71, 0x8a, 0xe7, 0xef, 0xfc, 0x88, 0x1e, 0x12, 0xc9, 0x93, 0x06, 0x95, 0x5b, 0xb0,
|
||||||
0x7b, 0x26, 0xab, 0x51, 0x48, 0xae, 0x93, 0xb6, 0x8c, 0x5e, 0xb4, 0xc4, 0x97, 0xa1, 0xc0, 0x85,
|
0x3d, 0x95, 0xd5, 0x30, 0x24, 0xd7, 0x49, 0x47, 0x46, 0x2f, 0x5c, 0xe2, 0xcb, 0x90, 0xe3, 0xc2,
|
||||||
0x79, 0xec, 0xb6, 0xc4, 0xb9, 0xb0, 0xa7, 0xde, 0x43, 0x50, 0x5a, 0x2f, 0x2d, 0x5b, 0x62, 0x19,
|
0x3c, 0x76, 0x5b, 0xe2, 0x5c, 0xd8, 0x53, 0xef, 0x21, 0x28, 0xae, 0x97, 0x96, 0x2d, 0xb1, 0x0c,
|
||||||
0x26, 0x3c, 0xb1, 0x25, 0x8b, 0xb6, 0x5f, 0x4f, 0x08, 0x03, 0xb5, 0xf1, 0x07, 0x8f, 0x66, 0x47,
|
0x53, 0xae, 0xd8, 0x92, 0x45, 0x3b, 0xa8, 0x27, 0x84, 0x81, 0xda, 0xe4, 0x83, 0x47, 0x73, 0x63,
|
||||||
0x8c, 0x58, 0x17, 0xaf, 0x64, 0xca, 0x50, 0x30, 0x38, 0xd2, 0xb7, 0x0c, 0x05, 0x86, 0x74, 0x1d,
|
0x46, 0xa4, 0x8b, 0x57, 0x52, 0x65, 0x28, 0x18, 0x1c, 0x19, 0x58, 0x86, 0x02, 0x43, 0xb2, 0x0e,
|
||||||
0xaa, 0x15, 0xd8, 0xc5, 0xb1, 0x4a, 0x37, 0xed, 0x55, 0x3b, 0xee, 0xb0, 0xae, 0x7a, 0x54, 0x3f,
|
0xd5, 0x32, 0xec, 0xe2, 0x58, 0xa5, 0x9b, 0xce, 0xea, 0x85, 0xa8, 0xc3, 0x7a, 0xea, 0x51, 0xfd,
|
||||||
0x92, 0xcd, 0x98, 0x96, 0x94, 0xa4, 0x96, 0xa0, 0x28, 0x80, 0xe5, 0xec, 0xf3, 0x0c, 0x27, 0xa9,
|
0x48, 0x36, 0x63, 0x52, 0x52, 0x92, 0x5a, 0x82, 0xbc, 0x00, 0x96, 0xb1, 0xcf, 0x53, 0x9c, 0xa4,
|
||||||
0xaa, 0x06, 0xa0, 0x64, 0xec, 0xd7, 0x18, 0xb5, 0x37, 0x44, 0xd3, 0xd5, 0x87, 0xa3, 0xc3, 0xf6,
|
0xaa, 0xea, 0x83, 0x92, 0xb2, 0x5f, 0x63, 0xb4, 0xb1, 0x21, 0x9a, 0x9e, 0x3e, 0x1c, 0x1f, 0xb5,
|
||||||
0xa1, 0xfa, 0x2d, 0x82, 0xbd, 0x3d, 0xdd, 0xfe, 0x47, 0xf3, 0x75, 0x10, 0xd4, 0x15, 0x12, 0xbc,
|
0x0f, 0xd5, 0x6f, 0x11, 0xec, 0xed, 0xeb, 0xf6, 0x3f, 0x9a, 0xaf, 0x83, 0xa0, 0xae, 0x10, 0xff,
|
||||||
0x65, 0x36, 0xc9, 0x3b, 0xc2, 0xf1, 0x9b, 0xcc, 0x0e, 0x5d, 0x52, 0x33, 0x5d, 0x93, 0x5a, 0x31,
|
0x2d, 0xb3, 0x45, 0xde, 0x11, 0x8e, 0xdf, 0x64, 0x8d, 0xc0, 0x21, 0x35, 0xd3, 0x31, 0xa9, 0x15,
|
||||||
0x43, 0xb5, 0x05, 0x07, 0x36, 0x95, 0x92, 0xe4, 0x56, 0x61, 0x5b, 0x5d, 0x6c, 0xc5, 0xec, 0xaa,
|
0x31, 0x54, 0xdb, 0x70, 0x60, 0x53, 0x29, 0x49, 0x6e, 0x15, 0xb6, 0xd5, 0xc5, 0x56, 0xc4, 0xae,
|
||||||
0x7d, 0xd8, 0x9d, 0xb7, 0x2c, 0x16, 0xd2, 0x20, 0x36, 0x94, 0xa8, 0xab, 0x7f, 0x21, 0x98, 0xce,
|
0x32, 0x80, 0xdd, 0x79, 0xcb, 0x62, 0x01, 0xf5, 0x23, 0x43, 0xb1, 0xba, 0xfa, 0x17, 0x82, 0x99,
|
||||||
0xbe, 0xc4, 0x17, 0xe1, 0x7f, 0xa6, 0xd8, 0xb9, 0x12, 0x99, 0x12, 0xc9, 0xab, 0xcd, 0x3f, 0x7d,
|
0xf4, 0x4b, 0x7c, 0x11, 0xfe, 0x67, 0x8a, 0x9d, 0x2b, 0xa1, 0x29, 0x91, 0xbc, 0xda, 0xc2, 0xd3,
|
||||||
0x34, 0x7b, 0xe8, 0x63, 0x9f, 0xd1, 0xb3, 0xaa, 0x7c, 0x1b, 0xc1, 0x54, 0xe7, 0xda, 0x66, 0xd3,
|
0x47, 0x73, 0x87, 0x3e, 0xf6, 0x18, 0x3d, 0xab, 0xca, 0xb7, 0x21, 0x4c, 0x75, 0xbe, 0x63, 0xb6,
|
||||||
0xcd, 0x6e, 0x19, 0x53, 0xa9, 0x27, 0x7c, 0x17, 0xc1, 0x84, 0xf4, 0x56, 0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xe8, 0x25, 0x66, 0xf2, 0x7a,
|
||||||
0x7d, 0xf0, 0x1e, 0xeb, 0x43, 0x25, 0x63, 0x84, 0xb3, 0xda, 0xfa, 0xd3, 0xf7, 0x0c, 0xec, 0x5c,
|
0xef, 0xc1, 0x7b, 0x6c, 0x00, 0x95, 0x94, 0x11, 0xce, 0x6a, 0xeb, 0x4f, 0xdf, 0x33, 0xb0, 0x73,
|
||||||
0xe7, 0x66, 0xdd, 0xa7, 0x69, 0xa6, 0x33, 0x58, 0x8c, 0x55, 0x26, 0xe3, 0xa9, 0xe0, 0xaa, 0x6c,
|
0x9d, 0x9b, 0x75, 0x9f, 0xa6, 0xd9, 0xee, 0x60, 0x31, 0x51, 0x9e, 0x8e, 0xa6, 0x82, 0xab, 0xb2,
|
||||||
0xe7, 0x15, 0x12, 0x24, 0xb5, 0xf6, 0x6f, 0x44, 0xf7, 0x27, 0x04, 0x07, 0x37, 0x73, 0x94, 0x04,
|
0x9d, 0x57, 0x88, 0x1f, 0xd7, 0xda, 0xbf, 0x11, 0xdd, 0x9f, 0x10, 0x1c, 0xdc, 0xcc, 0x51, 0x1c,
|
||||||
0xd8, 0x80, 0xa9, 0xb8, 0xd5, 0x1c, 0x32, 0x7c, 0x90, 0xd3, 0x46, 0xb6, 0x2c, 0xd0, 0x8b, 0x7f,
|
0x60, 0x03, 0x0a, 0x51, 0xab, 0xd9, 0x64, 0xf4, 0x20, 0x27, 0x8d, 0x6c, 0x59, 0xa0, 0x17, 0xff,
|
||||||
0xef, 0x80, 0x02, 0x67, 0x81, 0xbf, 0x44, 0x50, 0x14, 0xf7, 0x02, 0xbc, 0x90, 0x67, 0x44, 0xcb,
|
0xde, 0x01, 0x39, 0xce, 0x02, 0x7f, 0x89, 0x20, 0x2f, 0xee, 0x05, 0xb8, 0x9a, 0x65, 0x44, 0x4b,
|
||||||
0x5c, 0x4c, 0x94, 0xc5, 0x41, 0x54, 0x04, 0x0e, 0xb5, 0xfa, 0xe9, 0x2f, 0x7f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 0xb2,
|
0x9e, 0xff, 0x6b, 0x79, 0xfc, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xeb, 0xee, 0x3b, 0x4b, 0xb2,
|
||||||
0x15, 0x00, 0x00,
|
0x15, 0x00, 0x00,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1521,9 +1521,9 @@ type QueryClient interface {
|
|||||||
// List records
|
// List records
|
||||||
ListRecords(ctx context.Context, in *QueryListRecordsRequest, opts ...grpc.CallOption) (*QueryListRecordsResponse, error)
|
ListRecords(ctx context.Context, in *QueryListRecordsRequest, opts ...grpc.CallOption) (*QueryListRecordsResponse, error)
|
||||||
// Get record by id
|
// Get record by id
|
||||||
GetRecord(ctx context.Context, in *QueryRecordByIdRequest, opts ...grpc.CallOption) (*QueryRecordByIdResponse, error)
|
GetRecord(ctx context.Context, in *QueryRecordByIDRequest, opts ...grpc.CallOption) (*QueryRecordByIDResponse, error)
|
||||||
// Get records by bond id
|
// Get records by bond id
|
||||||
GetRecordByBondId(ctx context.Context, in *QueryRecordByBondIdRequest, opts ...grpc.CallOption) (*QueryRecordByBondIdResponse, error)
|
GetRecordByBondID(ctx context.Context, in *QueryRecordByBondIDRequest, opts ...grpc.CallOption) (*QueryRecordByBondIDResponse, error)
|
||||||
// Get nameservice module balance
|
// Get nameservice module balance
|
||||||
GetNameServiceModuleBalance(ctx context.Context, in *GetNameServiceModuleBalanceRequest, opts ...grpc.CallOption) (*GetNameServiceModuleBalanceResponse, error)
|
GetNameServiceModuleBalance(ctx context.Context, in *GetNameServiceModuleBalanceRequest, opts ...grpc.CallOption) (*GetNameServiceModuleBalanceResponse, error)
|
||||||
// List name records
|
// List name records
|
||||||
@ -1566,8 +1566,8 @@ func (c *queryClient) ListRecords(ctx context.Context, in *QueryListRecordsReque
|
|||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *queryClient) GetRecord(ctx context.Context, in *QueryRecordByIdRequest, opts ...grpc.CallOption) (*QueryRecordByIdResponse, error) {
|
func (c *queryClient) GetRecord(ctx context.Context, in *QueryRecordByIDRequest, opts ...grpc.CallOption) (*QueryRecordByIDResponse, error) {
|
||||||
out := new(QueryRecordByIdResponse)
|
out := new(QueryRecordByIDResponse)
|
||||||
err := c.cc.Invoke(ctx, "/vulcanize.nameservice.v1beta1.Query/GetRecord", in, out, opts...)
|
err := c.cc.Invoke(ctx, "/vulcanize.nameservice.v1beta1.Query/GetRecord", in, out, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -1575,9 +1575,9 @@ func (c *queryClient) GetRecord(ctx context.Context, in *QueryRecordByIdRequest,
|
|||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *queryClient) GetRecordByBondId(ctx context.Context, in *QueryRecordByBondIdRequest, opts ...grpc.CallOption) (*QueryRecordByBondIdResponse, error) {
|
func (c *queryClient) GetRecordByBondID(ctx context.Context, in *QueryRecordByBondIDRequest, opts ...grpc.CallOption) (*QueryRecordByBondIDResponse, error) {
|
||||||
out := new(QueryRecordByBondIdResponse)
|
out := new(QueryRecordByBondIDResponse)
|
||||||
err := c.cc.Invoke(ctx, "/vulcanize.nameservice.v1beta1.Query/GetRecordByBondId", in, out, opts...)
|
err := c.cc.Invoke(ctx, "/vulcanize.nameservice.v1beta1.Query/GetRecordByBondID", in, out, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -1654,9 +1654,9 @@ type QueryServer interface {
|
|||||||
// List records
|
// List records
|
||||||
ListRecords(context.Context, *QueryListRecordsRequest) (*QueryListRecordsResponse, error)
|
ListRecords(context.Context, *QueryListRecordsRequest) (*QueryListRecordsResponse, error)
|
||||||
// Get record by id
|
// Get record by id
|
||||||
GetRecord(context.Context, *QueryRecordByIdRequest) (*QueryRecordByIdResponse, error)
|
GetRecord(context.Context, *QueryRecordByIDRequest) (*QueryRecordByIDResponse, error)
|
||||||
// Get records by bond id
|
// Get records by bond id
|
||||||
GetRecordByBondId(context.Context, *QueryRecordByBondIdRequest) (*QueryRecordByBondIdResponse, error)
|
GetRecordByBondID(context.Context, *QueryRecordByBondIDRequest) (*QueryRecordByBondIDResponse, error)
|
||||||
// Get nameservice module balance
|
// Get nameservice module balance
|
||||||
GetNameServiceModuleBalance(context.Context, *GetNameServiceModuleBalanceRequest) (*GetNameServiceModuleBalanceResponse, error)
|
GetNameServiceModuleBalance(context.Context, *GetNameServiceModuleBalanceRequest) (*GetNameServiceModuleBalanceResponse, error)
|
||||||
// List name records
|
// List name records
|
||||||
@ -1683,11 +1683,11 @@ func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsReq
|
|||||||
func (*UnimplementedQueryServer) ListRecords(ctx context.Context, req *QueryListRecordsRequest) (*QueryListRecordsResponse, error) {
|
func (*UnimplementedQueryServer) ListRecords(ctx context.Context, req *QueryListRecordsRequest) (*QueryListRecordsResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method ListRecords not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method ListRecords not implemented")
|
||||||
}
|
}
|
||||||
func (*UnimplementedQueryServer) GetRecord(ctx context.Context, req *QueryRecordByIdRequest) (*QueryRecordByIdResponse, error) {
|
func (*UnimplementedQueryServer) GetRecord(ctx context.Context, req *QueryRecordByIDRequest) (*QueryRecordByIDResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method GetRecord not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method GetRecord not implemented")
|
||||||
}
|
}
|
||||||
func (*UnimplementedQueryServer) GetRecordByBondId(ctx context.Context, req *QueryRecordByBondIdRequest) (*QueryRecordByBondIdResponse, error) {
|
func (*UnimplementedQueryServer) GetRecordByBondID(ctx context.Context, req *QueryRecordByBondIDRequest) (*QueryRecordByBondIDResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method GetRecordByBondId not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method GetRecordByBondID not implemented")
|
||||||
}
|
}
|
||||||
func (*UnimplementedQueryServer) GetNameServiceModuleBalance(ctx context.Context, req *GetNameServiceModuleBalanceRequest) (*GetNameServiceModuleBalanceResponse, error) {
|
func (*UnimplementedQueryServer) GetNameServiceModuleBalance(ctx context.Context, req *GetNameServiceModuleBalanceRequest) (*GetNameServiceModuleBalanceResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method GetNameServiceModuleBalance not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method GetNameServiceModuleBalance not implemented")
|
||||||
@ -1752,7 +1752,7 @@ func _Query_ListRecords_Handler(srv interface{}, ctx context.Context, dec func(i
|
|||||||
}
|
}
|
||||||
|
|
||||||
func _Query_GetRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
func _Query_GetRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(QueryRecordByIdRequest)
|
in := new(QueryRecordByIDRequest)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -1764,25 +1764,25 @@ func _Query_GetRecord_Handler(srv interface{}, ctx context.Context, dec func(int
|
|||||||
FullMethod: "/vulcanize.nameservice.v1beta1.Query/GetRecord",
|
FullMethod: "/vulcanize.nameservice.v1beta1.Query/GetRecord",
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(QueryServer).GetRecord(ctx, req.(*QueryRecordByIdRequest))
|
return srv.(QueryServer).GetRecord(ctx, req.(*QueryRecordByIDRequest))
|
||||||
}
|
}
|
||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
func _Query_GetRecordByBondId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
func _Query_GetRecordByBondID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(QueryRecordByBondIdRequest)
|
in := new(QueryRecordByBondIDRequest)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if interceptor == nil {
|
if interceptor == nil {
|
||||||
return srv.(QueryServer).GetRecordByBondId(ctx, in)
|
return srv.(QueryServer).GetRecordByBondID(ctx, in)
|
||||||
}
|
}
|
||||||
info := &grpc.UnaryServerInfo{
|
info := &grpc.UnaryServerInfo{
|
||||||
Server: srv,
|
Server: srv,
|
||||||
FullMethod: "/vulcanize.nameservice.v1beta1.Query/GetRecordByBondId",
|
FullMethod: "/vulcanize.nameservice.v1beta1.Query/GetRecordByBondID",
|
||||||
}
|
}
|
||||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
return srv.(QueryServer).GetRecordByBondId(ctx, req.(*QueryRecordByBondIdRequest))
|
return srv.(QueryServer).GetRecordByBondID(ctx, req.(*QueryRecordByBondIDRequest))
|
||||||
}
|
}
|
||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
@ -1930,8 +1930,8 @@ var _Query_serviceDesc = grpc.ServiceDesc{
|
|||||||
Handler: _Query_GetRecord_Handler,
|
Handler: _Query_GetRecord_Handler,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
MethodName: "GetRecordByBondId",
|
MethodName: "GetRecordByBondID",
|
||||||
Handler: _Query_GetRecordByBondId_Handler,
|
Handler: _Query_GetRecordByBondID_Handler,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
MethodName: "GetNameServiceModuleBalance",
|
MethodName: "GetNameServiceModuleBalance",
|
||||||
@ -2288,7 +2288,7 @@ func (m *QueryListRecordsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error
|
|||||||
return len(dAtA) - i, nil
|
return len(dAtA) - i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *QueryRecordByIdRequest) Marshal() (dAtA []byte, err error) {
|
func (m *QueryRecordByIDRequest) Marshal() (dAtA []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
@ -2298,12 +2298,12 @@ func (m *QueryRecordByIdRequest) Marshal() (dAtA []byte, err error) {
|
|||||||
return dAtA[:n], nil
|
return dAtA[:n], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *QueryRecordByIdRequest) MarshalTo(dAtA []byte) (int, error) {
|
func (m *QueryRecordByIDRequest) MarshalTo(dAtA []byte) (int, error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *QueryRecordByIdRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
func (m *QueryRecordByIDRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
i := len(dAtA)
|
i := len(dAtA)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
@ -2318,7 +2318,7 @@ func (m *QueryRecordByIdRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
|
|||||||
return len(dAtA) - i, nil
|
return len(dAtA) - i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *QueryRecordByIdResponse) Marshal() (dAtA []byte, err error) {
|
func (m *QueryRecordByIDResponse) Marshal() (dAtA []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
@ -2328,12 +2328,12 @@ func (m *QueryRecordByIdResponse) Marshal() (dAtA []byte, err error) {
|
|||||||
return dAtA[:n], nil
|
return dAtA[:n], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *QueryRecordByIdResponse) MarshalTo(dAtA []byte) (int, error) {
|
func (m *QueryRecordByIDResponse) MarshalTo(dAtA []byte) (int, error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *QueryRecordByIdResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
func (m *QueryRecordByIDResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
i := len(dAtA)
|
i := len(dAtA)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
@ -2351,7 +2351,7 @@ func (m *QueryRecordByIdResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
|
|||||||
return len(dAtA) - i, nil
|
return len(dAtA) - i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *QueryRecordByBondIdRequest) Marshal() (dAtA []byte, err error) {
|
func (m *QueryRecordByBondIDRequest) Marshal() (dAtA []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
@ -2361,12 +2361,12 @@ func (m *QueryRecordByBondIdRequest) Marshal() (dAtA []byte, err error) {
|
|||||||
return dAtA[:n], nil
|
return dAtA[:n], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *QueryRecordByBondIdRequest) MarshalTo(dAtA []byte) (int, error) {
|
func (m *QueryRecordByBondIDRequest) MarshalTo(dAtA []byte) (int, error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *QueryRecordByBondIdRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
func (m *QueryRecordByBondIDRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
i := len(dAtA)
|
i := len(dAtA)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
@ -2393,7 +2393,7 @@ func (m *QueryRecordByBondIdRequest) MarshalToSizedBuffer(dAtA []byte) (int, err
|
|||||||
return len(dAtA) - i, nil
|
return len(dAtA) - i, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *QueryRecordByBondIdResponse) Marshal() (dAtA []byte, err error) {
|
func (m *QueryRecordByBondIDResponse) Marshal() (dAtA []byte, err error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
dAtA = make([]byte, size)
|
dAtA = make([]byte, size)
|
||||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
@ -2403,12 +2403,12 @@ func (m *QueryRecordByBondIdResponse) Marshal() (dAtA []byte, err error) {
|
|||||||
return dAtA[:n], nil
|
return dAtA[:n], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *QueryRecordByBondIdResponse) MarshalTo(dAtA []byte) (int, error) {
|
func (m *QueryRecordByBondIDResponse) MarshalTo(dAtA []byte) (int, error) {
|
||||||
size := m.Size()
|
size := m.Size()
|
||||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *QueryRecordByBondIdResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
func (m *QueryRecordByBondIDResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||||
i := len(dAtA)
|
i := len(dAtA)
|
||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
@ -3170,7 +3170,7 @@ func (m *QueryListRecordsResponse) Size() (n int) {
|
|||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *QueryRecordByIdRequest) Size() (n int) {
|
func (m *QueryRecordByIDRequest) Size() (n int) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -3183,7 +3183,7 @@ func (m *QueryRecordByIdRequest) Size() (n int) {
|
|||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *QueryRecordByIdResponse) Size() (n int) {
|
func (m *QueryRecordByIDResponse) Size() (n int) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -3194,7 +3194,7 @@ func (m *QueryRecordByIdResponse) Size() (n int) {
|
|||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *QueryRecordByBondIdRequest) Size() (n int) {
|
func (m *QueryRecordByBondIDRequest) Size() (n int) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -3211,7 +3211,7 @@ func (m *QueryRecordByBondIdRequest) Size() (n int) {
|
|||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *QueryRecordByBondIdResponse) Size() (n int) {
|
func (m *QueryRecordByBondIDResponse) Size() (n int) {
|
||||||
if m == nil {
|
if m == nil {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -4300,7 +4300,7 @@ func (m *QueryListRecordsResponse) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (m *QueryRecordByIdRequest) Unmarshal(dAtA []byte) error {
|
func (m *QueryRecordByIDRequest) Unmarshal(dAtA []byte) error {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
for iNdEx < l {
|
for iNdEx < l {
|
||||||
@ -4323,10 +4323,10 @@ func (m *QueryRecordByIdRequest) Unmarshal(dAtA []byte) error {
|
|||||||
fieldNum := int32(wire >> 3)
|
fieldNum := int32(wire >> 3)
|
||||||
wireType := int(wire & 0x7)
|
wireType := int(wire & 0x7)
|
||||||
if wireType == 4 {
|
if wireType == 4 {
|
||||||
return fmt.Errorf("proto: QueryRecordByIdRequest: wiretype end group for non-group")
|
return fmt.Errorf("proto: QueryRecordByIDRequest: wiretype end group for non-group")
|
||||||
}
|
}
|
||||||
if fieldNum <= 0 {
|
if fieldNum <= 0 {
|
||||||
return fmt.Errorf("proto: QueryRecordByIdRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
return fmt.Errorf("proto: QueryRecordByIDRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
}
|
}
|
||||||
switch fieldNum {
|
switch fieldNum {
|
||||||
case 1:
|
case 1:
|
||||||
@ -4382,7 +4382,7 @@ func (m *QueryRecordByIdRequest) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (m *QueryRecordByIdResponse) Unmarshal(dAtA []byte) error {
|
func (m *QueryRecordByIDResponse) Unmarshal(dAtA []byte) error {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
for iNdEx < l {
|
for iNdEx < l {
|
||||||
@ -4405,10 +4405,10 @@ func (m *QueryRecordByIdResponse) Unmarshal(dAtA []byte) error {
|
|||||||
fieldNum := int32(wire >> 3)
|
fieldNum := int32(wire >> 3)
|
||||||
wireType := int(wire & 0x7)
|
wireType := int(wire & 0x7)
|
||||||
if wireType == 4 {
|
if wireType == 4 {
|
||||||
return fmt.Errorf("proto: QueryRecordByIdResponse: wiretype end group for non-group")
|
return fmt.Errorf("proto: QueryRecordByIDResponse: wiretype end group for non-group")
|
||||||
}
|
}
|
||||||
if fieldNum <= 0 {
|
if fieldNum <= 0 {
|
||||||
return fmt.Errorf("proto: QueryRecordByIdResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
return fmt.Errorf("proto: QueryRecordByIDResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
}
|
}
|
||||||
switch fieldNum {
|
switch fieldNum {
|
||||||
case 1:
|
case 1:
|
||||||
@ -4465,7 +4465,7 @@ func (m *QueryRecordByIdResponse) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (m *QueryRecordByBondIdRequest) Unmarshal(dAtA []byte) error {
|
func (m *QueryRecordByBondIDRequest) Unmarshal(dAtA []byte) error {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
for iNdEx < l {
|
for iNdEx < l {
|
||||||
@ -4488,10 +4488,10 @@ func (m *QueryRecordByBondIdRequest) Unmarshal(dAtA []byte) error {
|
|||||||
fieldNum := int32(wire >> 3)
|
fieldNum := int32(wire >> 3)
|
||||||
wireType := int(wire & 0x7)
|
wireType := int(wire & 0x7)
|
||||||
if wireType == 4 {
|
if wireType == 4 {
|
||||||
return fmt.Errorf("proto: QueryRecordByBondIdRequest: wiretype end group for non-group")
|
return fmt.Errorf("proto: QueryRecordByBondIDRequest: wiretype end group for non-group")
|
||||||
}
|
}
|
||||||
if fieldNum <= 0 {
|
if fieldNum <= 0 {
|
||||||
return fmt.Errorf("proto: QueryRecordByBondIdRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
return fmt.Errorf("proto: QueryRecordByBondIDRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
}
|
}
|
||||||
switch fieldNum {
|
switch fieldNum {
|
||||||
case 1:
|
case 1:
|
||||||
@ -4583,7 +4583,7 @@ func (m *QueryRecordByBondIdRequest) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (m *QueryRecordByBondIdResponse) Unmarshal(dAtA []byte) error {
|
func (m *QueryRecordByBondIDResponse) Unmarshal(dAtA []byte) error {
|
||||||
l := len(dAtA)
|
l := len(dAtA)
|
||||||
iNdEx := 0
|
iNdEx := 0
|
||||||
for iNdEx < l {
|
for iNdEx < l {
|
||||||
@ -4606,10 +4606,10 @@ func (m *QueryRecordByBondIdResponse) Unmarshal(dAtA []byte) error {
|
|||||||
fieldNum := int32(wire >> 3)
|
fieldNum := int32(wire >> 3)
|
||||||
wireType := int(wire & 0x7)
|
wireType := int(wire & 0x7)
|
||||||
if wireType == 4 {
|
if wireType == 4 {
|
||||||
return fmt.Errorf("proto: QueryRecordByBondIdResponse: wiretype end group for non-group")
|
return fmt.Errorf("proto: QueryRecordByBondIDResponse: wiretype end group for non-group")
|
||||||
}
|
}
|
||||||
if fieldNum <= 0 {
|
if fieldNum <= 0 {
|
||||||
return fmt.Errorf("proto: QueryRecordByBondIdResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
return fmt.Errorf("proto: QueryRecordByBondIDResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||||
}
|
}
|
||||||
switch fieldNum {
|
switch fieldNum {
|
||||||
case 1:
|
case 1:
|
||||||
|
38
x/nameservice/types/query.pb.gw.go
generated
38
x/nameservice/types/query.pb.gw.go
generated
@ -86,7 +86,7 @@ func local_request_Query_ListRecords_0(ctx context.Context, marshaler runtime.Ma
|
|||||||
}
|
}
|
||||||
|
|
||||||
func request_Query_GetRecord_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
func request_Query_GetRecord_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
var protoReq QueryRecordByIdRequest
|
var protoReq QueryRecordByIDRequest
|
||||||
var metadata runtime.ServerMetadata
|
var metadata runtime.ServerMetadata
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -113,7 +113,7 @@ func request_Query_GetRecord_0(ctx context.Context, marshaler runtime.Marshaler,
|
|||||||
}
|
}
|
||||||
|
|
||||||
func local_request_Query_GetRecord_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
func local_request_Query_GetRecord_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
var protoReq QueryRecordByIdRequest
|
var protoReq QueryRecordByIDRequest
|
||||||
var metadata runtime.ServerMetadata
|
var metadata runtime.ServerMetadata
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -140,11 +140,11 @@ func local_request_Query_GetRecord_0(ctx context.Context, marshaler runtime.Mars
|
|||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
filter_Query_GetRecordByBondId_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
|
filter_Query_GetRecordByBondID_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
|
||||||
)
|
)
|
||||||
|
|
||||||
func request_Query_GetRecordByBondId_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
func request_Query_GetRecordByBondID_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
var protoReq QueryRecordByBondIdRequest
|
var protoReq QueryRecordByBondIDRequest
|
||||||
var metadata runtime.ServerMetadata
|
var metadata runtime.ServerMetadata
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -168,17 +168,17 @@ func request_Query_GetRecordByBondId_0(ctx context.Context, marshaler runtime.Ma
|
|||||||
if err := req.ParseForm(); err != nil {
|
if err := req.ParseForm(); err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
}
|
}
|
||||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_GetRecordByBondId_0); err != nil {
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_GetRecordByBondID_0); err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
msg, err := client.GetRecordByBondId(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
msg, err := client.GetRecordByBondID(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func local_request_Query_GetRecordByBondId_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
func local_request_Query_GetRecordByBondID_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
var protoReq QueryRecordByBondIdRequest
|
var protoReq QueryRecordByBondIDRequest
|
||||||
var metadata runtime.ServerMetadata
|
var metadata runtime.ServerMetadata
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -202,11 +202,11 @@ func local_request_Query_GetRecordByBondId_0(ctx context.Context, marshaler runt
|
|||||||
if err := req.ParseForm(); err != nil {
|
if err := req.ParseForm(); err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
}
|
}
|
||||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_GetRecordByBondId_0); err != nil {
|
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_GetRecordByBondID_0); err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
msg, err := server.GetRecordByBondId(ctx, &protoReq)
|
msg, err := server.GetRecordByBondID(ctx, &protoReq)
|
||||||
return msg, metadata, err
|
return msg, metadata, err
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -529,7 +529,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
mux.Handle("GET", pattern_Query_GetRecordByBondId_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
mux.Handle("GET", pattern_Query_GetRecordByBondID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
ctx, cancel := context.WithCancel(req.Context())
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
@ -538,14 +538,14 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
|
|||||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
resp, md, err := local_request_Query_GetRecordByBondId_0(rctx, inboundMarshaler, server, req, pathParams)
|
resp, md, err := local_request_Query_GetRecordByBondID_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
forward_Query_GetRecordByBondId_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
forward_Query_GetRecordByBondID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -790,7 +790,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
mux.Handle("GET", pattern_Query_GetRecordByBondId_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
mux.Handle("GET", pattern_Query_GetRecordByBondID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||||
ctx, cancel := context.WithCancel(req.Context())
|
ctx, cancel := context.WithCancel(req.Context())
|
||||||
defer cancel()
|
defer cancel()
|
||||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||||
@ -799,14 +799,14 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
|
|||||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
resp, md, err := request_Query_GetRecordByBondId_0(rctx, inboundMarshaler, client, req, pathParams)
|
resp, md, err := request_Query_GetRecordByBondID_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
forward_Query_GetRecordByBondId_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
forward_Query_GetRecordByBondID_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -960,7 +960,7 @@ var (
|
|||||||
|
|
||||||
pattern_Query_GetRecord_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"vulcanize", "nameservice", "v1beta1", "records", "id"}, "", runtime.AssumeColonVerbOpt(true)))
|
pattern_Query_GetRecord_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"vulcanize", "nameservice", "v1beta1", "records", "id"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||||
|
|
||||||
pattern_Query_GetRecordByBondId_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"vulcanize", "nameservice", "v1beta1", "records-by-bond-id", "id"}, "", runtime.AssumeColonVerbOpt(true)))
|
pattern_Query_GetRecordByBondID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"vulcanize", "nameservice", "v1beta1", "records-by-bond-id", "id"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||||
|
|
||||||
pattern_Query_GetNameServiceModuleBalance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"vulcanize", "nameservice", "v1beta1", "balance"}, "", runtime.AssumeColonVerbOpt(true)))
|
pattern_Query_GetNameServiceModuleBalance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"vulcanize", "nameservice", "v1beta1", "balance"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||||
|
|
||||||
@ -984,7 +984,7 @@ var (
|
|||||||
|
|
||||||
forward_Query_GetRecord_0 = runtime.ForwardResponseMessage
|
forward_Query_GetRecord_0 = runtime.ForwardResponseMessage
|
||||||
|
|
||||||
forward_Query_GetRecordByBondId_0 = runtime.ForwardResponseMessage
|
forward_Query_GetRecordByBondID_0 = runtime.ForwardResponseMessage
|
||||||
|
|
||||||
forward_Query_GetNameServiceModuleBalance_0 = runtime.ForwardResponseMessage
|
forward_Query_GetNameServiceModuleBalance_0 = runtime.ForwardResponseMessage
|
||||||
|
|
||||||
|
@ -58,9 +58,9 @@ func (msg MsgSetRecord) GetSignBytes() []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewMsgRenewRecord is the constructor function for MsgRenewRecord.
|
// NewMsgRenewRecord is the constructor function for MsgRenewRecord.
|
||||||
func NewMsgRenewRecord(recordId string, signer sdk.AccAddress) MsgRenewRecord {
|
func NewMsgRenewRecord(recordID string, signer sdk.AccAddress) MsgRenewRecord {
|
||||||
return MsgRenewRecord{
|
return MsgRenewRecord{
|
||||||
RecordId: recordId,
|
RecordId: recordID,
|
||||||
Signer: signer.String(),
|
Signer: signer.String(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -97,10 +97,10 @@ func (msg MsgRenewRecord) GetSigners() []sdk.AccAddress {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewMsgAssociateBond is the constructor function for MsgAssociateBond.
|
// NewMsgAssociateBond is the constructor function for MsgAssociateBond.
|
||||||
func NewMsgAssociateBond(recordId, bondId string, signer sdk.AccAddress) MsgAssociateBond {
|
func NewMsgAssociateBond(recordID, bondID string, signer sdk.AccAddress) MsgAssociateBond {
|
||||||
return MsgAssociateBond{
|
return MsgAssociateBond{
|
||||||
BondId: bondId,
|
BondId: bondID,
|
||||||
RecordId: recordId,
|
RecordId: recordID,
|
||||||
Signer: signer.String(),
|
Signer: signer.String(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -139,9 +139,9 @@ func (msg MsgAssociateBond) GetSigners() []sdk.AccAddress {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewMsgDissociateBond is the constructor function for MsgDissociateBond.
|
// NewMsgDissociateBond is the constructor function for MsgDissociateBond.
|
||||||
func NewMsgDissociateBond(recordId string, signer sdk.AccAddress) MsgDissociateBond {
|
func NewMsgDissociateBond(recordID string, signer sdk.AccAddress) MsgDissociateBond {
|
||||||
return MsgDissociateBond{
|
return MsgDissociateBond{
|
||||||
RecordId: recordId,
|
RecordId: recordID,
|
||||||
Signer: signer.String(),
|
Signer: signer.String(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -177,9 +177,9 @@ func (msg MsgDissociateBond) GetSigners() []sdk.AccAddress {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewMsgDissociateRecords is the constructor function for MsgDissociateRecords.
|
// NewMsgDissociateRecords is the constructor function for MsgDissociateRecords.
|
||||||
func NewMsgDissociateRecords(bondId string, signer sdk.AccAddress) MsgDissociateRecords {
|
func NewMsgDissociateRecords(bondID string, signer sdk.AccAddress) MsgDissociateRecords {
|
||||||
return MsgDissociateRecords{
|
return MsgDissociateRecords{
|
||||||
BondId: bondId,
|
BondId: bondID,
|
||||||
Signer: signer.String(),
|
Signer: signer.String(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -215,10 +215,10 @@ func (msg MsgDissociateRecords) GetSigners() []sdk.AccAddress {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewMsgReAssociateRecords is the constructor function for MsgReAssociateRecords.
|
// NewMsgReAssociateRecords is the constructor function for MsgReAssociateRecords.
|
||||||
func NewMsgReAssociateRecords(oldBondId, newBondId string, signer sdk.AccAddress) MsgReAssociateRecords {
|
func NewMsgReAssociateRecords(oldBondID, newBondID string, signer sdk.AccAddress) MsgReAssociateRecords {
|
||||||
return MsgReAssociateRecords{
|
return MsgReAssociateRecords{
|
||||||
OldBondId: oldBondId,
|
OldBondId: oldBondID,
|
||||||
NewBondId: newBondId,
|
NewBondId: newBondID,
|
||||||
Signer: signer.String(),
|
Signer: signer.String(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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,
|
||||||
@ -50,8 +50,8 @@ func (payload Payload) ToReadablePayload() PayloadType {
|
|||||||
func (r *Record) ToRecordType() RecordType {
|
func (r *Record) ToRecordType() RecordType {
|
||||||
var resourceObj RecordType
|
var resourceObj RecordType
|
||||||
|
|
||||||
resourceObj.Id = r.Id
|
resourceObj.ID = r.Id
|
||||||
resourceObj.BondId = r.BondId
|
resourceObj.BondID = r.BondId
|
||||||
resourceObj.CreateTime = r.CreateTime
|
resourceObj.CreateTime = r.CreateTime
|
||||||
resourceObj.ExpiryTime = r.ExpiryTime
|
resourceObj.ExpiryTime = r.ExpiryTime
|
||||||
resourceObj.Deleted = r.Deleted
|
resourceObj.Deleted = r.Deleted
|
||||||
@ -64,9 +64,9 @@ func (r *Record) ToRecordType() RecordType {
|
|||||||
|
|
||||||
// RecordType represents a WNS record.
|
// RecordType represents a WNS record.
|
||||||
type RecordType struct {
|
type RecordType struct {
|
||||||
Id string `json:"id,omitempty"`
|
ID string `json:"id,omitempty"`
|
||||||
Names []string `json:"names,omitempty"`
|
Names []string `json:"names,omitempty"`
|
||||||
BondId string `json:"bondId,omitempty"`
|
BondID string `json:"bondId,omitempty"`
|
||||||
CreateTime string `json:"createTime,omitempty"`
|
CreateTime string `json:"createTime,omitempty"`
|
||||||
ExpiryTime string `json:"expiryTime,omitempty"`
|
ExpiryTime string `json:"expiryTime,omitempty"`
|
||||||
Deleted bool `json:"deleted,omitempty"`
|
Deleted bool `json:"deleted,omitempty"`
|
||||||
@ -79,8 +79,8 @@ type RecordType struct {
|
|||||||
func (r *RecordType) ToRecordObj() Record {
|
func (r *RecordType) ToRecordObj() Record {
|
||||||
var resourceObj Record
|
var resourceObj Record
|
||||||
|
|
||||||
resourceObj.Id = r.Id
|
resourceObj.Id = r.ID
|
||||||
resourceObj.BondId = r.BondId
|
resourceObj.BondId = r.BondID
|
||||||
resourceObj.CreateTime = r.CreateTime
|
resourceObj.CreateTime = r.CreateTime
|
||||||
resourceObj.ExpiryTime = r.ExpiryTime
|
resourceObj.ExpiryTime = r.ExpiryTime
|
||||||
resourceObj.Deleted = r.Deleted
|
resourceObj.Deleted = r.Deleted
|
||||||
|
Loading…
Reference in New Issue
Block a user