mirror of
https://github.com/planetmint/planetmint-go.git
synced 2025-11-24 06:25:47 +00:00
Merge branch 'main' into dependabot/go_modules/lib/google.golang.org/protobuf-1.33.0
This commit is contained in:
commit
6bf9b7eac0
121
.github/workflows/audit.yaml
vendored
121
.github/workflows/audit.yaml
vendored
@ -6,12 +6,27 @@ on: [push]
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
directory: [".", "lib"]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Checkout dependency
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: rddl-network/bc-slip39-go
|
||||||
|
path: bc-slip39-go
|
||||||
|
|
||||||
|
- name: Build dependency
|
||||||
|
run: |
|
||||||
|
pushd bc-slip39-go
|
||||||
|
./deps.sh
|
||||||
|
popd
|
||||||
|
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
@ -21,7 +36,9 @@ jobs:
|
|||||||
run: go mod verify
|
run: go mod verify
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: go build -v ./...
|
run: |
|
||||||
|
pushd ${{ matrix.directory }}
|
||||||
|
go build -v ./...
|
||||||
|
|
||||||
proto:
|
proto:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -52,6 +69,9 @@ jobs:
|
|||||||
|
|
||||||
gofmt:
|
gofmt:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
directory: [".", "lib"]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@ -64,32 +84,66 @@ jobs:
|
|||||||
go-version: "1.21"
|
go-version: "1.21"
|
||||||
|
|
||||||
- name: Run gofmt
|
- name: Run gofmt
|
||||||
run: if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi
|
run: |
|
||||||
|
pushd ${{ matrix.directory }}
|
||||||
|
if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi
|
||||||
|
|
||||||
govet:
|
govet:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
directory: [".", "lib"]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Checkout dependency
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: rddl-network/bc-slip39-go
|
||||||
|
path: bc-slip39-go
|
||||||
|
|
||||||
|
- name: Build dependency
|
||||||
|
run: |
|
||||||
|
pushd bc-slip39-go
|
||||||
|
./deps.sh
|
||||||
|
popd
|
||||||
|
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: "1.21"
|
go-version: "1.21"
|
||||||
|
|
||||||
- name: Run go vet
|
- name: Run go vet
|
||||||
run: go vet ./...
|
run: |
|
||||||
|
pushd ${{ matrix.directory }}
|
||||||
|
go vet ./...
|
||||||
|
|
||||||
staticcheck:
|
staticcheck:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
directory: [".", "lib"]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Checkout dependency
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: rddl-network/bc-slip39-go
|
||||||
|
path: bc-slip39-go
|
||||||
|
|
||||||
|
- name: Build dependency
|
||||||
|
run: |
|
||||||
|
pushd bc-slip39-go
|
||||||
|
./deps.sh
|
||||||
|
popd
|
||||||
|
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
@ -100,9 +154,13 @@ jobs:
|
|||||||
|
|
||||||
- name: Run staticcheck
|
- name: Run staticcheck
|
||||||
run: |
|
run: |
|
||||||
|
pushd ${{ matrix.directory }}
|
||||||
staticcheck ./...
|
staticcheck ./...
|
||||||
|
|
||||||
golangci-lint:
|
golangci-lint:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
directory: [".", "lib"]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@ -120,30 +178,13 @@ jobs:
|
|||||||
|
|
||||||
- name: Run golangci-lint
|
- name: Run golangci-lint
|
||||||
run: |
|
run: |
|
||||||
golangci-lint run
|
pushd ${{ matrix.directory }}
|
||||||
|
|
||||||
golangci-lint-lib:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup Go
|
|
||||||
uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: "1.21"
|
|
||||||
|
|
||||||
- name: Install golangci-lint
|
|
||||||
run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
|
|
||||||
|
|
||||||
- name: Run golangci-lint
|
|
||||||
run: |
|
|
||||||
pushd lib
|
|
||||||
golangci-lint run
|
golangci-lint run
|
||||||
|
|
||||||
gotest:
|
gotest:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
directory: [".", "lib"]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@ -151,6 +192,18 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Checkout dependency
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: rddl-network/bc-slip39-go
|
||||||
|
path: bc-slip39-go
|
||||||
|
|
||||||
|
- name: Build dependency
|
||||||
|
run: |
|
||||||
|
pushd bc-slip39-go
|
||||||
|
./deps.sh
|
||||||
|
popd
|
||||||
|
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
@ -158,26 +211,8 @@ jobs:
|
|||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
|
pushd ${{ matrix.directory }}
|
||||||
# Exclude generated .pb.go and .pb.gw.go files from test and coverage
|
# Exclude generated .pb.go and .pb.gw.go files from test and coverage
|
||||||
go test -coverprofile cover.out -race -vet=off -v $(go list ./... | grep -v types)
|
go test -coverprofile cover.out -race -vet=off -v $(go list ./... | grep -v types)
|
||||||
# Print coverage by function
|
# Print coverage by function
|
||||||
go tool cover -func=cover.out
|
go tool cover -func=cover.out
|
||||||
|
|
||||||
gotest-lib:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup Go
|
|
||||||
uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: "1.21"
|
|
||||||
|
|
||||||
- name: Run tests
|
|
||||||
run: |
|
|
||||||
pushd lib
|
|
||||||
go test -coverprofile cover.out -race -vet=off -v ./...
|
|
||||||
go tool cover -func=cover.out
|
|
||||||
|
|||||||
@ -132,4 +132,13 @@ issues:
|
|||||||
- revive
|
- revive
|
||||||
- path: docs/docs\.go
|
- path: docs/docs\.go
|
||||||
linters:
|
linters:
|
||||||
- revive
|
- revive
|
||||||
|
- path: util/elementsd_connector_test\.go
|
||||||
|
linters:
|
||||||
|
- paralleltest
|
||||||
|
- path: monitor/mqtt_monitor_test\.go
|
||||||
|
linters:
|
||||||
|
- paralleltest
|
||||||
|
- path: monitor/.*\.go
|
||||||
|
linters:
|
||||||
|
- durationcheck
|
||||||
|
|||||||
@ -84,6 +84,10 @@ func (dfd DeductFeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bo
|
|||||||
var (
|
var (
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
|
msgs := tx.GetMsgs()
|
||||||
|
if len(msgs) == 1 && sdk.MsgTypeURL(msgs[0]) == "/planetmintgo.machine.MsgAttestMachine" {
|
||||||
|
return next(ctx, tx, simulate)
|
||||||
|
}
|
||||||
|
|
||||||
fee := feeTx.GetFee()
|
fee := feeTx.GetFee()
|
||||||
if !simulate {
|
if !simulate {
|
||||||
|
|||||||
@ -996,4 +996,7 @@ func (app *App) setupUpgradeHandlers() {
|
|||||||
fromVM[machinemoduletypes.ModuleName] = machinemodule.AppModule{}.ConsensusVersion()
|
fromVM[machinemoduletypes.ModuleName] = machinemodule.AppModule{}.ConsensusVersion()
|
||||||
return app.mm.RunMigrations(ctx, app.configurator, fromVM)
|
return app.mm.RunMigrations(ctx, app.configurator, fromVM)
|
||||||
})
|
})
|
||||||
|
app.UpgradeKeeper.SetUpgradeHandler("v0.10.0", func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
|
||||||
|
return app.mm.RunMigrations(ctx, app.configurator, fromVM)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
128
clients/claim_client.go
Normal file
128
clients/claim_client.go
Normal file
@ -0,0 +1,128 @@
|
|||||||
|
package clients
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"context"
|
||||||
|
"encoding/json"
|
||||||
|
"io"
|
||||||
|
"net/http"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
"github.com/planetmint/planetmint-go/config"
|
||||||
|
)
|
||||||
|
|
||||||
|
// TODO: revert to actual rddl-claim-service client after CosmosSDK upgrade to v0.50.x
|
||||||
|
// see https://github.com/planetmint/planetmint-go/issues/384
|
||||||
|
|
||||||
|
var ClaimServiceClient IRCClient
|
||||||
|
|
||||||
|
func lazyLoad() IRCClient {
|
||||||
|
if ClaimServiceClient != nil {
|
||||||
|
return ClaimServiceClient
|
||||||
|
}
|
||||||
|
cfg := config.GetConfig()
|
||||||
|
ClaimServiceClient = NewRCClient(cfg.ClaimHost, &http.Client{})
|
||||||
|
return ClaimServiceClient
|
||||||
|
}
|
||||||
|
|
||||||
|
func PostClaim(ctx context.Context, beneficiary string, amount uint64, id uint64) (txID string, err error) {
|
||||||
|
client := lazyLoad()
|
||||||
|
res, err := client.PostClaim(ctx, PostClaimRequest{Beneficiary: beneficiary, Amount: amount, ClaimID: int(id)})
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
return res.TxID, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type PostClaimRequest struct {
|
||||||
|
Beneficiary string `binding:"required" json:"beneficiary"`
|
||||||
|
Amount uint64 `binding:"required" json:"amount"`
|
||||||
|
ClaimID int `binding:"required" json:"claim-id"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type PostClaimResponse struct {
|
||||||
|
ID int `binding:"required" json:"id"`
|
||||||
|
TxID string `binding:"required" json:"tx-id"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetClaimResponse struct {
|
||||||
|
ID int `binding:"required" json:"id"`
|
||||||
|
Beneficiary string `binding:"required" json:"beneficiary"`
|
||||||
|
Amount uint64 `binding:"required" json:"amount"`
|
||||||
|
LiquidTXHash string `binding:"required" json:"liquid-tx-hash"`
|
||||||
|
ClaimID int `binding:"required" json:"claim-id"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type IRCClient interface {
|
||||||
|
GetClaim(ctx context.Context, id int) (res GetClaimResponse, err error)
|
||||||
|
PostClaim(ctx context.Context, req PostClaimRequest) (res PostClaimResponse, err error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type RCClient struct {
|
||||||
|
baseURL string
|
||||||
|
client *http.Client
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewRCClient(baseURL string, client *http.Client) *RCClient {
|
||||||
|
if client == nil {
|
||||||
|
client = &http.Client{}
|
||||||
|
}
|
||||||
|
return &RCClient{
|
||||||
|
baseURL: baseURL,
|
||||||
|
client: client,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (rcc *RCClient) GetClaim(ctx context.Context, id int) (res GetClaimResponse, err error) {
|
||||||
|
err = rcc.doRequest(ctx, http.MethodGet, rcc.baseURL+"/claim/"+strconv.Itoa(id), nil, &res)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func (rcc *RCClient) PostClaim(ctx context.Context, req PostClaimRequest) (res PostClaimResponse, err error) {
|
||||||
|
err = rcc.doRequest(ctx, http.MethodPost, rcc.baseURL+"/claim", req, &res)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func (rcc *RCClient) doRequest(ctx context.Context, method, url string, body interface{}, response interface{}) (err error) {
|
||||||
|
var bodyReader io.Reader
|
||||||
|
if body != nil {
|
||||||
|
bodyBytes, err := json.Marshal(body)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
bodyReader = bytes.NewBuffer(bodyBytes)
|
||||||
|
}
|
||||||
|
|
||||||
|
req, err := http.NewRequestWithContext(ctx, method, url, bodyReader)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if body != nil {
|
||||||
|
req.Header.Set("Content-Type", "application/json")
|
||||||
|
}
|
||||||
|
|
||||||
|
resp, err := rcc.client.Do(req)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
defer resp.Body.Close()
|
||||||
|
|
||||||
|
if resp.StatusCode >= 400 {
|
||||||
|
return &httpError{StatusCode: resp.StatusCode}
|
||||||
|
}
|
||||||
|
|
||||||
|
if response != nil {
|
||||||
|
return json.NewDecoder(resp.Body).Decode(response)
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
type httpError struct {
|
||||||
|
StatusCode int
|
||||||
|
}
|
||||||
|
|
||||||
|
func (e *httpError) Error() string {
|
||||||
|
return http.StatusText(e.StatusCode)
|
||||||
|
}
|
||||||
@ -23,7 +23,8 @@ mqtt-domain = "{{ .PlmntConfig.MqttDomain }}"
|
|||||||
mqtt-port = {{ .PlmntConfig.MqttPort }}
|
mqtt-port = {{ .PlmntConfig.MqttPort }}
|
||||||
mqtt-user = "{{ .PlmntConfig.MqttUser }}"
|
mqtt-user = "{{ .PlmntConfig.MqttUser }}"
|
||||||
mqtt-password = "{{ .PlmntConfig.MqttPassword }}"
|
mqtt-password = "{{ .PlmntConfig.MqttPassword }}"
|
||||||
|
claim-host = "{{ .PlmntConfig.ClaimHost }}"
|
||||||
|
mqtt-tls = {{ .PlmntConfig.MqttTLS }}
|
||||||
`
|
`
|
||||||
|
|
||||||
// Config defines Planetmint's top level configuration
|
// Config defines Planetmint's top level configuration
|
||||||
@ -40,6 +41,8 @@ type Config struct {
|
|||||||
MqttPort int `json:"mqtt-port" mapstructure:"mqtt-port"`
|
MqttPort int `json:"mqtt-port" mapstructure:"mqtt-port"`
|
||||||
MqttUser string `json:"mqtt-user" mapstructure:"mqtt-user"`
|
MqttUser string `json:"mqtt-user" mapstructure:"mqtt-user"`
|
||||||
MqttPassword string `json:"mqtt-password" mapstructure:"mqtt-password"`
|
MqttPassword string `json:"mqtt-password" mapstructure:"mqtt-password"`
|
||||||
|
ClaimHost string `json:"claim-host" mapstructure:"claim-host"`
|
||||||
|
MqttTLS bool `json:"mqtt-tls" mapstructure:"mqtt-tls"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// cosmos-sdk wide global singleton
|
// cosmos-sdk wide global singleton
|
||||||
@ -60,9 +63,11 @@ func DefaultConfig() *Config {
|
|||||||
RPCWallet: "rpcwallet",
|
RPCWallet: "rpcwallet",
|
||||||
ValidatorAddress: "plmnt1w5dww335zhh98pzv783hqre355ck3u4w4hjxcx",
|
ValidatorAddress: "plmnt1w5dww335zhh98pzv783hqre355ck3u4w4hjxcx",
|
||||||
MqttDomain: "testnet-mqtt.rddl.io",
|
MqttDomain: "testnet-mqtt.rddl.io",
|
||||||
MqttPort: 1885,
|
MqttPort: 1886,
|
||||||
MqttUser: "user",
|
MqttUser: "user",
|
||||||
MqttPassword: "password",
|
MqttPassword: "password",
|
||||||
|
ClaimHost: "https://testnet-p2r.rddl.io",
|
||||||
|
MqttTLS: true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
19
docs/static/openapi.yml
vendored
19
docs/static/openapi.yml
vendored
@ -46437,7 +46437,7 @@ paths:
|
|||||||
}
|
}
|
||||||
tags:
|
tags:
|
||||||
- Query
|
- Query
|
||||||
/planetmint/asset/address/{address}/{lookupPeriodInMin}:
|
/planetmint/asset/address/{address}/{numElements}:
|
||||||
get:
|
get:
|
||||||
summary: Queries a list of GetCIDsByAddress items.
|
summary: Queries a list of GetCIDsByAddress items.
|
||||||
operationId: PlanetmintgoAssetGetCIDsByAddress
|
operationId: PlanetmintgoAssetGetCIDsByAddress
|
||||||
@ -46502,7 +46502,7 @@ paths:
|
|||||||
in: path
|
in: path
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
- name: lookupPeriodInMin
|
- name: numElements
|
||||||
in: path
|
in: path
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
@ -47644,6 +47644,11 @@ paths:
|
|||||||
type: string
|
type: string
|
||||||
asset_registry_path:
|
asset_registry_path:
|
||||||
type: string
|
type: string
|
||||||
|
dao_machine_funding_amount:
|
||||||
|
type: string
|
||||||
|
format: uint64
|
||||||
|
dao_machine_funding_denom:
|
||||||
|
type: string
|
||||||
description: >-
|
description: >-
|
||||||
QueryParamsResponse is response type for the Query/Params RPC
|
QueryParamsResponse is response type for the Query/Params RPC
|
||||||
method.
|
method.
|
||||||
@ -77177,6 +77182,11 @@ definitions:
|
|||||||
type: string
|
type: string
|
||||||
asset_registry_path:
|
asset_registry_path:
|
||||||
type: string
|
type: string
|
||||||
|
dao_machine_funding_amount:
|
||||||
|
type: string
|
||||||
|
format: uint64
|
||||||
|
dao_machine_funding_denom:
|
||||||
|
type: string
|
||||||
description: Params defines the parameters for the module.
|
description: Params defines the parameters for the module.
|
||||||
planetmintgo.machine.QueryGetLiquidAssetsByMachineidResponse:
|
planetmintgo.machine.QueryGetLiquidAssetsByMachineidResponse:
|
||||||
type: object
|
type: object
|
||||||
@ -77300,6 +77310,11 @@ definitions:
|
|||||||
type: string
|
type: string
|
||||||
asset_registry_path:
|
asset_registry_path:
|
||||||
type: string
|
type: string
|
||||||
|
dao_machine_funding_amount:
|
||||||
|
type: string
|
||||||
|
format: uint64
|
||||||
|
dao_machine_funding_denom:
|
||||||
|
type: string
|
||||||
description: QueryParamsResponse is response type for the Query/Params RPC method.
|
description: QueryParamsResponse is response type for the Query/Params RPC method.
|
||||||
planetmintgo.machine.TrustAnchor:
|
planetmintgo.machine.TrustAnchor:
|
||||||
type: object
|
type: object
|
||||||
|
|||||||
60
go.mod
60
go.mod
@ -24,24 +24,26 @@ require (
|
|||||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0
|
github.com/grpc-ecosystem/grpc-gateway v1.16.0
|
||||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2
|
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.2
|
||||||
github.com/planetmint/planetmint-go/lib v0.5.0
|
github.com/planetmint/planetmint-go/lib v0.5.0
|
||||||
github.com/rddl-network/elements-rpc v0.5.2
|
github.com/rddl-network/elements-rpc v1.0.0
|
||||||
github.com/spf13/cast v1.5.0
|
github.com/rddl-network/go-utils v0.1.1
|
||||||
|
github.com/spf13/cast v1.6.0
|
||||||
github.com/spf13/cobra v1.6.1
|
github.com/spf13/cobra v1.6.1
|
||||||
github.com/spf13/pflag v1.0.5
|
github.com/spf13/pflag v1.0.5
|
||||||
github.com/stretchr/testify v1.8.4
|
github.com/stretchr/testify v1.9.0
|
||||||
google.golang.org/genproto/googleapis/api v0.0.0-20230629202037-9506855d4529
|
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d
|
||||||
google.golang.org/grpc v1.56.3
|
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17
|
||||||
|
google.golang.org/grpc v1.59.0
|
||||||
gopkg.in/yaml.v2 v2.4.0
|
gopkg.in/yaml.v2 v2.4.0
|
||||||
gotest.tools v2.2.0+incompatible
|
gotest.tools v2.2.0+incompatible
|
||||||
sigs.k8s.io/yaml v1.3.0
|
sigs.k8s.io/yaml v1.3.0
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
cloud.google.com/go v0.110.4 // indirect
|
cloud.google.com/go v0.110.10 // indirect
|
||||||
cloud.google.com/go/compute v1.20.1 // indirect
|
cloud.google.com/go/compute v1.23.3 // indirect
|
||||||
cloud.google.com/go/compute/metadata v0.2.3 // indirect
|
cloud.google.com/go/compute/metadata v0.2.3 // indirect
|
||||||
cloud.google.com/go/iam v1.1.0 // indirect
|
cloud.google.com/go/iam v1.1.5 // indirect
|
||||||
cloud.google.com/go/storage v1.30.1 // indirect
|
cloud.google.com/go/storage v1.35.1 // indirect
|
||||||
cosmossdk.io/core v0.5.1 // indirect
|
cosmossdk.io/core v0.5.1 // indirect
|
||||||
cosmossdk.io/log v1.2.1 // indirect
|
cosmossdk.io/log v1.2.1 // indirect
|
||||||
cosmossdk.io/tools/rosetta v0.2.1 // indirect
|
cosmossdk.io/tools/rosetta v0.2.1 // indirect
|
||||||
@ -74,7 +76,7 @@ require (
|
|||||||
github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect
|
github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect
|
||||||
github.com/creachadair/taskgroup v0.4.2 // indirect
|
github.com/creachadair/taskgroup v0.4.2 // indirect
|
||||||
github.com/danieljoos/wincred v1.1.2 // indirect
|
github.com/danieljoos/wincred v1.1.2 // indirect
|
||||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
|
||||||
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect
|
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect
|
||||||
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
|
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
|
||||||
github.com/dgraph-io/badger/v2 v2.2007.4 // indirect
|
github.com/dgraph-io/badger/v2 v2.2007.4 // indirect
|
||||||
@ -83,7 +85,7 @@ require (
|
|||||||
github.com/dustin/go-humanize v1.0.1 // indirect
|
github.com/dustin/go-humanize v1.0.1 // indirect
|
||||||
github.com/dvsekhvalnov/jose2go v1.6.0 // indirect
|
github.com/dvsekhvalnov/jose2go v1.6.0 // indirect
|
||||||
github.com/felixge/httpsnoop v1.0.2 // indirect
|
github.com/felixge/httpsnoop v1.0.2 // indirect
|
||||||
github.com/fsnotify/fsnotify v1.6.0 // indirect
|
github.com/fsnotify/fsnotify v1.7.0 // indirect
|
||||||
github.com/getsentry/sentry-go v0.23.0 // indirect
|
github.com/getsentry/sentry-go v0.23.0 // indirect
|
||||||
github.com/ghodss/yaml v1.0.0 // indirect
|
github.com/ghodss/yaml v1.0.0 // indirect
|
||||||
github.com/go-kit/kit v0.12.0 // indirect
|
github.com/go-kit/kit v0.12.0 // indirect
|
||||||
@ -92,16 +94,16 @@ require (
|
|||||||
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
|
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
|
||||||
github.com/gogo/googleapis v1.4.1 // indirect
|
github.com/gogo/googleapis v1.4.1 // indirect
|
||||||
github.com/gogo/protobuf v1.3.2 // indirect
|
github.com/gogo/protobuf v1.3.2 // indirect
|
||||||
github.com/golang/glog v1.1.0 // indirect
|
github.com/golang/glog v1.1.2 // indirect
|
||||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||||
github.com/golang/snappy v0.0.4 // indirect
|
github.com/golang/snappy v0.0.4 // indirect
|
||||||
github.com/google/btree v1.1.2 // indirect
|
github.com/google/btree v1.1.2 // indirect
|
||||||
github.com/google/go-cmp v0.5.9 // indirect
|
github.com/google/go-cmp v0.6.0 // indirect
|
||||||
github.com/google/orderedcode v0.0.1 // indirect
|
github.com/google/orderedcode v0.0.1 // indirect
|
||||||
github.com/google/s2a-go v0.1.4 // indirect
|
github.com/google/s2a-go v0.1.7 // indirect
|
||||||
github.com/google/uuid v1.3.0 // indirect
|
github.com/google/uuid v1.4.0 // indirect
|
||||||
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
|
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
|
||||||
github.com/googleapis/gax-go/v2 v2.11.0 // indirect
|
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
|
||||||
github.com/gorilla/handlers v1.5.1 // indirect
|
github.com/gorilla/handlers v1.5.1 // indirect
|
||||||
github.com/gorilla/websocket v1.5.0 // indirect
|
github.com/gorilla/websocket v1.5.0 // indirect
|
||||||
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
|
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
|
||||||
@ -137,10 +139,10 @@ require (
|
|||||||
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
|
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
|
||||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||||
github.com/mtibben/percent v0.2.1 // indirect
|
github.com/mtibben/percent v0.2.1 // indirect
|
||||||
github.com/pelletier/go-toml/v2 v2.0.7 // indirect
|
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
|
||||||
github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect
|
github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect
|
||||||
github.com/pkg/errors v0.9.1 // indirect
|
github.com/pkg/errors v0.9.1 // indirect
|
||||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
|
||||||
github.com/prometheus/client_golang v1.14.0 // indirect
|
github.com/prometheus/client_golang v1.14.0 // indirect
|
||||||
github.com/prometheus/client_model v0.3.0 // indirect
|
github.com/prometheus/client_model v0.3.0 // indirect
|
||||||
github.com/prometheus/common v0.42.0 // indirect
|
github.com/prometheus/common v0.42.0 // indirect
|
||||||
@ -151,11 +153,10 @@ require (
|
|||||||
github.com/rs/cors v1.8.3 // indirect
|
github.com/rs/cors v1.8.3 // indirect
|
||||||
github.com/rs/zerolog v1.30.0 // indirect
|
github.com/rs/zerolog v1.30.0 // indirect
|
||||||
github.com/sasha-s/go-deadlock v0.3.1 // indirect
|
github.com/sasha-s/go-deadlock v0.3.1 // indirect
|
||||||
github.com/spf13/afero v1.9.3 // indirect
|
github.com/spf13/afero v1.11.0 // indirect
|
||||||
github.com/spf13/jwalterweatherman v1.1.0 // indirect
|
github.com/spf13/jwalterweatherman v1.1.0 // indirect
|
||||||
github.com/spf13/viper v1.15.0 // indirect
|
github.com/spf13/viper v1.16.0 // indirect
|
||||||
github.com/subosito/gotenv v1.4.2 // indirect
|
github.com/subosito/gotenv v1.6.0 // indirect
|
||||||
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
|
|
||||||
github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect
|
github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect
|
||||||
github.com/tendermint/go-amino v0.16.0 // indirect
|
github.com/tendermint/go-amino v0.16.0 // indirect
|
||||||
github.com/tidwall/btree v1.6.0 // indirect
|
github.com/tidwall/btree v1.6.0 // indirect
|
||||||
@ -166,17 +167,18 @@ require (
|
|||||||
go.opencensus.io v0.24.0 // indirect
|
go.opencensus.io v0.24.0 // indirect
|
||||||
golang.org/x/crypto v0.17.0 // indirect
|
golang.org/x/crypto v0.17.0 // indirect
|
||||||
golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb // indirect
|
golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb // indirect
|
||||||
golang.org/x/net v0.17.0 // indirect
|
golang.org/x/net v0.19.0 // indirect
|
||||||
golang.org/x/oauth2 v0.8.0 // indirect
|
golang.org/x/oauth2 v0.15.0 // indirect
|
||||||
golang.org/x/sync v0.2.0 // indirect
|
golang.org/x/sync v0.5.0 // indirect
|
||||||
golang.org/x/sys v0.15.0 // indirect
|
golang.org/x/sys v0.15.0 // indirect
|
||||||
golang.org/x/term v0.15.0 // indirect
|
golang.org/x/term v0.15.0 // indirect
|
||||||
golang.org/x/text v0.14.0 // indirect
|
golang.org/x/text v0.14.0 // indirect
|
||||||
|
golang.org/x/time v0.5.0 // 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.126.0 // indirect
|
google.golang.org/api v0.152.0 // indirect
|
||||||
google.golang.org/appengine v1.6.7 // indirect
|
google.golang.org/appengine v1.6.7 // indirect
|
||||||
google.golang.org/genproto v0.0.0-20230706204954-ccb25ca9f130 // indirect
|
google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 // indirect
|
||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f // indirect
|
||||||
google.golang.org/protobuf v1.31.0 // indirect
|
google.golang.org/protobuf v1.31.0 // indirect
|
||||||
gopkg.in/ini.v1 v1.67.0 // indirect
|
gopkg.in/ini.v1 v1.67.0 // indirect
|
||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||||
|
|||||||
134
go.sum
134
go.sum
@ -3,7 +3,6 @@ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT
|
|||||||
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
|
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
|
||||||
cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
|
cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
|
||||||
cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
|
cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
|
||||||
cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
|
|
||||||
cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc=
|
cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc=
|
||||||
cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
|
cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
|
||||||
cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To=
|
cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To=
|
||||||
@ -16,7 +15,6 @@ cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOY
|
|||||||
cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY=
|
cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY=
|
||||||
cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI=
|
cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI=
|
||||||
cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk=
|
cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk=
|
||||||
cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY=
|
|
||||||
cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg=
|
cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg=
|
||||||
cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8=
|
cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8=
|
||||||
cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0=
|
cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0=
|
||||||
@ -32,8 +30,8 @@ cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w9
|
|||||||
cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc=
|
cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc=
|
||||||
cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU=
|
cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU=
|
||||||
cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA=
|
cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA=
|
||||||
cloud.google.com/go v0.110.4 h1:1JYyxKMN9hd5dR2MYTPWkGUgcoxVVhg0LKNKEo0qvmk=
|
cloud.google.com/go v0.110.10 h1:LXy9GEO+timppncPIAZoOj3l58LIU9k+kn48AN7IO3Y=
|
||||||
cloud.google.com/go v0.110.4/go.mod h1:+EYjdK8e5RME/VY/qLCAtuyALQ9q67dvuum8i+H5xsI=
|
cloud.google.com/go v0.110.10/go.mod h1:v1OoFqYxiBkUrruItNM3eT4lLByNjxmJSV/xDKJNnic=
|
||||||
cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw=
|
cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw=
|
||||||
cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY=
|
cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY=
|
||||||
cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI=
|
cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI=
|
||||||
@ -70,8 +68,8 @@ cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz
|
|||||||
cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU=
|
cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU=
|
||||||
cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U=
|
cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U=
|
||||||
cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU=
|
cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU=
|
||||||
cloud.google.com/go/compute v1.20.1 h1:6aKEtlUiwEpJzM001l0yFkpXmUVXaN8W+fbkb2AZNbg=
|
cloud.google.com/go/compute v1.23.3 h1:6sVlXXBmbd7jNX0Ipq0trII3e4n1/MsADLK6a+aiVlk=
|
||||||
cloud.google.com/go/compute v1.20.1/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM=
|
cloud.google.com/go/compute v1.23.3/go.mod h1:VCgBUoMnIVIR0CscqQiPJLAG25E3ZRZMzcFZeQ+h8CI=
|
||||||
cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY=
|
cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY=
|
||||||
cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA=
|
cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA=
|
||||||
cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I=
|
cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I=
|
||||||
@ -111,8 +109,8 @@ cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y97
|
|||||||
cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc=
|
cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc=
|
||||||
cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY=
|
cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY=
|
||||||
cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc=
|
cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc=
|
||||||
cloud.google.com/go/iam v1.1.0 h1:67gSqaPukx7O8WLLHMa0PNs3EBGd2eE4d+psbO/CO94=
|
cloud.google.com/go/iam v1.1.5 h1:1jTsCu4bcsNsE4iiqNT5SHwrDRCfRmIaaaVFhRveTJI=
|
||||||
cloud.google.com/go/iam v1.1.0/go.mod h1:nxdHjaKfCr7fNYx/HJMM8LgiMugmveWlkatear5gVyk=
|
cloud.google.com/go/iam v1.1.5/go.mod h1:rB6P/Ic3mykPbFio+vo7403drjlgvoWfYpJhMXEbzv8=
|
||||||
cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic=
|
cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic=
|
||||||
cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI=
|
cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI=
|
||||||
cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8=
|
cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8=
|
||||||
@ -170,12 +168,11 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo
|
|||||||
cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
|
cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
|
||||||
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
|
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
|
||||||
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
|
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
|
||||||
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
|
|
||||||
cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y=
|
cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y=
|
||||||
cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc=
|
cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc=
|
||||||
cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s=
|
cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s=
|
||||||
cloud.google.com/go/storage v1.30.1 h1:uOdMxAs8HExqBlnLtnQyP0YkvbiDpdGShGKtx6U/oNM=
|
cloud.google.com/go/storage v1.35.1 h1:B59ahL//eDfx2IIKFBeT5Atm9wnNmj3+8xG/W4WB//w=
|
||||||
cloud.google.com/go/storage v1.30.1/go.mod h1:NfxhC0UJE1aXSx7CIIbCf7y9HKT7BiccwkR7+P7gN8E=
|
cloud.google.com/go/storage v1.35.1/go.mod h1:M6M/3V/D3KpzMTJyPOR/HU6n2Si5QdaXYEsng2xgOs8=
|
||||||
cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw=
|
cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw=
|
||||||
cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g=
|
cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g=
|
||||||
cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU=
|
cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU=
|
||||||
@ -379,8 +376,9 @@ github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuA
|
|||||||
github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0=
|
github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0=
|
||||||
github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
|
||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
|
||||||
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0=
|
github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0=
|
||||||
github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc=
|
github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc=
|
||||||
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs=
|
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs=
|
||||||
@ -433,11 +431,11 @@ github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSw
|
|||||||
github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=
|
github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=
|
||||||
github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4=
|
github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4=
|
||||||
github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20=
|
github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20=
|
||||||
github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE=
|
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
|
||||||
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||||
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
|
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
|
||||||
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
|
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
|
||||||
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
|
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
|
||||||
github.com/getsentry/sentry-go v0.23.0 h1:dn+QRCeJv4pPt9OjVXiMcGIBIefaTJPw/h0bZWO05nE=
|
github.com/getsentry/sentry-go v0.23.0 h1:dn+QRCeJv4pPt9OjVXiMcGIBIefaTJPw/h0bZWO05nE=
|
||||||
github.com/getsentry/sentry-go v0.23.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY=
|
github.com/getsentry/sentry-go v0.23.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY=
|
||||||
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
|
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
|
||||||
@ -492,8 +490,8 @@ github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXP
|
|||||||
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
|
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
|
||||||
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
||||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||||
github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE=
|
github.com/golang/glog v1.1.2 h1:DVjP2PbBOzHyzA+dn3WhHIq4NdVu3Q+pvivFICf/7fo=
|
||||||
github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ=
|
github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ=
|
||||||
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||||
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||||
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||||
@ -552,8 +550,9 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
|
|||||||
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
|
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
|
||||||
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||||
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
|
||||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||||
|
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||||
|
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||||
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
|
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
|
||||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||||
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
|
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
|
||||||
@ -574,24 +573,24 @@ github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hf
|
|||||||
github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||||
github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||||
github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||||
github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
|
||||||
github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||||
github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||||
github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||||
github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||||
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||||
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
||||||
github.com/google/s2a-go v0.1.4 h1:1kZ/sQM3srePvKs3tXAvQzo66XfcReoqFpIpIccE7Oc=
|
github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o=
|
||||||
github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A=
|
github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw=
|
||||||
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
|
|
||||||
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
|
github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4=
|
||||||
|
github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8=
|
github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8=
|
||||||
github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8=
|
github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8=
|
||||||
github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg=
|
github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg=
|
||||||
github.com/googleapis/enterprise-certificate-proxy v0.2.3 h1:yk9/cqRKtT9wXZSsRH9aurXEpJX+U6FLtpYTdC3R06k=
|
github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs=
|
||||||
github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k=
|
github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0=
|
||||||
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
|
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
|
||||||
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
|
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
|
||||||
github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0=
|
github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0=
|
||||||
@ -601,10 +600,9 @@ github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99
|
|||||||
github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c=
|
github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c=
|
||||||
github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo=
|
github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo=
|
||||||
github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY=
|
github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY=
|
||||||
github.com/googleapis/gax-go/v2 v2.11.0 h1:9V9PWXEsWnPpQhu/PeQIkS4eGzMlTLGgt80cUUI8Ki4=
|
github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas=
|
||||||
github.com/googleapis/gax-go/v2 v2.11.0/go.mod h1:DxmR61SGKkGLa2xigwuZIQpkCI2S5iydzRfb3peWZJI=
|
github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU=
|
||||||
github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4=
|
github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4=
|
||||||
github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g=
|
|
||||||
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
||||||
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
|
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
|
||||||
github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4=
|
github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4=
|
||||||
@ -725,7 +723,6 @@ github.com/klauspost/compress v1.16.3 h1:XuJt9zzcnaz6a16/OU53ZjWp/v7/42WcR5t2a0P
|
|||||||
github.com/klauspost/compress v1.16.3/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
|
github.com/klauspost/compress v1.16.3/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
|
||||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||||
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||||
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
|
|
||||||
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
|
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
|
||||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||||
@ -837,8 +834,8 @@ github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0Mw
|
|||||||
github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
|
github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
|
||||||
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
|
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
|
||||||
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
|
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
|
||||||
github.com/pelletier/go-toml/v2 v2.0.7 h1:muncTPStnKRos5dpVKULv2FVd4bMOhNePj9CjgDb8Us=
|
github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4=
|
||||||
github.com/pelletier/go-toml/v2 v2.0.7/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek=
|
github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc=
|
||||||
github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac=
|
github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac=
|
||||||
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o=
|
github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o=
|
||||||
github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 h1:hDSdbBuw3Lefr6R18ax0tZ2BJeNB3NehB3trOwYBsdU=
|
github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 h1:hDSdbBuw3Lefr6R18ax0tZ2BJeNB3NehB3trOwYBsdU=
|
||||||
@ -852,9 +849,9 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE
|
|||||||
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA=
|
github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA=
|
||||||
github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg=
|
|
||||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
|
||||||
|
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
|
github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
|
||||||
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
|
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
|
||||||
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs=
|
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs=
|
||||||
@ -893,8 +890,10 @@ github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Ung
|
|||||||
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
|
github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
|
||||||
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM=
|
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM=
|
||||||
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
|
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
|
||||||
github.com/rddl-network/elements-rpc v0.5.2 h1:gHCJEJR72/bi98gSfLCL5GHxAJnWZIrhkUwCpvLA5j0=
|
github.com/rddl-network/elements-rpc v1.0.0 h1:geFcsaD1t2ONxRC13semPpiOwsJl0ZCfkFT9UIKPZFk=
|
||||||
github.com/rddl-network/elements-rpc v0.5.2/go.mod h1:WOSYDMhq+V74lReSInnSejbdEyGI8hiQZSn4cSoFuxo=
|
github.com/rddl-network/elements-rpc v1.0.0/go.mod h1:E35cJMXZqe1iEo/AvjwSWn25mHZ4+y4gV8qj0lWle5c=
|
||||||
|
github.com/rddl-network/go-utils v0.1.1 h1:41ZrDMM2ree7/OfhKYK4j/SQnyVvms4YirTKneibeyk=
|
||||||
|
github.com/rddl-network/go-utils v0.1.1/go.mod h1:xKO/ZSAEHwcYe8bNUZjcQCIX+6OMXzEXu1WQ1HqXqZA=
|
||||||
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
|
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
|
||||||
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
|
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
|
||||||
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
||||||
@ -929,11 +928,11 @@ github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasO
|
|||||||
github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
|
github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
|
||||||
github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
||||||
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
|
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
|
||||||
github.com/spf13/afero v1.9.3 h1:41FoI0fD7OR7mGcKE/aOiLkGreyf8ifIOQmJANWogMk=
|
github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8=
|
||||||
github.com/spf13/afero v1.9.3/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y=
|
github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY=
|
||||||
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
|
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
|
||||||
github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w=
|
github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0=
|
||||||
github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU=
|
github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
|
||||||
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
|
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
|
||||||
github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU=
|
github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU=
|
||||||
github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA=
|
github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA=
|
||||||
@ -946,16 +945,16 @@ github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn
|
|||||||
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
|
||||||
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
|
||||||
github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
|
github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
|
||||||
github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU=
|
github.com/spf13/viper v1.16.0 h1:rGGH0XDZhdUOryiDWjmIvUSWpbNqisK8Wk0Vyefw8hc=
|
||||||
github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA=
|
github.com/spf13/viper v1.16.0/go.mod h1:yg78JgCJcbrQOvV9YLXgkLaZqUidkY9K+Dd1FofRzQg=
|
||||||
github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw=
|
github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw=
|
||||||
github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw=
|
github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw=
|
||||||
github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI=
|
github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI=
|
||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||||
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
|
|
||||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||||
|
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
|
||||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||||
@ -965,10 +964,11 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
|
|||||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||||
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||||
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
|
|
||||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||||
github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8=
|
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
||||||
github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0=
|
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||||
|
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
|
||||||
|
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
|
||||||
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY=
|
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY=
|
||||||
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc=
|
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc=
|
||||||
github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok=
|
github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok=
|
||||||
@ -1037,10 +1037,7 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U
|
|||||||
golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||||
golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||||
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
|
|
||||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||||
golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
|
||||||
golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
|
||||||
golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k=
|
golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k=
|
||||||
golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
|
golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
|
||||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||||
@ -1125,14 +1122,12 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY
|
|||||||
golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||||
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||||
golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||||
golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
|
||||||
golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||||
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc=
|
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc=
|
||||||
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
|
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
|
||||||
golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||||
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||||
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
|
||||||
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
||||||
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
||||||
golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
||||||
@ -1145,8 +1140,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug
|
|||||||
golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
|
golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
|
||||||
golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
|
golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
|
||||||
golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
|
golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
|
||||||
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
|
golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c=
|
||||||
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
|
golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U=
|
||||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||||
@ -1172,8 +1167,8 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri
|
|||||||
golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg=
|
golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg=
|
||||||
golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg=
|
golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg=
|
||||||
golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A=
|
golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A=
|
||||||
golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8=
|
golang.org/x/oauth2 v0.15.0 h1:s8pnnxNVzjWyrvYdFUQq5llS1PX2zhPXmccZv99h7uQ=
|
||||||
golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE=
|
golang.org/x/oauth2 v0.15.0/go.mod h1:q48ptWNTY5XWf+JNten23lcvHpLJ0ZSxF5ttTHKVCAM=
|
||||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
@ -1188,8 +1183,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ
|
|||||||
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI=
|
golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE=
|
||||||
golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||||
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
@ -1246,13 +1241,11 @@ golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7w
|
|||||||
golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
|
||||||
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
@ -1284,7 +1277,6 @@ golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBc
|
|||||||
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-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/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-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
|
||||||
golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
@ -1304,7 +1296,6 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
|||||||
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||||
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
|
|
||||||
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||||
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
|
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
|
||||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||||
@ -1312,6 +1303,8 @@ golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxb
|
|||||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
|
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
|
||||||
|
golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
|
||||||
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
@ -1366,7 +1359,6 @@ golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4f
|
|||||||
golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||||
golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||||
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||||
golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
|
||||||
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
|
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
|
||||||
golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||||
golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||||
@ -1433,8 +1425,8 @@ google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ
|
|||||||
google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s=
|
google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s=
|
||||||
google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s=
|
google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s=
|
||||||
google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70=
|
google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70=
|
||||||
google.golang.org/api v0.126.0 h1:q4GJq+cAdMAC7XP7njvQ4tvohGLiSlytuL4BQxbIZ+o=
|
google.golang.org/api v0.152.0 h1:t0r1vPnfMc260S2Ci+en7kfCZaLOPs5KI0sVV/6jZrY=
|
||||||
google.golang.org/api v0.126.0/go.mod h1:mBwVAtz+87bEN6CbA1GtZPDOqY2R5ONPqJeIlvyo4Aw=
|
google.golang.org/api v0.152.0/go.mod h1:3qNJX5eOmhiWYc67jRA/3GsDw97UFb5ivv7Y2PrriAY=
|
||||||
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
|
||||||
google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||||
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
|
||||||
@ -1482,10 +1474,8 @@ google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6D
|
|||||||
google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
|
||||||
google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
|
||||||
google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
@ -1552,12 +1542,12 @@ google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqw
|
|||||||
google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM=
|
google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM=
|
||||||
google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM=
|
google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM=
|
||||||
google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s=
|
google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s=
|
||||||
google.golang.org/genproto v0.0.0-20230706204954-ccb25ca9f130 h1:Au6te5hbKUV8pIYWHqOUZ1pva5qK/rwbIhoXEUB9Lu8=
|
google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 h1:wpZ8pe2x1Q3f2KyT5f8oP/fa9rHAKgFPr/HZdNuS+PQ=
|
||||||
google.golang.org/genproto v0.0.0-20230706204954-ccb25ca9f130/go.mod h1:O9kGHb51iE/nOGvQaDUuadVYqovW56s5emA88lQnj6Y=
|
google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:J7XzRzVy1+IPwWHZUzoD0IccYZIrXILAQpc+Qy9CMhY=
|
||||||
google.golang.org/genproto/googleapis/api v0.0.0-20230629202037-9506855d4529 h1:s5YSX+ZH5b5vS9rnpGymvIyMpLRJizowqDlOuyjXnTk=
|
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 h1:JpwMPBpFN3uKhdaekDpiNlImDdkUAyiJ6ez/uxGaUSo=
|
||||||
google.golang.org/genproto/googleapis/api v0.0.0-20230629202037-9506855d4529/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig=
|
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:0xJLfVdJqpAPl8tDg1ujOCGzx6LFLttXT5NhllGOXY4=
|
||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 h1:bVf09lpb+OJbByTj913DRJioFFAjf/ZGxEz7MajTp2U=
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f h1:ultW7fxlIvee4HYrtnaRPon9HpEgFk5zYpmfMgtKB5I=
|
||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM=
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f/go.mod h1:L9KNLi232K1/xB6f7AlSX692koaRnKaWSR0stBki0Yc=
|
||||||
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.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM=
|
google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM=
|
||||||
@ -1599,8 +1589,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu
|
|||||||
google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
|
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 v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
|
||||||
google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
|
google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
|
||||||
google.golang.org/grpc v1.56.3 h1:8I4C0Yq1EjstUzUJzpcRVbuYA2mODtEmpWiQoN/b2nc=
|
google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk=
|
||||||
google.golang.org/grpc v1.56.3/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s=
|
google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98=
|
||||||
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=
|
||||||
|
|||||||
28
lib/tx.go
28
lib/tx.go
@ -37,7 +37,7 @@ func getAccountNumberAndSequence(clientCtx client.Context) (accountNumber, seque
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func getClientContextAndTxFactory(fromAddress sdk.AccAddress) (clientCtx client.Context, txf tx.Factory, err error) {
|
func getClientContextAndTxFactory(fromAddress sdk.AccAddress, withoutFee bool) (clientCtx client.Context, txf tx.Factory, err error) {
|
||||||
clientCtx = GetConfig().clientCtx
|
clientCtx = GetConfig().clientCtx
|
||||||
// at least we need an account retriever
|
// at least we need an account retriever
|
||||||
// it would be better to check for an empty client context, but that does not work at the moment
|
// it would be better to check for an empty client context, but that does not work at the moment
|
||||||
@ -60,18 +60,22 @@ func getClientContextAndTxFactory(fromAddress sdk.AccAddress) (clientCtx client.
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
txf = getTxFactoryWithAccountNumberAndSequence(clientCtx, accountNumber, sequence)
|
gasPrice := "0.000005"
|
||||||
|
if withoutFee {
|
||||||
|
gasPrice = "0.0"
|
||||||
|
}
|
||||||
|
txf = getTxFactoryWithAccountNumberAndSequence(clientCtx, accountNumber, sequence, gasPrice)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func getTxFactoryWithAccountNumberAndSequence(clientCtx client.Context, accountNumber, sequence uint64) (txf tx.Factory) {
|
func getTxFactoryWithAccountNumberAndSequence(clientCtx client.Context, accountNumber, sequence uint64, gasPrice string) (txf tx.Factory) {
|
||||||
return tx.Factory{}.
|
return tx.Factory{}.
|
||||||
WithAccountNumber(accountNumber).
|
WithAccountNumber(accountNumber).
|
||||||
WithAccountRetriever(clientCtx.AccountRetriever).
|
WithAccountRetriever(clientCtx.AccountRetriever).
|
||||||
WithChainID(clientCtx.ChainID).
|
WithChainID(clientCtx.ChainID).
|
||||||
WithFeeGranter(clientCtx.FeeGranter).
|
WithFeeGranter(clientCtx.FeeGranter).
|
||||||
WithGas(GetConfig().txGas).
|
WithGas(GetConfig().txGas).
|
||||||
WithGasPrices("0.000005" + GetConfig().feeDenom).
|
WithGasPrices(gasPrice + GetConfig().feeDenom).
|
||||||
WithKeybase(clientCtx.Keyring).
|
WithKeybase(clientCtx.Keyring).
|
||||||
WithSequence(sequence).
|
WithSequence(sequence).
|
||||||
WithTxConfig(clientCtx.TxConfig)
|
WithTxConfig(clientCtx.TxConfig)
|
||||||
@ -128,10 +132,21 @@ func getClientContext(fromAddress sdk.AccAddress) (clientCtx client.Context, err
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func isMachineAttestationMsg(msgs ...sdk.Msg) (isMachineAttestation bool) {
|
||||||
|
if len(msgs) != 1 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if sdk.MsgTypeURL(msgs[0]) == "/planetmintgo.machine.MsgAttestMachine" {
|
||||||
|
isMachineAttestation = true
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// BuildUnsignedTx builds a transaction to be signed given a set of messages.
|
// BuildUnsignedTx builds a transaction to be signed given a set of messages.
|
||||||
// Once created, the fee, memo, and messages are set.
|
// Once created, the fee, memo, and messages are set.
|
||||||
func BuildUnsignedTx(fromAddress sdk.AccAddress, msgs ...sdk.Msg) (txJSON string, err error) {
|
func BuildUnsignedTx(fromAddress sdk.AccAddress, msgs ...sdk.Msg) (txJSON string, err error) {
|
||||||
clientCtx, txf, err := getClientContextAndTxFactory(fromAddress)
|
withoutFee := isMachineAttestationMsg(msgs...)
|
||||||
|
clientCtx, txf, err := getClientContextAndTxFactory(fromAddress, withoutFee)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -197,7 +212,8 @@ func BroadcastTxWithFileLock(fromAddress sdk.AccAddress, msgs ...sdk.Msg) (out *
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
// get basic chain information
|
// get basic chain information
|
||||||
clientCtx, txf, err := getClientContextAndTxFactory(fromAddress)
|
withoutFee := isMachineAttestationMsg(msgs...)
|
||||||
|
clientCtx, txf, err := getClientContextAndTxFactory(fromAddress, withoutFee)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
111
monitor/backend.go
Normal file
111
monitor/backend.go
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
package monitor
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"log"
|
||||||
|
"strconv"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/syndtr/goleveldb/leveldb/iterator"
|
||||||
|
)
|
||||||
|
|
||||||
|
type LastSeenEvent struct {
|
||||||
|
Address string `binding:"required" json:"address"`
|
||||||
|
Timestamp int64 `binding:"required" json:"timestamp"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (mms *MqttMonitor) AddParticipant(address string, lastSeenTS int64) (err error) {
|
||||||
|
// store receive address - planetmint address pair
|
||||||
|
var lastSeen LastSeenEvent
|
||||||
|
lastSeen.Address = address
|
||||||
|
lastSeen.Timestamp = lastSeenTS
|
||||||
|
|
||||||
|
lastSeenBytes, err := json.Marshal(lastSeen)
|
||||||
|
if err != nil {
|
||||||
|
log.Println("[app] [Monitor] Error serializing ConversionRequest: " + err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// returns an error if the entry does not exist (we have to increase the counter in this case)
|
||||||
|
_, err = mms.db.Get([]byte(address), nil)
|
||||||
|
if err != nil {
|
||||||
|
mms.setNumDBElements(mms.getNumDBElements() + 1)
|
||||||
|
}
|
||||||
|
mms.dbMutex.Lock()
|
||||||
|
err = mms.db.Put([]byte(address), lastSeenBytes, nil)
|
||||||
|
mms.dbMutex.Unlock()
|
||||||
|
if err != nil {
|
||||||
|
log.Println("[app] [Monitor] error storing addresses in DB: " + err.Error())
|
||||||
|
} else {
|
||||||
|
log.Println("[app] [Monitor] stored address in DB: " + address)
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func (mms *MqttMonitor) deleteEntry(key []byte) (err error) {
|
||||||
|
mms.setNumDBElements(mms.getNumDBElements() - 1)
|
||||||
|
mms.dbMutex.Lock()
|
||||||
|
err = mms.db.Delete(key, nil)
|
||||||
|
mms.dbMutex.Unlock()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func (mms *MqttMonitor) getAmountOfElements() (amount int64, err error) {
|
||||||
|
iter := mms.db.NewIterator(nil, nil)
|
||||||
|
defer iter.Release()
|
||||||
|
|
||||||
|
for iter.Next() {
|
||||||
|
amount++
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check for any errors encountered during iteration
|
||||||
|
if err := iter.Error(); err != nil {
|
||||||
|
log.Println("[app] [Monitor] " + err.Error())
|
||||||
|
} else {
|
||||||
|
log.Println("[app] [Monitor] elements: " + strconv.FormatInt(amount, 10))
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
func (mms *MqttMonitor) getDataFromIter(iter iterator.Iterator) (lastSeen LastSeenEvent, err error) {
|
||||||
|
key := iter.Key()
|
||||||
|
value := iter.Value()
|
||||||
|
err = json.Unmarshal(value, &lastSeen)
|
||||||
|
if err != nil {
|
||||||
|
log.Println("[app] [Monitor] Failed to unmarshal entry: " + string(key) + " - " + err.Error())
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func (mms *MqttMonitor) CleanupDB() {
|
||||||
|
// Create an iterator for the database
|
||||||
|
log.Println("[app] [Monitor] Starting clean-up process")
|
||||||
|
iter := mms.db.NewIterator(nil, nil)
|
||||||
|
defer iter.Release() // Make sure to release the iterator at the end
|
||||||
|
|
||||||
|
// Iterate over all elements in the database
|
||||||
|
for iter.Next() && !mms.IsTerminated() {
|
||||||
|
// Use iter.Key() and iter.Value() to access the key and value
|
||||||
|
lastSeen, err := mms.getDataFromIter(iter)
|
||||||
|
if err != nil {
|
||||||
|
log.Println("[app] [Monitor] Failed to unmarshal entry: " + string(iter.Key()) + " - " + err.Error())
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
timeThreshold := time.Now().Add(-1 * mms.CleanupPeriodicityInMinutes * time.Minute).Unix()
|
||||||
|
if lastSeen.Timestamp <= timeThreshold {
|
||||||
|
// If the entry is older than 12 hours, delete it
|
||||||
|
err := mms.deleteEntry(iter.Key())
|
||||||
|
if err != nil {
|
||||||
|
log.Println("[app] [Monitor] Failed to delete entry: " + err.Error())
|
||||||
|
} else {
|
||||||
|
log.Println("[app] [Monitor] Delete entry: " + string(iter.Key()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check for any errors encountered during iteration
|
||||||
|
if err := iter.Error(); err != nil {
|
||||||
|
log.Println("[app] [Monitor] error during cleanup : " + err.Error())
|
||||||
|
}
|
||||||
|
}
|
||||||
64
monitor/interface.go
Normal file
64
monitor/interface.go
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
package monitor
|
||||||
|
|
||||||
|
import (
|
||||||
|
"sync"
|
||||||
|
|
||||||
|
"github.com/planetmint/planetmint-go/config"
|
||||||
|
"github.com/syndtr/goleveldb/leveldb"
|
||||||
|
)
|
||||||
|
|
||||||
|
type MQTTMonitorClientI interface {
|
||||||
|
AddParticipant(address string, lastSeenTS int64) (err error)
|
||||||
|
SelectPoPParticipantsOutOfActiveActors() (challenger string, challengee string, err error)
|
||||||
|
Start() (err error)
|
||||||
|
}
|
||||||
|
|
||||||
|
var monitorMutex sync.RWMutex
|
||||||
|
var mqttMonitorInstance MQTTMonitorClientI
|
||||||
|
|
||||||
|
func SetMqttMonitorInstance(monitorInstance MQTTMonitorClientI) {
|
||||||
|
monitorMutex.Lock()
|
||||||
|
mqttMonitorInstance = monitorInstance
|
||||||
|
monitorMutex.Unlock()
|
||||||
|
}
|
||||||
|
|
||||||
|
func LazyMqttMonitorLoader(homeDir string) {
|
||||||
|
monitorMutex.RLock()
|
||||||
|
tmpInstance := mqttMonitorInstance
|
||||||
|
monitorMutex.RUnlock()
|
||||||
|
if tmpInstance != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if homeDir == "" {
|
||||||
|
homeDir = "./"
|
||||||
|
}
|
||||||
|
aciveActorsDB, err := leveldb.OpenFile(homeDir+"activeActors.db", nil)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
SetMqttMonitorInstance(NewMqttMonitorService(aciveActorsDB, *config.GetConfig()))
|
||||||
|
err = mqttMonitorInstance.Start()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func SelectPoPParticipantsOutOfActiveActors() (challenger string, challengee string, err error) {
|
||||||
|
monitorMutex.RLock()
|
||||||
|
challenger, challengee, err = mqttMonitorInstance.SelectPoPParticipantsOutOfActiveActors()
|
||||||
|
monitorMutex.RUnlock()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func Start() (err error) {
|
||||||
|
err = mqttMonitorInstance.Start()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func AddParticipant(address string, lastSeenTS int64) (err error) {
|
||||||
|
monitorMutex.RLock()
|
||||||
|
err = mqttMonitorInstance.AddParticipant(address, lastSeenTS)
|
||||||
|
monitorMutex.RUnlock()
|
||||||
|
return
|
||||||
|
}
|
||||||
33
monitor/mocks/mqtt_monitor.go
Normal file
33
monitor/mocks/mqtt_monitor.go
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
package mocks
|
||||||
|
|
||||||
|
import "log"
|
||||||
|
|
||||||
|
// MockMQTTMonitorClientI is a mock of MQTTMonitorClientI interface.
|
||||||
|
type MockMQTTMonitorClientI struct {
|
||||||
|
myStringList []string
|
||||||
|
}
|
||||||
|
|
||||||
|
// AddParticipant mocks base method.
|
||||||
|
func (m *MockMQTTMonitorClientI) AddParticipant(address string, _ int64) error {
|
||||||
|
log.Println("[app] [Monitor] [Mock] added participant: " + address)
|
||||||
|
m.myStringList = append(m.myStringList, address)
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// SelectPoPParticipantsOutOfActiveActors mocks base method.
|
||||||
|
func (m *MockMQTTMonitorClientI) SelectPoPParticipantsOutOfActiveActors() (string, string, error) {
|
||||||
|
var challenger, challengee string
|
||||||
|
amount := len(m.myStringList)
|
||||||
|
if amount >= 2 {
|
||||||
|
challenger = m.myStringList[amount-2]
|
||||||
|
challengee = m.myStringList[amount-1]
|
||||||
|
}
|
||||||
|
log.Println("[app] [Monitor] [Mock] participants: " + challenger + ", " + challengee)
|
||||||
|
return challenger, challengee, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Start mocks base method.
|
||||||
|
func (m *MockMQTTMonitorClientI) Start() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
381
monitor/mqtt_monitor.go
Normal file
381
monitor/mqtt_monitor.go
Normal file
@ -0,0 +1,381 @@
|
|||||||
|
package monitor
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"crypto/tls"
|
||||||
|
"encoding/json"
|
||||||
|
"io"
|
||||||
|
"log"
|
||||||
|
"math/rand"
|
||||||
|
"net"
|
||||||
|
"net/http"
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
"sync"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
mqtt "github.com/eclipse/paho.mqtt.golang"
|
||||||
|
"github.com/planetmint/planetmint-go/config"
|
||||||
|
"github.com/planetmint/planetmint-go/util"
|
||||||
|
"github.com/syndtr/goleveldb/leveldb"
|
||||||
|
)
|
||||||
|
|
||||||
|
var MonitorMQTTClient util.MQTTClientI
|
||||||
|
|
||||||
|
type MqttMonitor struct {
|
||||||
|
db *leveldb.DB
|
||||||
|
dbMutex sync.Mutex // Mutex to synchronize write operations
|
||||||
|
CleanupPeriodicityInMinutes time.Duration
|
||||||
|
config config.Config
|
||||||
|
numberOfElementsMutex sync.RWMutex
|
||||||
|
numberOfElements int64
|
||||||
|
sdkContext *sdk.Context
|
||||||
|
contextMutex sync.Mutex
|
||||||
|
isTerminated bool
|
||||||
|
terminationMutex sync.RWMutex
|
||||||
|
maxRetries time.Duration
|
||||||
|
lostConnection bool
|
||||||
|
lostConnectionMutex sync.Mutex
|
||||||
|
clientMutex sync.Mutex
|
||||||
|
localMqttClient util.MQTTClientI
|
||||||
|
}
|
||||||
|
|
||||||
|
func (mms *MqttMonitor) Terminate() {
|
||||||
|
mms.terminationMutex.Lock()
|
||||||
|
mms.isTerminated = true
|
||||||
|
mms.terminationMutex.Unlock()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (mms *MqttMonitor) IsTerminated() (isTerminated bool) {
|
||||||
|
mms.terminationMutex.RLock()
|
||||||
|
isTerminated = mms.isTerminated
|
||||||
|
mms.terminationMutex.RUnlock()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func (mms *MqttMonitor) getNumDBElements() int64 {
|
||||||
|
mms.numberOfElementsMutex.RLock()
|
||||||
|
defer mms.numberOfElementsMutex.RUnlock()
|
||||||
|
return mms.numberOfElements
|
||||||
|
}
|
||||||
|
|
||||||
|
func (mms *MqttMonitor) setNumDBElements(numElements int64) {
|
||||||
|
mms.numberOfElementsMutex.Lock()
|
||||||
|
defer mms.numberOfElementsMutex.Unlock()
|
||||||
|
mms.numberOfElements = numElements
|
||||||
|
}
|
||||||
|
|
||||||
|
func getClientID() string {
|
||||||
|
conf := config.GetConfig()
|
||||||
|
return "monitor-" + conf.ValidatorAddress
|
||||||
|
}
|
||||||
|
|
||||||
|
func (mms *MqttMonitor) lazyLoadMonitorMQTTClient() util.MQTTClientI {
|
||||||
|
if MonitorMQTTClient != nil {
|
||||||
|
return MonitorMQTTClient
|
||||||
|
}
|
||||||
|
|
||||||
|
conf := config.GetConfig()
|
||||||
|
hostPort := net.JoinHostPort(conf.MqttDomain, strconv.FormatInt(int64(conf.MqttPort), 10))
|
||||||
|
uri := "tcp://" + hostPort
|
||||||
|
if conf.MqttTLS {
|
||||||
|
uri = "ssl://" + hostPort
|
||||||
|
}
|
||||||
|
|
||||||
|
opts := mqtt.NewClientOptions().AddBroker(uri).SetKeepAlive(time.Second * 60).SetCleanSession(true)
|
||||||
|
opts.SetClientID(getClientID())
|
||||||
|
opts.SetUsername(conf.MqttUser)
|
||||||
|
opts.SetPassword(conf.MqttPassword)
|
||||||
|
opts.SetConnectionLostHandler(mms.onConnectionLost)
|
||||||
|
if conf.MqttTLS {
|
||||||
|
tlsConfig := &tls.Config{}
|
||||||
|
opts.SetTLSConfig(tlsConfig)
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Println("[app] [Monitor] create new client")
|
||||||
|
client := mqtt.NewClient(opts)
|
||||||
|
return client
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewMqttMonitorService(db *leveldb.DB, config config.Config) *MqttMonitor {
|
||||||
|
service := &MqttMonitor{db: db, config: config, numberOfElements: 0, CleanupPeriodicityInMinutes: 10}
|
||||||
|
return service
|
||||||
|
}
|
||||||
|
|
||||||
|
func (mms *MqttMonitor) runPeriodicTasks() {
|
||||||
|
tickerRestablishConnection := time.NewTicker(2 * time.Minute)
|
||||||
|
tickerCleanup := time.NewTicker(5 * time.Minute)
|
||||||
|
defer tickerRestablishConnection.Stop()
|
||||||
|
defer tickerCleanup.Stop()
|
||||||
|
|
||||||
|
for !mms.IsTerminated() {
|
||||||
|
select {
|
||||||
|
case <-tickerRestablishConnection.C:
|
||||||
|
go mms.MonitorActiveParticipants()
|
||||||
|
case <-tickerCleanup.C:
|
||||||
|
go mms.CleanupDB()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (mms *MqttMonitor) Start() (err error) {
|
||||||
|
amount, err := mms.getAmountOfElements()
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
mms.setNumDBElements(amount)
|
||||||
|
go mms.runPeriodicTasks()
|
||||||
|
go mms.MonitorActiveParticipants()
|
||||||
|
go mms.CleanupDB()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
func (mms *MqttMonitor) getRandomNumbers() (challenger int, challengee int) {
|
||||||
|
for challenger == challengee {
|
||||||
|
// Generate random numbers
|
||||||
|
numElements := int(mms.getNumDBElements())
|
||||||
|
challenger = rand.Intn(numElements)
|
||||||
|
challengee = rand.Intn(numElements)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
func (mms *MqttMonitor) SelectPoPParticipantsOutOfActiveActors() (challenger string, challengee string, err error) {
|
||||||
|
numElements := int(mms.getNumDBElements())
|
||||||
|
if numElements < 2 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
randomChallenger, randomChallengee := mms.getRandomNumbers()
|
||||||
|
log.Println("[app] [Monitor] number of elements: " + strconv.Itoa(numElements))
|
||||||
|
log.Println("[app] [Monitor] selected IDs: " + strconv.Itoa(randomChallenger) + " " + strconv.Itoa(randomChallengee))
|
||||||
|
iter := mms.db.NewIterator(nil, nil)
|
||||||
|
defer iter.Release()
|
||||||
|
count := 0
|
||||||
|
found := 0
|
||||||
|
var lastSeen LastSeenEvent
|
||||||
|
for iter.Next() {
|
||||||
|
if count == randomChallenger {
|
||||||
|
lastSeen, err = mms.getDataFromIter(iter)
|
||||||
|
if err != nil {
|
||||||
|
log.Println("[app] [Monitor] could not get Data from ID" + strconv.Itoa(randomChallenger))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
challenger = lastSeen.Address
|
||||||
|
found++
|
||||||
|
} else if count == randomChallengee {
|
||||||
|
lastSeen, err = mms.getDataFromIter(iter)
|
||||||
|
if err != nil {
|
||||||
|
log.Println("[app] [Monitor] could not get Data from ID" + strconv.Itoa(randomChallengee))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
challengee = lastSeen.Address
|
||||||
|
found++
|
||||||
|
}
|
||||||
|
|
||||||
|
count++
|
||||||
|
if found == 2 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
log.Println("[app] [Monitor] challenger, challengee: " + challenger + " " + challengee)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func (mms *MqttMonitor) MqttMsgHandler(_ mqtt.Client, msg mqtt.Message) {
|
||||||
|
if mms.IsTerminated() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
topicParts := strings.Split(msg.Topic(), "/")
|
||||||
|
if len(topicParts) != 3 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if topicParts[0] != "tele" {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if topicParts[2] != "STATE" {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
address := topicParts[1]
|
||||||
|
valid, err := util.IsValidAddress(address)
|
||||||
|
if err != nil || !valid {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
active, err := IsLegitMachineAddress(address)
|
||||||
|
if err != nil || !active {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
unixTime := time.Now().Unix()
|
||||||
|
err = mms.AddParticipant(address, unixTime)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
log.Println("[app] [Monitor] error adding active actor to DB: " + address + " " + err.Error())
|
||||||
|
} else {
|
||||||
|
log.Println("[app] [Monitor] added active actor to DB: " + address)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func IsLegitMachineAddress(address string) (active bool, err error) {
|
||||||
|
url := "http://localhost:1317/planetmint/machine/address/" + address
|
||||||
|
|
||||||
|
// Create a new HTTP client
|
||||||
|
client := &http.Client{}
|
||||||
|
|
||||||
|
// Create a new request
|
||||||
|
ctx := context.Background()
|
||||||
|
req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Println("[app] [Monitor] cannot send machine query request " + err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set the header
|
||||||
|
req.Header.Set("Accept", "application/json")
|
||||||
|
|
||||||
|
// Send the request
|
||||||
|
resp, err := client.Do(req)
|
||||||
|
if err != nil {
|
||||||
|
log.Println("[app] [Monitor] cannot connect to server: " + err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Close the response body
|
||||||
|
defer resp.Body.Close()
|
||||||
|
|
||||||
|
// Read the response body
|
||||||
|
body, err := io.ReadAll(resp.Body)
|
||||||
|
if err != nil {
|
||||||
|
log.Println("[app] [Monitor] cannot read response: " + err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check the status code
|
||||||
|
if resp.StatusCode != http.StatusOK {
|
||||||
|
log.Printf("[app] [Monitor] Error: unexpected status code: " + string(body))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Unmarshal the response body into a map
|
||||||
|
var data map[string]interface{}
|
||||||
|
err = json.Unmarshal(body, &data)
|
||||||
|
if err != nil {
|
||||||
|
log.Println("[app] [Monitor] cannot unmarshal response " + err.Error())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if the "info" key exists
|
||||||
|
machineValue, ok := data["machine"]
|
||||||
|
if !ok {
|
||||||
|
log.Println("[app] [Monitor] response does not contain the required machine")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
machineMap, ok := machineValue.(map[string]interface{})
|
||||||
|
if !ok {
|
||||||
|
log.Println("[app] [Monitor] cannot convert machine map")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
addressMap, ok := machineMap["address"]
|
||||||
|
if !ok {
|
||||||
|
log.Println("[app] [Monitor] response does not contain the required name")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
value, ok := addressMap.(string)
|
||||||
|
if !ok || value != address {
|
||||||
|
log.Println("[app] [Monitor] return machine is not the required one")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
err = nil
|
||||||
|
active = true
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func (mms *MqttMonitor) onConnectionLost(_ mqtt.Client, err error) {
|
||||||
|
log.Println("[app] [Monitor] Connection lost: " + err.Error())
|
||||||
|
// Handle connection loss here (e.g., reconnect attempts, logging)
|
||||||
|
if !mms.IsTerminated() {
|
||||||
|
mms.lostConnectionMutex.Lock()
|
||||||
|
mms.lostConnection = true
|
||||||
|
mms.lostConnectionMutex.Unlock()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (mms *MqttMonitor) MonitorActiveParticipants() {
|
||||||
|
mms.clientMutex.Lock()
|
||||||
|
if mms.localMqttClient != nil {
|
||||||
|
log.Println("[app] [Monitor] client is still working")
|
||||||
|
mms.clientMutex.Unlock()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
mms.localMqttClient = mms.lazyLoadMonitorMQTTClient()
|
||||||
|
mqttClient := mms.localMqttClient
|
||||||
|
mms.clientMutex.Unlock()
|
||||||
|
|
||||||
|
// Maximum reconnection attempts (adjust as needed)
|
||||||
|
mms.SetMaxRetries()
|
||||||
|
for !mms.IsTerminated() && mms.maxRetries > 0 {
|
||||||
|
if token := mqttClient.Connect(); token.Wait() && token.Error() != nil {
|
||||||
|
log.Println("[app] [Monitor] error connecting to mqtt: " + token.Error().Error())
|
||||||
|
mms.maxRetries--
|
||||||
|
time.Sleep(time.Second * 5)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
mms.lostConnectionMutex.Lock()
|
||||||
|
mms.lostConnection = false
|
||||||
|
mms.lostConnectionMutex.Unlock()
|
||||||
|
|
||||||
|
log.Println("[app] [Monitor] established connection")
|
||||||
|
|
||||||
|
var messageHandler mqtt.MessageHandler = mms.MqttMsgHandler
|
||||||
|
|
||||||
|
// Subscribe to a topic
|
||||||
|
subscriptionTopic := "tele/#"
|
||||||
|
if token := mqttClient.Subscribe(subscriptionTopic, 0, messageHandler); token.Wait() && token.Error() != nil {
|
||||||
|
log.Println("[app] [Monitor] error registering the mqtt subscription: " + token.Error().Error())
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
log.Println("[app] [Monitor] subscribed to tele/# channels")
|
||||||
|
|
||||||
|
for !mms.IsTerminated() {
|
||||||
|
mms.lostConnectionMutex.Lock()
|
||||||
|
lostConnectionEvent := mms.lostConnection
|
||||||
|
mms.lostConnectionMutex.Unlock()
|
||||||
|
if !mqttClient.IsConnected() || !mqttClient.IsConnectionOpen() || lostConnectionEvent {
|
||||||
|
log.Println("[app] [Monitor] retry establishing a connection")
|
||||||
|
break // Exit inner loop on disconnect
|
||||||
|
}
|
||||||
|
|
||||||
|
SendUpdateMessage(mqttClient)
|
||||||
|
mms.SetMaxRetries()
|
||||||
|
time.Sleep(60 * time.Second) // Adjust sleep time based on your needs
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if mms.maxRetries == 0 {
|
||||||
|
log.Println("[app] [Monitor] Reached maximum reconnection attempts. Exiting. New client will be activated soon.")
|
||||||
|
}
|
||||||
|
|
||||||
|
mms.clientMutex.Lock()
|
||||||
|
mms.localMqttClient = nil
|
||||||
|
mms.clientMutex.Unlock()
|
||||||
|
}
|
||||||
|
|
||||||
|
func SendUpdateMessage(mqttClient util.MQTTClientI) {
|
||||||
|
// Publish message
|
||||||
|
now := time.Now().Format("2006-01-02 15:04:05") // Adjust format as needed
|
||||||
|
token := mqttClient.Publish("tele/"+getClientID(), 1, false, now)
|
||||||
|
token.Wait()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (mms *MqttMonitor) SetMaxRetries() {
|
||||||
|
mms.maxRetries = 5
|
||||||
|
}
|
||||||
|
|
||||||
|
func (mms *MqttMonitor) Log(msg string) {
|
||||||
|
mms.contextMutex.Lock()
|
||||||
|
localContext := mms.sdkContext
|
||||||
|
mms.contextMutex.Unlock()
|
||||||
|
if localContext != nil {
|
||||||
|
util.GetAppLogger().Info(*localContext, msg)
|
||||||
|
}
|
||||||
|
}
|
||||||
108
monitor/mqtt_monitor_test.go
Normal file
108
monitor/mqtt_monitor_test.go
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
package monitor_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/planetmint/planetmint-go/config"
|
||||||
|
"github.com/planetmint/planetmint-go/monitor"
|
||||||
|
"github.com/planetmint/planetmint-go/util/mocks"
|
||||||
|
"github.com/stretchr/testify/assert"
|
||||||
|
"github.com/syndtr/goleveldb/leveldb"
|
||||||
|
"github.com/syndtr/goleveldb/leveldb/storage"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
// Use MQTT mock client
|
||||||
|
monitor.MonitorMQTTClient = &mocks.MockMQTTClient{}
|
||||||
|
}
|
||||||
|
|
||||||
|
const (
|
||||||
|
challengerInput = "plmnt1fx3x6u8k5q8kjl7pamsuwjtut8nkks8dk92dek"
|
||||||
|
challengeeInput = "plmnt1fsaljz3xqf6vchkjxfzfrd30cdp3j4vqh298pr"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestGMonitorActiveParticipants(t *testing.T) {
|
||||||
|
cfg := config.GetConfig()
|
||||||
|
db, err := leveldb.Open(storage.NewMemStorage(), nil)
|
||||||
|
assert.NoError(t, err)
|
||||||
|
defer db.Close()
|
||||||
|
|
||||||
|
mqttMonitor := monitor.NewMqttMonitorService(db, *cfg)
|
||||||
|
err = mqttMonitor.Start()
|
||||||
|
assert.NoError(t, err)
|
||||||
|
|
||||||
|
currentTime := time.Now()
|
||||||
|
unixTime := currentTime.Unix()
|
||||||
|
err = mqttMonitor.AddParticipant(challengerInput, unixTime)
|
||||||
|
assert.NoError(t, err)
|
||||||
|
err = mqttMonitor.AddParticipant(challengeeInput, unixTime)
|
||||||
|
assert.NoError(t, err)
|
||||||
|
mqttMonitor.CleanupDB()
|
||||||
|
|
||||||
|
challenger, challengee, err := mqttMonitor.SelectPoPParticipantsOutOfActiveActors()
|
||||||
|
assert.NoError(t, err)
|
||||||
|
assert.Contains(t, challenger, "plmnt")
|
||||||
|
assert.Contains(t, challengee, "plmnt")
|
||||||
|
mqttMonitor.Terminate()
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestCleanupRemoval(t *testing.T) {
|
||||||
|
cfg := config.GetConfig()
|
||||||
|
db, err := leveldb.Open(storage.NewMemStorage(), nil)
|
||||||
|
assert.NoError(t, err)
|
||||||
|
defer db.Close()
|
||||||
|
|
||||||
|
mqttMonitor := monitor.NewMqttMonitorService(db, *cfg)
|
||||||
|
err = mqttMonitor.Start()
|
||||||
|
assert.NoError(t, err)
|
||||||
|
|
||||||
|
currentTime := time.Now()
|
||||||
|
CleanupPeriodicityAgo := currentTime.Add(-1 * mqttMonitor.CleanupPeriodicityInMinutes * time.Minute)
|
||||||
|
unixTimeNow := currentTime.Unix()
|
||||||
|
err = mqttMonitor.AddParticipant(challengerInput, unixTimeNow)
|
||||||
|
assert.NoError(t, err)
|
||||||
|
err = mqttMonitor.AddParticipant(challengeeInput, CleanupPeriodicityAgo.Unix()-1)
|
||||||
|
assert.NoError(t, err)
|
||||||
|
mqttMonitor.CleanupDB()
|
||||||
|
|
||||||
|
challenger, challengee, err := mqttMonitor.SelectPoPParticipantsOutOfActiveActors()
|
||||||
|
assert.NoError(t, err)
|
||||||
|
assert.Equal(t, "", challenger)
|
||||||
|
assert.Contains(t, "", challengee)
|
||||||
|
mqttMonitor.Terminate()
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestCleanupPrecisionTest(t *testing.T) {
|
||||||
|
cfg := config.GetConfig()
|
||||||
|
db, err := leveldb.Open(storage.NewMemStorage(), nil)
|
||||||
|
assert.NoError(t, err)
|
||||||
|
defer db.Close()
|
||||||
|
|
||||||
|
mqttMonitor := monitor.NewMqttMonitorService(db, *cfg)
|
||||||
|
err = mqttMonitor.Start()
|
||||||
|
assert.NoError(t, err)
|
||||||
|
|
||||||
|
currentTime := time.Now()
|
||||||
|
CleanupThresholdAgo := currentTime.Add(-1 * mqttMonitor.CleanupPeriodicityInMinutes * time.Minute)
|
||||||
|
aboveThreshold := CleanupThresholdAgo.Unix() + 10
|
||||||
|
unixTimeNow := currentTime.Unix()
|
||||||
|
err = mqttMonitor.AddParticipant(challengerInput, unixTimeNow)
|
||||||
|
assert.NoError(t, err)
|
||||||
|
err = mqttMonitor.AddParticipant(challengeeInput, aboveThreshold)
|
||||||
|
assert.NoError(t, err)
|
||||||
|
mqttMonitor.CleanupDB()
|
||||||
|
|
||||||
|
challenger, challengee, err := mqttMonitor.SelectPoPParticipantsOutOfActiveActors()
|
||||||
|
assert.NoError(t, err)
|
||||||
|
assert.Contains(t, challenger, "plmnt")
|
||||||
|
assert.Contains(t, challengee, "plmnt")
|
||||||
|
mqttMonitor.Terminate()
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestIsLegitMachineAddress(t *testing.T) {
|
||||||
|
t.SkipNow()
|
||||||
|
active, err := monitor.IsLegitMachineAddress("plmnt1z6xmwqfnn9mvean9gsd57segawgjykpxw8hq5t")
|
||||||
|
assert.NoError(t, err)
|
||||||
|
assert.Equal(t, active, true)
|
||||||
|
}
|
||||||
@ -1,8 +0,0 @@
|
|||||||
syntax = "proto3";
|
|
||||||
package planetmintgo.asset;
|
|
||||||
|
|
||||||
option go_package = "github.com/planetmint/planetmint-go/x/asset/types";
|
|
||||||
|
|
||||||
message Asset {
|
|
||||||
string cid = 1;
|
|
||||||
}
|
|
||||||
@ -20,7 +20,7 @@ service Query {
|
|||||||
|
|
||||||
// Queries a list of GetCIDsByAddress items.
|
// Queries a list of GetCIDsByAddress items.
|
||||||
rpc GetCIDsByAddress (QueryGetCIDsByAddressRequest) returns (QueryGetCIDsByAddressResponse) {
|
rpc GetCIDsByAddress (QueryGetCIDsByAddressRequest) returns (QueryGetCIDsByAddressResponse) {
|
||||||
option (google.api.http).get = "/planetmint/asset/address/{address}/{lookupPeriodInMin}";
|
option (google.api.http).get = "/planetmint/asset/address/{address}/{numElements}";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ message QueryParamsResponse {
|
|||||||
|
|
||||||
message QueryGetCIDsByAddressRequest {
|
message QueryGetCIDsByAddressRequest {
|
||||||
string address = 1;
|
string address = 1;
|
||||||
uint64 lookupPeriodInMin = 2;
|
uint64 numElements = 2;
|
||||||
cosmos.base.query.v1beta1.PageRequest pagination = 3;
|
cosmos.base.query.v1beta1.PageRequest pagination = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -108,7 +108,6 @@ message MsgInitPopResponse {}
|
|||||||
message MsgCreateRedeemClaim {
|
message MsgCreateRedeemClaim {
|
||||||
string creator = 1;
|
string creator = 1;
|
||||||
string beneficiary = 2;
|
string beneficiary = 2;
|
||||||
uint64 amount = 3;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message MsgCreateRedeemClaimResponse {}
|
message MsgCreateRedeemClaimResponse {}
|
||||||
|
|||||||
@ -11,4 +11,6 @@ message Params {
|
|||||||
string asset_registry_scheme =1;
|
string asset_registry_scheme =1;
|
||||||
string asset_registry_domain =2;
|
string asset_registry_domain =2;
|
||||||
string asset_registry_path =3;
|
string asset_registry_path =3;
|
||||||
|
uint64 dao_machine_funding_amount = 4;
|
||||||
|
string dao_machine_funding_denom = 5;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -120,6 +120,7 @@ func (s *E2ETestSuite) TestMintToken() {
|
|||||||
out, err := e2etestutil.BuildSignBroadcastTx(s.T(), val.Address, msg1)
|
out, err := e2etestutil.BuildSignBroadcastTx(s.T(), val.Address, msg1)
|
||||||
s.Require().NoError(err)
|
s.Require().NoError(err)
|
||||||
|
|
||||||
|
s.Require().NoError(s.network.WaitForNextBlock())
|
||||||
s.Require().NoError(s.network.WaitForNextBlock())
|
s.Require().NoError(s.network.WaitForNextBlock())
|
||||||
rawLog, err := clitestutil.GetRawLogFromTxOut(val, out)
|
rawLog, err := clitestutil.GetRawLogFromTxOut(val, out)
|
||||||
s.Require().NoError(err)
|
s.Require().NoError(err)
|
||||||
|
|||||||
@ -109,6 +109,7 @@ func (s *ConsumptionE2ETestSuite) TestValidatorConsumption() {
|
|||||||
out, err := lib.BroadcastTxWithFileLock(val.Address, msgs...)
|
out, err := lib.BroadcastTxWithFileLock(val.Address, msgs...)
|
||||||
s.Require().NoError(err)
|
s.Require().NoError(err)
|
||||||
|
|
||||||
|
s.Require().NoError(s.network.WaitForNextBlock())
|
||||||
s.Require().NoError(s.network.WaitForNextBlock())
|
s.Require().NoError(s.network.WaitForNextBlock())
|
||||||
|
|
||||||
_, err = clitestutil.GetRawLogFromTxOut(val, out)
|
_, err = clitestutil.GetRawLogFromTxOut(val, out)
|
||||||
@ -132,6 +133,7 @@ func (s *ConsumptionE2ETestSuite) TestNonValidatorConsumptionOverflow() {
|
|||||||
out, err := lib.BroadcastTxWithFileLock(addr, msgs...)
|
out, err := lib.BroadcastTxWithFileLock(addr, msgs...)
|
||||||
s.Require().NoError(err)
|
s.Require().NoError(err)
|
||||||
|
|
||||||
|
s.Require().NoError(s.network.WaitForNextBlock())
|
||||||
s.Require().NoError(s.network.WaitForNextBlock())
|
s.Require().NoError(s.network.WaitForNextBlock())
|
||||||
|
|
||||||
_, err = clitestutil.GetRawLogFromTxOut(val, out)
|
_, err = clitestutil.GetRawLogFromTxOut(val, out)
|
||||||
|
|||||||
@ -7,11 +7,13 @@ import (
|
|||||||
"math"
|
"math"
|
||||||
"os"
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/cosmos/cosmos-sdk/crypto/keyring"
|
"github.com/cosmos/cosmos-sdk/crypto/keyring"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
bank "github.com/cosmos/cosmos-sdk/x/bank/client/cli"
|
bank "github.com/cosmos/cosmos-sdk/x/bank/client/cli"
|
||||||
"github.com/planetmint/planetmint-go/lib"
|
"github.com/planetmint/planetmint-go/lib"
|
||||||
|
"github.com/planetmint/planetmint-go/monitor"
|
||||||
"github.com/planetmint/planetmint-go/testutil"
|
"github.com/planetmint/planetmint-go/testutil"
|
||||||
clitestutil "github.com/planetmint/planetmint-go/testutil/cli"
|
clitestutil "github.com/planetmint/planetmint-go/testutil/cli"
|
||||||
e2etestutil "github.com/planetmint/planetmint-go/testutil/e2e"
|
e2etestutil "github.com/planetmint/planetmint-go/testutil/e2e"
|
||||||
@ -162,7 +164,9 @@ func (s *SelectionE2ETestSuite) TestPopSelectionNoActors() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *SelectionE2ETestSuite) TestPopSelectionOneActors() {
|
func (s *SelectionE2ETestSuite) TestPopSelectionOneActors() {
|
||||||
err := e2etestutil.AttestMachine(s.network, machines[0].name, machines[0].mnemonic, 0, s.feeDenom)
|
err := monitor.AddParticipant(machines[0].address, time.Now().Unix())
|
||||||
|
s.Require().NoError(err)
|
||||||
|
err = e2etestutil.AttestMachine(s.network, machines[0].name, machines[0].mnemonic, 0, s.feeDenom)
|
||||||
s.Require().NoError(err)
|
s.Require().NoError(err)
|
||||||
|
|
||||||
out := s.perpareLocalTest()
|
out := s.perpareLocalTest()
|
||||||
@ -172,7 +176,9 @@ func (s *SelectionE2ETestSuite) TestPopSelectionOneActors() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *SelectionE2ETestSuite) TestPopSelectionTwoActors() {
|
func (s *SelectionE2ETestSuite) TestPopSelectionTwoActors() {
|
||||||
err := e2etestutil.AttestMachine(s.network, machines[1].name, machines[1].mnemonic, 1, s.feeDenom)
|
err := monitor.AddParticipant(machines[1].address, time.Now().Unix())
|
||||||
|
s.Require().NoError(err)
|
||||||
|
err = e2etestutil.AttestMachine(s.network, machines[1].name, machines[1].mnemonic, 1, s.feeDenom)
|
||||||
s.Require().NoError(err)
|
s.Require().NoError(err)
|
||||||
|
|
||||||
out := s.perpareLocalTest()
|
out := s.perpareLocalTest()
|
||||||
@ -258,7 +264,7 @@ func (s *SelectionE2ETestSuite) TestTokenRedeemClaim() {
|
|||||||
addr, _ := k.GetAddress()
|
addr, _ := k.GetAddress()
|
||||||
|
|
||||||
// Addr sends CreateRedeemClaim => accepted query redeem claim
|
// Addr sends CreateRedeemClaim => accepted query redeem claim
|
||||||
createClaimMsg := daotypes.NewMsgCreateRedeemClaim(addr.String(), "liquidAddress", 10000)
|
createClaimMsg := daotypes.NewMsgCreateRedeemClaim(addr.String(), "liquidAddress")
|
||||||
out, err := lib.BroadcastTxWithFileLock(addr, createClaimMsg)
|
out, err := lib.BroadcastTxWithFileLock(addr, createClaimMsg)
|
||||||
s.Require().NoError(err)
|
s.Require().NoError(err)
|
||||||
|
|
||||||
@ -275,7 +281,7 @@ func (s *SelectionE2ETestSuite) TestTokenRedeemClaim() {
|
|||||||
fmt.Sprintf(s.errormsg, bank.FlagDenom, s.claimDenom),
|
fmt.Sprintf(s.errormsg, bank.FlagDenom, s.claimDenom),
|
||||||
})
|
})
|
||||||
s.Require().NoError(err)
|
s.Require().NoError(err)
|
||||||
assert.Equal(s.T(), "amount: \"5993140682\"\ndenom: crddl\n", balanceOut.String()) // 3 * 1997716894 - 10000 = 5993140682
|
assert.Equal(s.T(), "amount: \"0\"\ndenom: crddl\n", balanceOut.String()) // consumes all claims
|
||||||
|
|
||||||
// Addr sends ConfirmRedeemClaim => rejected not claim address
|
// Addr sends ConfirmRedeemClaim => rejected not claim address
|
||||||
confirmMsg := daotypes.NewMsgConfirmRedeemClaim(addr.String(), 0, "liquidAddress")
|
confirmMsg := daotypes.NewMsgConfirmRedeemClaim(addr.String(), 0, "liquidAddress")
|
||||||
@ -283,6 +289,8 @@ func (s *SelectionE2ETestSuite) TestTokenRedeemClaim() {
|
|||||||
s.Require().NoError(err)
|
s.Require().NoError(err)
|
||||||
|
|
||||||
s.Require().NoError(s.network.WaitForNextBlock())
|
s.Require().NoError(s.network.WaitForNextBlock())
|
||||||
|
s.Require().NoError(s.network.WaitForNextBlock()) // added another waiting block to pass CI test cases (they are a bit slower)
|
||||||
|
|
||||||
_, err = clitestutil.GetRawLogFromTxOut(val, out)
|
_, err = clitestutil.GetRawLogFromTxOut(val, out)
|
||||||
s.Require().ErrorContains(err, "failed to execute message; message index: 0: expected: plmnt19cl05ztgt8ey6v86hjjjn3thfmpu6q2xtveehc; got: plmnt1kp93kns6hs2066d8qw0uz84fw3vlthewt2ck6p: invalid claim address")
|
s.Require().ErrorContains(err, "failed to execute message; message index: 0: expected: plmnt19cl05ztgt8ey6v86hjjjn3thfmpu6q2xtveehc; got: plmnt1kp93kns6hs2066d8qw0uz84fw3vlthewt2ck6p: invalid claim address")
|
||||||
|
|
||||||
@ -302,11 +310,11 @@ func (s *SelectionE2ETestSuite) TestTokenRedeemClaim() {
|
|||||||
// QueryRedeemClaim
|
// QueryRedeemClaim
|
||||||
qOut, err := clitestutil.ExecTestCLICmd(val.ClientCtx, daocli.CmdShowRedeemClaim(), []string{"liquidAddress", "0"})
|
qOut, err := clitestutil.ExecTestCLICmd(val.ClientCtx, daocli.CmdShowRedeemClaim(), []string{"liquidAddress", "0"})
|
||||||
s.Require().NoError(err)
|
s.Require().NoError(err)
|
||||||
assert.Equal(s.T(), "redeemClaim:\n amount: \"10000\"\n beneficiary: liquidAddress\n confirmed: true\n creator: plmnt1kp93kns6hs2066d8qw0uz84fw3vlthewt2ck6p\n id: \"0\"\n liquidTxHash: \"0000000000000000000000000000000000000000000000000000000000000000\"\n", qOut.String())
|
assert.Equal(s.T(), "redeemClaim:\n amount: \"5993150682\"\n beneficiary: liquidAddress\n confirmed: true\n creator: plmnt1kp93kns6hs2066d8qw0uz84fw3vlthewt2ck6p\n id: \"0\"\n liquidTxHash: \"0000000000000000000000000000000000000000000000000000000000000000\"\n", qOut.String())
|
||||||
|
|
||||||
qOut, err = clitestutil.ExecTestCLICmd(val.ClientCtx, daocli.CmdRedeemClaimByLiquidTxHash(), []string{"0000000000000000000000000000000000000000000000000000000000000000"})
|
qOut, err = clitestutil.ExecTestCLICmd(val.ClientCtx, daocli.CmdRedeemClaimByLiquidTxHash(), []string{"0000000000000000000000000000000000000000000000000000000000000000"})
|
||||||
s.Require().NoError(err)
|
s.Require().NoError(err)
|
||||||
assert.Equal(s.T(), "redeemClaim:\n amount: \"10000\"\n beneficiary: liquidAddress\n confirmed: true\n creator: plmnt1kp93kns6hs2066d8qw0uz84fw3vlthewt2ck6p\n id: \"0\"\n liquidTxHash: \"0000000000000000000000000000000000000000000000000000000000000000\"\n", qOut.String())
|
assert.Equal(s.T(), "redeemClaim:\n amount: \"5993150682\"\n beneficiary: liquidAddress\n confirmed: true\n creator: plmnt1kp93kns6hs2066d8qw0uz84fw3vlthewt2ck6p\n id: \"0\"\n liquidTxHash: \"0000000000000000000000000000000000000000000000000000000000000000\"\n", qOut.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *SelectionE2ETestSuite) createValAccount(cfg network.Config) (address sdk.AccAddress, err error) {
|
func (s *SelectionE2ETestSuite) createValAccount(cfg network.Config) (address sdk.AccAddress, err error) {
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
package machine
|
package machine
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
|
|
||||||
"github.com/planetmint/planetmint-go/lib"
|
"github.com/planetmint/planetmint-go/lib"
|
||||||
clitestutil "github.com/planetmint/planetmint-go/testutil/cli"
|
clitestutil "github.com/planetmint/planetmint-go/testutil/cli"
|
||||||
"github.com/planetmint/planetmint-go/testutil/network"
|
"github.com/planetmint/planetmint-go/testutil/network"
|
||||||
@ -11,6 +13,8 @@ import (
|
|||||||
"github.com/cosmos/cosmos-sdk/crypto/hd"
|
"github.com/cosmos/cosmos-sdk/crypto/hd"
|
||||||
"github.com/cosmos/cosmos-sdk/crypto/keyring"
|
"github.com/cosmos/cosmos-sdk/crypto/keyring"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
txcli "github.com/cosmos/cosmos-sdk/x/auth/tx"
|
||||||
|
bank "github.com/cosmos/cosmos-sdk/x/bank/client/cli"
|
||||||
"github.com/cosmos/cosmos-sdk/x/feegrant"
|
"github.com/cosmos/cosmos-sdk/x/feegrant"
|
||||||
e2etestutil "github.com/planetmint/planetmint-go/testutil/e2e"
|
e2etestutil "github.com/planetmint/planetmint-go/testutil/e2e"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
@ -64,6 +68,7 @@ func (s *E2ETestSuite) TestAttestMachine() {
|
|||||||
out, err := e2etestutil.BuildSignBroadcastTx(s.T(), val.Address, msg1)
|
out, err := e2etestutil.BuildSignBroadcastTx(s.T(), val.Address, msg1)
|
||||||
s.Require().NoError(err)
|
s.Require().NoError(err)
|
||||||
|
|
||||||
|
s.Require().NoError(s.network.WaitForNextBlock())
|
||||||
s.Require().NoError(s.network.WaitForNextBlock())
|
s.Require().NoError(s.network.WaitForNextBlock())
|
||||||
rawLog, err := clitestutil.GetRawLogFromTxOut(val, out)
|
rawLog, err := clitestutil.GetRawLogFromTxOut(val, out)
|
||||||
s.Require().NoError(err)
|
s.Require().NoError(err)
|
||||||
@ -74,6 +79,18 @@ func (s *E2ETestSuite) TestAttestMachine() {
|
|||||||
s.Require().NoError(err)
|
s.Require().NoError(err)
|
||||||
addr, _ := k.GetAddress()
|
addr, _ := k.GetAddress()
|
||||||
|
|
||||||
|
// Check preAttestationBalance in order to verify that it doesn't change after machine attestation
|
||||||
|
preAttestationBalanceOutput, err := clitestutil.ExecTestCLICmd(val.ClientCtx, bank.GetBalancesCmd(), []string{
|
||||||
|
addr.String(),
|
||||||
|
})
|
||||||
|
s.Require().NoError(err)
|
||||||
|
preAttestationBalance, ok := preAttestationBalanceOutput.(*bytes.Buffer)
|
||||||
|
if !ok {
|
||||||
|
err = lib.ErrTypeAssertionFailed
|
||||||
|
s.Require().NoError(err)
|
||||||
|
}
|
||||||
|
assert.Contains(s.T(), preAttestationBalance.String(), "10000")
|
||||||
|
|
||||||
machine := moduleobject.Machine(sample.Name, pubKey, prvKey, addr.String())
|
machine := moduleobject.Machine(sample.Name, pubKey, prvKey, addr.String())
|
||||||
msg2 := machinetypes.NewMsgAttestMachine(addr.String(), &machine)
|
msg2 := machinetypes.NewMsgAttestMachine(addr.String(), &machine)
|
||||||
out, err = e2etestutil.BuildSignBroadcastTx(s.T(), addr, msg2)
|
out, err = e2etestutil.BuildSignBroadcastTx(s.T(), addr, msg2)
|
||||||
@ -83,6 +100,7 @@ func (s *E2ETestSuite) TestAttestMachine() {
|
|||||||
s.Require().NoError(s.network.WaitForNextBlock())
|
s.Require().NoError(s.network.WaitForNextBlock())
|
||||||
s.Require().NoError(s.network.WaitForNextBlock())
|
s.Require().NoError(s.network.WaitForNextBlock())
|
||||||
s.Require().NoError(s.network.WaitForNextBlock())
|
s.Require().NoError(s.network.WaitForNextBlock())
|
||||||
|
s.Require().NoError(s.network.WaitForNextBlock())
|
||||||
|
|
||||||
rawLog, err = clitestutil.GetRawLogFromTxOut(val, out)
|
rawLog, err = clitestutil.GetRawLogFromTxOut(val, out)
|
||||||
s.Require().NoError(err)
|
s.Require().NoError(err)
|
||||||
@ -95,6 +113,26 @@ func (s *E2ETestSuite) TestAttestMachine() {
|
|||||||
|
|
||||||
_, err = clitestutil.ExecTestCLICmd(val.ClientCtx, machinecli.CmdGetMachineByPublicKey(), args)
|
_, err = clitestutil.ExecTestCLICmd(val.ClientCtx, machinecli.CmdGetMachineByPublicKey(), args)
|
||||||
s.Require().NoError(err)
|
s.Require().NoError(err)
|
||||||
|
txResponse, err := lib.GetTxResponseFromOut(out)
|
||||||
|
s.Require().NoError(err)
|
||||||
|
|
||||||
|
txResp, err := txcli.QueryTx(val.ClientCtx, txResponse.TxHash)
|
||||||
|
s.Require().NoError(err)
|
||||||
|
|
||||||
|
assert.Contains(s.T(), txResp.TxHash, txResponse.TxHash)
|
||||||
|
s.Require().NoError(err)
|
||||||
|
|
||||||
|
// Check postAttestationBalance it should be the preAttestationBalance + th 8800 tokens being donated to the machine (no fees are taken)
|
||||||
|
postAttestationBalanceOutput, err := clitestutil.ExecTestCLICmd(val.ClientCtx, bank.GetBalancesCmd(), []string{
|
||||||
|
addr.String(),
|
||||||
|
})
|
||||||
|
s.Require().NoError(err)
|
||||||
|
postAttestationBalance, ok := postAttestationBalanceOutput.(*bytes.Buffer)
|
||||||
|
if !ok {
|
||||||
|
err = lib.ErrTypeAssertionFailed
|
||||||
|
s.Require().NoError(err)
|
||||||
|
}
|
||||||
|
assert.Contains(s.T(), postAttestationBalance.String(), "18800")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *E2ETestSuite) TestInvalidAttestMachine() {
|
func (s *E2ETestSuite) TestInvalidAttestMachine() {
|
||||||
|
|||||||
@ -44,6 +44,10 @@ func FundAccount(network *network.Network, account *keyring.Record, tokenDenom s
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = network.WaitForNextBlock()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
err = network.WaitForNextBlock()
|
err = network.WaitForNextBlock()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -99,6 +103,10 @@ func AttestMachine(network *network.Network, name string, mnemonic string, num i
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = network.WaitForNextBlock()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
err = network.WaitForNextBlock()
|
err = network.WaitForNextBlock()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
@ -15,14 +15,16 @@ import (
|
|||||||
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
|
||||||
typesparams "github.com/cosmos/cosmos-sdk/x/params/types"
|
typesparams "github.com/cosmos/cosmos-sdk/x/params/types"
|
||||||
"github.com/golang/mock/gomock"
|
"github.com/golang/mock/gomock"
|
||||||
|
"github.com/planetmint/planetmint-go/monitor"
|
||||||
|
monitormocks "github.com/planetmint/planetmint-go/monitor/mocks"
|
||||||
"github.com/planetmint/planetmint-go/x/dao/keeper"
|
"github.com/planetmint/planetmint-go/x/dao/keeper"
|
||||||
|
daotestutil "github.com/planetmint/planetmint-go/x/dao/testutil"
|
||||||
"github.com/planetmint/planetmint-go/x/dao/types"
|
"github.com/planetmint/planetmint-go/x/dao/types"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
daotestutil "github.com/planetmint/planetmint-go/x/dao/testutil"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func DaoKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) {
|
func DaoKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) {
|
||||||
|
monitor.SetMqttMonitorInstance(&monitormocks.MockMQTTMonitorClientI{})
|
||||||
storeKey := sdk.NewKVStoreKey(types.StoreKey)
|
storeKey := sdk.NewKVStoreKey(types.StoreKey)
|
||||||
memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey)
|
memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey)
|
||||||
challengeStoreKey := storetypes.NewMemoryStoreKey(types.ChallengeKey)
|
challengeStoreKey := storetypes.NewMemoryStoreKey(types.ChallengeKey)
|
||||||
|
|||||||
66
testutil/mocks/rddl_claim_service_client_mock.go
Normal file
66
testutil/mocks/rddl_claim_service_client_mock.go
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
// Code generated by MockGen. DO NOT EDIT.
|
||||||
|
// Source: ./clients/claim_client.go
|
||||||
|
|
||||||
|
// Package mocks is a generated GoMock package.
|
||||||
|
package mocks
|
||||||
|
|
||||||
|
import (
|
||||||
|
context "context"
|
||||||
|
reflect "reflect"
|
||||||
|
|
||||||
|
gomock "github.com/golang/mock/gomock"
|
||||||
|
clients "github.com/planetmint/planetmint-go/clients"
|
||||||
|
)
|
||||||
|
|
||||||
|
// MockIRCClient is a mock of IRCClient interface.
|
||||||
|
type MockIRCClient struct {
|
||||||
|
ctrl *gomock.Controller
|
||||||
|
recorder *MockIRCClientMockRecorder
|
||||||
|
}
|
||||||
|
|
||||||
|
// MockIRCClientMockRecorder is the mock recorder for MockIRCClient.
|
||||||
|
type MockIRCClientMockRecorder struct {
|
||||||
|
mock *MockIRCClient
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewMockIRCClient creates a new mock instance.
|
||||||
|
func NewMockIRCClient(ctrl *gomock.Controller) *MockIRCClient {
|
||||||
|
mock := &MockIRCClient{ctrl: ctrl}
|
||||||
|
mock.recorder = &MockIRCClientMockRecorder{mock}
|
||||||
|
return mock
|
||||||
|
}
|
||||||
|
|
||||||
|
// EXPECT returns an object that allows the caller to indicate expected use.
|
||||||
|
func (m *MockIRCClient) EXPECT() *MockIRCClientMockRecorder {
|
||||||
|
return m.recorder
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetClaim mocks base method.
|
||||||
|
func (m *MockIRCClient) GetClaim(ctx context.Context, id int) (clients.GetClaimResponse, error) {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "GetClaim", ctx, id)
|
||||||
|
ret0, _ := ret[0].(clients.GetClaimResponse)
|
||||||
|
ret1, _ := ret[1].(error)
|
||||||
|
return ret0, ret1
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetClaim indicates an expected call of GetClaim.
|
||||||
|
func (mr *MockIRCClientMockRecorder) GetClaim(ctx, id interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetClaim", reflect.TypeOf((*MockIRCClient)(nil).GetClaim), ctx, id)
|
||||||
|
}
|
||||||
|
|
||||||
|
// PostClaim mocks base method.
|
||||||
|
func (m *MockIRCClient) PostClaim(ctx context.Context, req clients.PostClaimRequest) (clients.PostClaimResponse, error) {
|
||||||
|
m.ctrl.T.Helper()
|
||||||
|
ret := m.ctrl.Call(m, "PostClaim", ctx, req)
|
||||||
|
ret0, _ := ret[0].(clients.PostClaimResponse)
|
||||||
|
ret1, _ := ret[1].(error)
|
||||||
|
return ret0, ret1
|
||||||
|
}
|
||||||
|
|
||||||
|
// PostClaim indicates an expected call of PostClaim.
|
||||||
|
func (mr *MockIRCClientMockRecorder) PostClaim(ctx, req interface{}) *gomock.Call {
|
||||||
|
mr.mock.ctrl.T.Helper()
|
||||||
|
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PostClaim", reflect.TypeOf((*MockIRCClient)(nil).PostClaim), ctx, req)
|
||||||
|
}
|
||||||
@ -14,7 +14,12 @@ import (
|
|||||||
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
|
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
||||||
|
"github.com/golang/mock/gomock"
|
||||||
"github.com/planetmint/planetmint-go/app"
|
"github.com/planetmint/planetmint-go/app"
|
||||||
|
"github.com/planetmint/planetmint-go/clients"
|
||||||
|
"github.com/planetmint/planetmint-go/monitor"
|
||||||
|
monitormocks "github.com/planetmint/planetmint-go/monitor/mocks"
|
||||||
|
claimmocks "github.com/planetmint/planetmint-go/testutil/mocks"
|
||||||
"github.com/planetmint/planetmint-go/testutil/sample"
|
"github.com/planetmint/planetmint-go/testutil/sample"
|
||||||
"github.com/planetmint/planetmint-go/util"
|
"github.com/planetmint/planetmint-go/util"
|
||||||
"github.com/planetmint/planetmint-go/util/mocks"
|
"github.com/planetmint/planetmint-go/util/mocks"
|
||||||
@ -39,8 +44,16 @@ func Load(t *testing.T, configs ...Config) *Network {
|
|||||||
|
|
||||||
// use mock client for testing
|
// use mock client for testing
|
||||||
util.MQTTClient = &mocks.MockMQTTClient{}
|
util.MQTTClient = &mocks.MockMQTTClient{}
|
||||||
|
monitor.MonitorMQTTClient = &mocks.MockMQTTClient{}
|
||||||
|
monitor.SetMqttMonitorInstance(&monitormocks.MockMQTTMonitorClientI{})
|
||||||
elements.Client = &elementsmocks.MockClient{}
|
elements.Client = &elementsmocks.MockClient{}
|
||||||
util.RegisterAssetServiceHTTPClient = &mocks.MockClient{}
|
util.RegisterAssetServiceHTTPClient = &mocks.MockClient{}
|
||||||
|
ctrl := gomock.NewController(t)
|
||||||
|
claimMock := claimmocks.NewMockIRCClient(ctrl)
|
||||||
|
claimMock.EXPECT().PostClaim(gomock.Any(), gomock.Any()).AnyTimes().Return(clients.PostClaimResponse{
|
||||||
|
TxID: "0000000000000000000000000000000000000000000000000000000000000000",
|
||||||
|
}, nil)
|
||||||
|
clients.ClaimServiceClient = claimMock
|
||||||
|
|
||||||
// enable application logger in tests
|
// enable application logger in tests
|
||||||
appLogger := util.GetAppLogger()
|
appLogger := util.GetAppLogger()
|
||||||
|
|||||||
@ -57,3 +57,17 @@ func IsValidatorBlockProposer(ctx sdk.Context, proposerAddress []byte, rootDir s
|
|||||||
result = hexProposerAddress == validatorIdentity
|
result = hexProposerAddress == validatorIdentity
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func IsValidAddress(address string) (valid bool, err error) {
|
||||||
|
// Attempt to decode the address
|
||||||
|
_, err = sdk.AccAddressFromBech32(address)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if !strings.Contains(address, "plmnt") {
|
||||||
|
valid = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
valid = true
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|||||||
@ -24,7 +24,7 @@ func ReissueAsset(reissueTx string) (txID string, err error) {
|
|||||||
cmdArgs := strings.Split(reissueTx, " ")
|
cmdArgs := strings.Split(reissueTx, " ")
|
||||||
elementsSyncAccess.Lock()
|
elementsSyncAccess.Lock()
|
||||||
defer elementsSyncAccess.Unlock()
|
defer elementsSyncAccess.Unlock()
|
||||||
result, err := elements.ReissueAsset(url, []string{cmdArgs[1], cmdArgs[2]})
|
result, err := elements.ReissueAsset(url, []string{`"` + cmdArgs[1] + `"`, cmdArgs[2]})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -39,7 +39,7 @@ func DistributeAsset(address string, amount string, reissuanceAsset string) (txI
|
|||||||
elementsSyncAccess.Lock()
|
elementsSyncAccess.Lock()
|
||||||
defer elementsSyncAccess.Unlock()
|
defer elementsSyncAccess.Unlock()
|
||||||
txID, err = elements.SendToAddress(url, []string{
|
txID, err = elements.SendToAddress(url, []string{
|
||||||
address,
|
`"` + address + `"`,
|
||||||
`"` + amount + `"`,
|
`"` + amount + `"`,
|
||||||
`""`,
|
`""`,
|
||||||
`""`,
|
`""`,
|
||||||
@ -62,7 +62,7 @@ func IssueNFTAsset(name string, machineAddress string, domain string) (assetID s
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
addressInfo, err := elements.GetAddressInfo(url, []string{address})
|
addressInfo, err := elements.GetAddressInfo(url, []string{`"` + address + `"`})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -74,7 +74,7 @@ func IssueNFTAsset(name string, machineAddress string, domain string) (assetID s
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
fundRawTransactionResult, err := elements.FundRawTransaction(url, []string{hex, `{"feeRate":0.00001000}`})
|
fundRawTransactionResult, err := elements.FundRawTransaction(url, []string{`"` + hex + `"`, `{"feeRate":0.00001000}`})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -109,7 +109,7 @@ func IssueNFTAsset(name string, machineAddress string, domain string) (assetID s
|
|||||||
hash[i], hash[j] = hash[j], hash[i]
|
hash[i], hash[j] = hash[j], hash[i]
|
||||||
}
|
}
|
||||||
|
|
||||||
rawIssueAssetResults, err := elements.RawIssueAsset(url, []string{fundRawTransactionResult.Hex,
|
rawIssueAssetResults, err := elements.RawIssueAsset(url, []string{`"` + fundRawTransactionResult.Hex + `"`,
|
||||||
`[{"asset_amount":0.00000001, "asset_address":"` + address + `", "blind":false, "contract_hash":"` + fmt.Sprintf("%+x", hash) + `"}]`,
|
`[{"asset_amount":0.00000001, "asset_address":"` + address + `", "blind":false, "contract_hash":"` + fmt.Sprintf("%+x", hash) + `"}]`,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -117,13 +117,13 @@ func IssueNFTAsset(name string, machineAddress string, domain string) (assetID s
|
|||||||
}
|
}
|
||||||
|
|
||||||
rawIssueAssetResult := rawIssueAssetResults[len(rawIssueAssetResults)-1]
|
rawIssueAssetResult := rawIssueAssetResults[len(rawIssueAssetResults)-1]
|
||||||
hex, err = elements.BlindRawTransaction(url, []string{rawIssueAssetResult.Hex, `true`, `[]`, `false`})
|
hex, err = elements.BlindRawTransaction(url, []string{`"` + rawIssueAssetResult.Hex + `"`, `true`, `[]`, `false`})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
assetID = rawIssueAssetResult.Asset
|
assetID = rawIssueAssetResult.Asset
|
||||||
|
|
||||||
signRawTransactionWithWalletResult, err := elements.SignRawTransactionWithWallet(url, []string{hex})
|
signRawTransactionWithWalletResult, err := elements.SignRawTransactionWithWallet(url, []string{`"` + hex + `"`})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -139,7 +139,7 @@ func IssueNFTAsset(name string, machineAddress string, domain string) (assetID s
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
hex, err = elements.SendRawTransaction(url, []string{signRawTransactionWithWalletResult.Hex})
|
hex, err = elements.SendRawTransaction(url, []string{`"` + signRawTransactionWithWalletResult.Hex + `"`})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
54
util/elementsd_connector_test.go
Normal file
54
util/elementsd_connector_test.go
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
package util_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"math/rand"
|
||||||
|
"strconv"
|
||||||
|
"sync"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/planetmint/planetmint-go/testutil/moduleobject"
|
||||||
|
"github.com/planetmint/planetmint-go/testutil/sample"
|
||||||
|
"github.com/planetmint/planetmint-go/util"
|
||||||
|
"github.com/planetmint/planetmint-go/x/machine/types"
|
||||||
|
elements "github.com/rddl-network/elements-rpc"
|
||||||
|
elementsmocks "github.com/rddl-network/elements-rpc/utils/mocks"
|
||||||
|
"github.com/stretchr/testify/assert"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestReissueAsset(t *testing.T) {
|
||||||
|
elements.Client = &elementsmocks.MockClient{}
|
||||||
|
_, err := util.ReissueAsset("reissueasset 06c20c8de513527f1ae6c901f74a05126525ac2d7e89306f4a7fd5ec4e674403 900.000")
|
||||||
|
assert.NoError(t, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestDistributeAsset(t *testing.T) {
|
||||||
|
elements.Client = &elementsmocks.MockClient{}
|
||||||
|
|
||||||
|
_, err := util.DistributeAsset(
|
||||||
|
"tlq1qqt5078sef4aqls29c3j3pwfmukgjug70t37x26gwyhzpdxmtmjmphar88fwsl9qcm559jevve772prhtuyf9xkxdtrhvuce6a",
|
||||||
|
"20",
|
||||||
|
"06c20c8de513527f1ae6c901f74a05126525ac2d7e89306f4a7fd5ec4e674403")
|
||||||
|
assert.NoError(t, err)
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestIssueNFTAsset(t *testing.T) {
|
||||||
|
elements.Client = &elementsmocks.MockClient{}
|
||||||
|
|
||||||
|
params := types.DefaultParams()
|
||||||
|
var wg sync.WaitGroup
|
||||||
|
|
||||||
|
for i := 0; i < 1; i++ {
|
||||||
|
wg.Add(1)
|
||||||
|
go func() {
|
||||||
|
randomInt := rand.Int()
|
||||||
|
sk, pk := sample.KeyPair(randomInt)
|
||||||
|
machine := moduleobject.MachineRandom(pk, pk, sk, "address "+strconv.Itoa(randomInt), randomInt)
|
||||||
|
|
||||||
|
_, _, _, err := util.IssueNFTAsset(machine.Name, machine.Address, params.AssetRegistryDomain)
|
||||||
|
assert.NoError(t, err)
|
||||||
|
|
||||||
|
wg.Done()
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
wg.Wait()
|
||||||
|
}
|
||||||
@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
|
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
|
||||||
"github.com/planetmint/planetmint-go/config"
|
"github.com/planetmint/planetmint-go/config"
|
||||||
"github.com/planetmint/planetmint-go/lib"
|
"github.com/planetmint/planetmint-go/lib"
|
||||||
daotypes "github.com/planetmint/planetmint-go/x/dao/types"
|
daotypes "github.com/planetmint/planetmint-go/x/dao/types"
|
||||||
@ -99,3 +100,15 @@ func SendUpdateRedeemClaim(goCtx context.Context, beneficiary string, id uint64,
|
|||||||
loggingContext := "redeem claim"
|
loggingContext := "redeem claim"
|
||||||
buildSignBroadcastTx(goCtx, loggingContext, sendingValidatorAddress, msg)
|
buildSignBroadcastTx(goCtx, loggingContext, sendingValidatorAddress, msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func SendTokens(goCtx context.Context, beneficiary sdk.AccAddress, amount uint64, denominator string) {
|
||||||
|
sendingValidatorAddress := config.GetConfig().ValidatorAddress
|
||||||
|
|
||||||
|
coin := sdk.NewCoin(denominator, sdk.NewIntFromUint64(amount))
|
||||||
|
coins := sdk.NewCoins(coin)
|
||||||
|
orgAddr := sdk.MustAccAddressFromBech32(sendingValidatorAddress)
|
||||||
|
msg := banktypes.NewMsgSend(orgAddr, beneficiary, coins)
|
||||||
|
|
||||||
|
loggingContext := "sending " + denominator + " tokens"
|
||||||
|
buildSignBroadcastTx(goCtx, loggingContext, sendingValidatorAddress, msg)
|
||||||
|
}
|
||||||
|
|||||||
@ -19,6 +19,19 @@ func DeserializeInt64(value []byte) int64 {
|
|||||||
return int64(integer - 1)
|
return int64(integer - 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func SerializeUint64(value uint64) []byte {
|
||||||
|
buf := make([]byte, 8)
|
||||||
|
// Adding 1 because 0 will be interpreted as nil, which is an invalid key
|
||||||
|
binary.BigEndian.PutUint64(buf, value+1)
|
||||||
|
return buf
|
||||||
|
}
|
||||||
|
|
||||||
|
func DeserializeUint64(value []byte) uint64 {
|
||||||
|
integer := binary.BigEndian.Uint64(value)
|
||||||
|
// Subtract 1 because addition in serialization
|
||||||
|
return integer - 1
|
||||||
|
}
|
||||||
|
|
||||||
func SerializeString(value string) []byte {
|
func SerializeString(value string) []byte {
|
||||||
byteArray := []byte(value)
|
byteArray := []byte(value)
|
||||||
return byteArray
|
return byteArray
|
||||||
|
|||||||
@ -16,7 +16,7 @@ var (
|
|||||||
globalApplicationLoggerTag string
|
globalApplicationLoggerTag string
|
||||||
appLogger *AppLogger
|
appLogger *AppLogger
|
||||||
initAppLogger sync.Once
|
initAppLogger sync.Once
|
||||||
syncTestingLog sync.Mutex
|
syncTestingLog sync.RWMutex
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@ -48,13 +48,13 @@ func format(msg string, keyvals ...interface{}) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (logger *AppLogger) testingLog(msg string, keyvals ...interface{}) {
|
func (logger *AppLogger) testingLog(msg string, keyvals ...interface{}) {
|
||||||
|
syncTestingLog.RLock()
|
||||||
|
defer syncTestingLog.RUnlock()
|
||||||
if logger.testingLogger == nil {
|
if logger.testingLogger == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
msg = format(msg, keyvals...)
|
msg = format(msg, keyvals...)
|
||||||
syncTestingLog.Lock()
|
|
||||||
logger.testingLogger.Logf(msg)
|
logger.testingLogger.Logf(msg)
|
||||||
syncTestingLog.Unlock()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (logger *AppLogger) Info(ctx sdk.Context, msg string, keyvals ...interface{}) {
|
func (logger *AppLogger) Info(ctx sdk.Context, msg string, keyvals ...interface{}) {
|
||||||
|
|||||||
@ -9,11 +9,15 @@ import (
|
|||||||
|
|
||||||
// MockMQTTClient is the mock mqtt client
|
// MockMQTTClient is the mock mqtt client
|
||||||
type MockMQTTClient struct {
|
type MockMQTTClient struct {
|
||||||
ConnectFunc func() mqtt.Token
|
ConnectFunc func() mqtt.Token
|
||||||
DisconnectFunc func(quiesce uint)
|
DisconnectFunc func(quiesce uint)
|
||||||
PublishFunc func(topic string, qos byte, retained bool, payload interface{}) mqtt.Token
|
PublishFunc func(topic string, qos byte, retained bool, payload interface{}) mqtt.Token
|
||||||
SubscribeFunc func(topic string, qos byte, callback mqtt.MessageHandler) mqtt.Token
|
SubscribeFunc func(topic string, qos byte, callback mqtt.MessageHandler) mqtt.Token
|
||||||
UnsubscribeFunc func(topics ...string) mqtt.Token
|
UnsubscribeFunc func(topics ...string) mqtt.Token
|
||||||
|
IsConnectedFunc func() bool
|
||||||
|
IsConnectionOpenFunc func() bool
|
||||||
|
connected bool
|
||||||
|
connectedMutex sync.Mutex
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetConnectFunc fetches the mock client's `Connect` func
|
// GetConnectFunc fetches the mock client's `Connect` func
|
||||||
@ -96,6 +100,9 @@ func GetUnsubscribeFunc(_ ...string) mqtt.Token {
|
|||||||
|
|
||||||
// Connect is the mock client's `Disconnect` func
|
// Connect is the mock client's `Disconnect` func
|
||||||
func (m *MockMQTTClient) Connect() mqtt.Token {
|
func (m *MockMQTTClient) Connect() mqtt.Token {
|
||||||
|
m.connectedMutex.Lock()
|
||||||
|
m.connected = true
|
||||||
|
m.connectedMutex.Unlock()
|
||||||
return GetConnectFunc()
|
return GetConnectFunc()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,3 +123,17 @@ func (m *MockMQTTClient) Subscribe(topic string, qos byte, callback mqtt.Message
|
|||||||
func (m *MockMQTTClient) Unsubscribe(topics ...string) mqtt.Token {
|
func (m *MockMQTTClient) Unsubscribe(topics ...string) mqtt.Token {
|
||||||
return GetUnsubscribeFunc(topics...)
|
return GetUnsubscribeFunc(topics...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *MockMQTTClient) IsConnected() bool {
|
||||||
|
m.connectedMutex.Lock()
|
||||||
|
connected := m.connected
|
||||||
|
m.connectedMutex.Unlock()
|
||||||
|
return connected
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *MockMQTTClient) IsConnectionOpen() bool {
|
||||||
|
m.connectedMutex.Lock()
|
||||||
|
connected := m.connected
|
||||||
|
m.connectedMutex.Unlock()
|
||||||
|
return connected
|
||||||
|
}
|
||||||
|
|||||||
27
util/mqtt.go
27
util/mqtt.go
@ -1,6 +1,8 @@
|
|||||||
package util
|
package util
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"crypto/tls"
|
||||||
|
"encoding/json"
|
||||||
"net"
|
"net"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
@ -20,6 +22,8 @@ type MQTTClientI interface {
|
|||||||
Publish(topic string, qos byte, retained bool, payload interface{}) mqtt.Token
|
Publish(topic string, qos byte, retained bool, payload interface{}) mqtt.Token
|
||||||
Subscribe(topic string, qos byte, callback mqtt.MessageHandler) mqtt.Token
|
Subscribe(topic string, qos byte, callback mqtt.MessageHandler) mqtt.Token
|
||||||
Unsubscribe(topics ...string) mqtt.Token
|
Unsubscribe(topics ...string) mqtt.Token
|
||||||
|
IsConnected() bool
|
||||||
|
IsConnectionOpen() bool
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -32,7 +36,7 @@ const (
|
|||||||
MqttCmdPrefix = "cmnd/"
|
MqttCmdPrefix = "cmnd/"
|
||||||
)
|
)
|
||||||
|
|
||||||
func lazyLoadMQTTClient() {
|
func LazyLoadMQTTClient() {
|
||||||
if MQTTClient != nil {
|
if MQTTClient != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -40,11 +44,19 @@ func lazyLoadMQTTClient() {
|
|||||||
conf := config.GetConfig()
|
conf := config.GetConfig()
|
||||||
hostPort := net.JoinHostPort(conf.MqttDomain, strconv.FormatInt(int64(conf.MqttPort), 10))
|
hostPort := net.JoinHostPort(conf.MqttDomain, strconv.FormatInt(int64(conf.MqttPort), 10))
|
||||||
uri := "tcp://" + hostPort
|
uri := "tcp://" + hostPort
|
||||||
|
if conf.MqttTLS {
|
||||||
|
uri = "ssl://" + hostPort
|
||||||
|
}
|
||||||
|
|
||||||
opts := mqtt.NewClientOptions().AddBroker(uri)
|
opts := mqtt.NewClientOptions().AddBroker(uri)
|
||||||
opts.SetClientID(conf.ValidatorAddress)
|
opts.SetClientID(conf.ValidatorAddress)
|
||||||
opts.SetUsername(conf.MqttUser)
|
opts.SetUsername(conf.MqttUser)
|
||||||
opts.SetPassword(conf.MqttPassword)
|
opts.SetPassword(conf.MqttPassword)
|
||||||
|
if conf.MqttTLS {
|
||||||
|
tlsConfig := &tls.Config{}
|
||||||
|
opts.SetTLSConfig(tlsConfig)
|
||||||
|
}
|
||||||
|
|
||||||
MQTTClient = mqtt.NewClient(opts)
|
MQTTClient = mqtt.NewClient(opts)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,7 +78,7 @@ func SendMqttPopInitMessagesToServer(ctx sdk.Context, challenge types.Challenge)
|
|||||||
}
|
}
|
||||||
|
|
||||||
func sendMqttPopInitMessages(challenge types.Challenge) (err error) {
|
func sendMqttPopInitMessages(challenge types.Challenge) (err error) {
|
||||||
lazyLoadMQTTClient()
|
LazyLoadMQTTClient()
|
||||||
if token := MQTTClient.Connect(); token.Wait() && token.Error() != nil {
|
if token := MQTTClient.Connect(); token.Wait() && token.Error() != nil {
|
||||||
err = token.Error()
|
err = token.Error()
|
||||||
return
|
return
|
||||||
@ -92,7 +104,7 @@ func sendMqttPopInitMessages(challenge types.Challenge) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func GetMqttStatusOfParticipant(address string, responseTimeoutInMs int64) (isAvailable bool, err error) {
|
func GetMqttStatusOfParticipant(address string, responseTimeoutInMs int64) (isAvailable bool, err error) {
|
||||||
lazyLoadMQTTClient()
|
LazyLoadMQTTClient()
|
||||||
if token := MQTTClient.Connect(); token.Wait() && token.Error() != nil {
|
if token := MQTTClient.Connect(); token.Wait() && token.Error() != nil {
|
||||||
err = token.Error()
|
err = token.Error()
|
||||||
return
|
return
|
||||||
@ -142,3 +154,12 @@ func GetMqttStatusOfParticipant(address string, responseTimeoutInMs int64) (isAv
|
|||||||
MQTTClient.Disconnect(1000)
|
MQTTClient.Disconnect(1000)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func ToJSON(payload []byte) (map[string]interface{}, error) {
|
||||||
|
jsonString := string(payload)
|
||||||
|
|
||||||
|
var result map[string]interface{}
|
||||||
|
// Unmarshal the JSON string into the map
|
||||||
|
err := json.Unmarshal([]byte(jsonString), &result)
|
||||||
|
return result, err
|
||||||
|
}
|
||||||
|
|||||||
@ -31,3 +31,12 @@ func TestGetMqttStatusOfParticipantMocked(t *testing.T) {
|
|||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.True(t, isAvailable)
|
assert.True(t, isAvailable)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestToJSON(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
payload := []byte(`{"Time":"2024-03-26T11:50:42","Uptime":"0T00:50:19","UptimeSec":3019,"Heap":97,"SleepMode":"Dynamic","Sleep":10,"LoadAvg":99,"MqttCount":2,"Berry":{"HeapUsed":27,"Objects":491},"POWER1":"ON","POWER2":"ON","Dimmer":17,"Color":"00182C","HSBColor":"207,100,17","Channel":[0,9,17],"Scheme":0,"Width":1,"Fade":"OFF","Speed":1,"LedTable":"ON","Wifi":{"AP":1,"SSId":"UPC5729E56","BSSId":"C2:14:7E:6F:BC:C5","Channel":11,"Mode":"11n","RSSI":96,"Signal":-52,"LinkCount":1,"Downtime":"0T00:00:10"}}`)
|
||||||
|
|
||||||
|
result, err := ToJSON(payload)
|
||||||
|
assert.NoError(t, err)
|
||||||
|
assert.Equal(t, 21, len(result))
|
||||||
|
}
|
||||||
|
|||||||
@ -5,15 +5,15 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
factor = 100000000.0
|
Factor = 100000000.0
|
||||||
)
|
)
|
||||||
|
|
||||||
func RDDLToken2Uint(amount float64) uint64 {
|
func RDDLToken2Uint(amount float64) uint64 {
|
||||||
return uint64(amount * factor)
|
return uint64(amount * Factor)
|
||||||
}
|
}
|
||||||
|
|
||||||
func RDDLToken2Float(amount uint64) float64 {
|
func RDDLToken2Float(amount uint64) float64 {
|
||||||
return float64(amount) / factor
|
return float64(amount) / Factor
|
||||||
}
|
}
|
||||||
|
|
||||||
func RDDLTokenStringToFloat(amount string) (amountFloat float64, err error) {
|
func RDDLTokenStringToFloat(amount string) (amountFloat float64, err error) {
|
||||||
|
|||||||
@ -1,53 +0,0 @@
|
|||||||
package util
|
|
||||||
|
|
||||||
import (
|
|
||||||
"encoding/hex"
|
|
||||||
"errors"
|
|
||||||
|
|
||||||
"github.com/btcsuite/btcd/btcutil/hdkeychain"
|
|
||||||
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
|
|
||||||
)
|
|
||||||
|
|
||||||
func ValidateSignature(message string, signature string, publicKey string) (bool, error) {
|
|
||||||
// Convert the message, signature, and public key from hex to bytes
|
|
||||||
messageBytes, err := hex.DecodeString(message)
|
|
||||||
if err != nil {
|
|
||||||
return false, errors.New("invalid message hex string")
|
|
||||||
}
|
|
||||||
return ValidateSignatureByteMsg(messageBytes, signature, publicKey)
|
|
||||||
}
|
|
||||||
|
|
||||||
func ValidateSignatureByteMsg(message []byte, signature string, publicKey string) (bool, error) {
|
|
||||||
// Convert signature, and public key from hex to bytes
|
|
||||||
signatureBytes, err := hex.DecodeString(signature)
|
|
||||||
if err != nil {
|
|
||||||
return false, errors.New("invalid signature hex string")
|
|
||||||
}
|
|
||||||
publicKeyBytes, err := hex.DecodeString(publicKey)
|
|
||||||
if err != nil {
|
|
||||||
return false, errors.New("invalid public key hex string")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create a secp256k1 public key object
|
|
||||||
pubKey := &secp256k1.PubKey{Key: publicKeyBytes}
|
|
||||||
|
|
||||||
// Verify the signature
|
|
||||||
isValid := pubKey.VerifySignature(message, signatureBytes)
|
|
||||||
if !isValid {
|
|
||||||
return false, errors.New("invalid signature")
|
|
||||||
}
|
|
||||||
return isValid, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func GetHexPubKey(extPubKey string) (string, error) {
|
|
||||||
xpubKey, err := hdkeychain.NewKeyFromString(extPubKey)
|
|
||||||
if err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
pubKey, err := xpubKey.ECPubKey()
|
|
||||||
if err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
byteKey := pubKey.SerializeCompressed()
|
|
||||||
return hex.EncodeToString(byteKey), nil
|
|
||||||
}
|
|
||||||
@ -14,12 +14,12 @@ var _ = strconv.Itoa(0)
|
|||||||
|
|
||||||
func CmdGetByAddress() *cobra.Command {
|
func CmdGetByAddress() *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "address [address] [lookup-period-in-min]",
|
Use: "address [address] [num-elements]",
|
||||||
Short: "Query for assets by address",
|
Short: "Query for assets by address",
|
||||||
Args: cobra.ExactArgs(2),
|
Args: cobra.ExactArgs(2),
|
||||||
RunE: func(cmd *cobra.Command, args []string) (err error) {
|
RunE: func(cmd *cobra.Command, args []string) (err error) {
|
||||||
reqAddress := args[0]
|
reqAddress := args[0]
|
||||||
reqLookupPeriodInMin, err := cast.ToUint64E(args[1])
|
reqNumElements, err := cast.ToUint64E(args[1])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -33,8 +33,8 @@ func CmdGetByAddress() *cobra.Command {
|
|||||||
|
|
||||||
params := &types.QueryGetCIDsByAddressRequest{
|
params := &types.QueryGetCIDsByAddressRequest{
|
||||||
|
|
||||||
Address: reqAddress,
|
Address: reqAddress,
|
||||||
LookupPeriodInMin: reqLookupPeriodInMin,
|
NumElements: reqNumElements,
|
||||||
}
|
}
|
||||||
|
|
||||||
pageReq, err := client.ReadPageRequest(cmd.Flags())
|
pageReq, err := client.ReadPageRequest(cmd.Flags())
|
||||||
|
|||||||
@ -8,9 +8,36 @@ import (
|
|||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func (k Keeper) setAddresAssetCount(ctx sdk.Context, address string, count uint64) {
|
||||||
|
store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.AssetKey))
|
||||||
|
store.Set(types.AddressCountKey(address), util.SerializeUint64(count))
|
||||||
|
}
|
||||||
|
|
||||||
|
func (k Keeper) GetAddressAssetCount(ctx sdk.Context, address string) (count uint64, found bool) {
|
||||||
|
store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.AssetKey))
|
||||||
|
countBytes := store.Get(types.AddressCountKey(address))
|
||||||
|
if countBytes == nil {
|
||||||
|
return 0, false
|
||||||
|
}
|
||||||
|
return util.DeserializeUint64(countBytes), true
|
||||||
|
}
|
||||||
|
|
||||||
|
func (k Keeper) incrementAddressAssetCount(ctx sdk.Context, address string) uint64 {
|
||||||
|
count, _ := k.GetAddressAssetCount(ctx, address)
|
||||||
|
k.setAddresAssetCount(ctx, address, count+1)
|
||||||
|
return count + 1
|
||||||
|
}
|
||||||
|
|
||||||
|
func (k Keeper) StoreAddressAsset(ctx sdk.Context, msg types.MsgNotarizeAsset) {
|
||||||
|
store := prefix.NewStore(ctx.KVStore(k.storeKey), types.AddressPrefix(msg.GetCreator()))
|
||||||
|
count := k.incrementAddressAssetCount(ctx, msg.GetCreator())
|
||||||
|
store.Set(util.SerializeUint64(count), []byte(msg.GetCid()))
|
||||||
|
}
|
||||||
|
|
||||||
func (k Keeper) StoreAsset(ctx sdk.Context, msg types.MsgNotarizeAsset) {
|
func (k Keeper) StoreAsset(ctx sdk.Context, msg types.MsgNotarizeAsset) {
|
||||||
store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.AssetKey))
|
store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.AssetKey))
|
||||||
store.Set(util.SerializeString(msg.GetCid()), []byte(msg.GetCreator()))
|
store.Set(util.SerializeString(msg.GetCid()), []byte(msg.GetCreator()))
|
||||||
|
k.StoreAddressAsset(ctx, msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (k Keeper) GetAsset(ctx sdk.Context, cid string) (msg types.MsgNotarizeAsset, found bool) {
|
func (k Keeper) GetAsset(ctx sdk.Context, cid string) (msg types.MsgNotarizeAsset, found bool) {
|
||||||
@ -24,18 +51,23 @@ func (k Keeper) GetAsset(ctx sdk.Context, cid string) (msg types.MsgNotarizeAsse
|
|||||||
return msg, true
|
return msg, true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (k Keeper) GetCidsByAddress(ctx sdk.Context, address string) (cids []string, found bool) {
|
func (k Keeper) GetAssetByAddressAndID(ctx sdk.Context, address string, id uint64) (cid string, found bool) {
|
||||||
store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.AssetKey))
|
store := prefix.NewStore(ctx.KVStore(k.storeKey), types.AddressPrefix(address))
|
||||||
|
cidBytes := store.Get(util.SerializeUint64(id))
|
||||||
|
if cidBytes == nil {
|
||||||
|
return cid, false
|
||||||
|
}
|
||||||
|
return string(cidBytes), true
|
||||||
|
}
|
||||||
|
|
||||||
reverseIterator := store.ReverseIterator(nil, nil)
|
func (k Keeper) GetAssetsByAddress(ctx sdk.Context, address string, start []byte, end []byte) (cids []string, found bool) {
|
||||||
defer reverseIterator.Close()
|
store := prefix.NewStore(ctx.KVStore(k.storeKey), types.AddressPrefix(address))
|
||||||
for ; reverseIterator.Valid(); reverseIterator.Next() {
|
|
||||||
addressBytes := reverseIterator.Value()
|
|
||||||
cidBytes := reverseIterator.Key()
|
|
||||||
|
|
||||||
if string(addressBytes) == address {
|
iterator := store.ReverseIterator(start, end)
|
||||||
cids = append(cids, string(cidBytes))
|
defer iterator.Close()
|
||||||
}
|
for ; iterator.Valid(); iterator.Next() {
|
||||||
|
cidBytes := iterator.Value()
|
||||||
|
cids = append(cids, string(cidBytes))
|
||||||
}
|
}
|
||||||
return cids, len(cids) > 0
|
return cids, len(cids) > 0
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
keepertest "github.com/planetmint/planetmint-go/testutil/keeper"
|
keepertest "github.com/planetmint/planetmint-go/testutil/keeper"
|
||||||
|
"github.com/planetmint/planetmint-go/util"
|
||||||
"github.com/planetmint/planetmint-go/x/asset/keeper"
|
"github.com/planetmint/planetmint-go/x/asset/keeper"
|
||||||
"github.com/planetmint/planetmint-go/x/asset/types"
|
"github.com/planetmint/planetmint-go/x/asset/types"
|
||||||
|
|
||||||
@ -39,14 +40,43 @@ func TestGetAssetbyCid(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestGetAssetByPubKeys(t *testing.T) {
|
func TestAssetCount(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
keeper, ctx := keepertest.AssetKeeper(t)
|
keeper, ctx := keepertest.AssetKeeper(t)
|
||||||
_ = createNAsset(keeper, ctx, 10)
|
numItems := 10
|
||||||
assets, found := keeper.GetCidsByAddress(ctx, "plmnt_address")
|
items := createNAsset(keeper, ctx, numItems)
|
||||||
|
count, found := keeper.GetAddressAssetCount(ctx, items[0].Creator)
|
||||||
assert.True(t, found)
|
assert.True(t, found)
|
||||||
assert.Equal(t, len(assets), 5)
|
assert.Equal(t, uint64(5), count)
|
||||||
assets, found = keeper.GetCidsByAddress(ctx, "plmnt_address1")
|
count, found = keeper.GetAddressAssetCount(ctx, items[1].Creator)
|
||||||
assert.True(t, found)
|
assert.True(t, found)
|
||||||
assert.Equal(t, len(assets), 5)
|
assert.Equal(t, uint64(5), count)
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestGetAssetByAddressAndID(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
keeper, ctx := keepertest.AssetKeeper(t)
|
||||||
|
items := createNAsset(keeper, ctx, 1)
|
||||||
|
cid, found := keeper.GetAssetByAddressAndID(ctx, items[0].Creator, 1)
|
||||||
|
assert.True(t, found)
|
||||||
|
assert.Equal(t, items[0].Cid, cid)
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestGetAssetsByAddress(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
keeper, ctx := keepertest.AssetKeeper(t)
|
||||||
|
items := createNAsset(keeper, ctx, 10)
|
||||||
|
cids, found := keeper.GetAssetsByAddress(ctx, items[0].Creator, nil, nil)
|
||||||
|
assert.True(t, found)
|
||||||
|
assert.Equal(t, items[8].Cid, cids[0])
|
||||||
|
assert.Equal(t, items[4].Cid, cids[2])
|
||||||
|
cids, found = keeper.GetAssetsByAddress(ctx, items[1].Creator, nil, nil)
|
||||||
|
assert.True(t, found)
|
||||||
|
assert.Equal(t, items[9].Cid, cids[0])
|
||||||
|
assert.Equal(t, items[5].Cid, cids[2])
|
||||||
|
|
||||||
|
cids, found = keeper.GetAssetsByAddress(ctx, items[0].Creator, util.SerializeUint64(3), nil)
|
||||||
|
assert.True(t, found)
|
||||||
|
assert.Equal(t, 3, len(cids))
|
||||||
|
assert.Equal(t, items[8].Cid, cids[0])
|
||||||
}
|
}
|
||||||
|
|||||||
18
x/asset/keeper/migrations.go
Normal file
18
x/asset/keeper/migrations.go
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
package keeper
|
||||||
|
|
||||||
|
import (
|
||||||
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
v2 "github.com/planetmint/planetmint-go/x/asset/migrations/v2"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Migrator struct {
|
||||||
|
keeper Keeper
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewMigrator(keeper Keeper) Migrator {
|
||||||
|
return Migrator{keeper: keeper}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m Migrator) Migrate1to2(ctx sdk.Context) error {
|
||||||
|
return v2.MigrateStore(ctx, m.keeper.storeKey, m.keeper.cdc)
|
||||||
|
}
|
||||||
@ -5,6 +5,7 @@ import (
|
|||||||
|
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
"github.com/planetmint/planetmint-go/errormsg"
|
"github.com/planetmint/planetmint-go/errormsg"
|
||||||
|
"github.com/planetmint/planetmint-go/util"
|
||||||
"github.com/planetmint/planetmint-go/x/asset/types"
|
"github.com/planetmint/planetmint-go/x/asset/types"
|
||||||
"google.golang.org/grpc/codes"
|
"google.golang.org/grpc/codes"
|
||||||
"google.golang.org/grpc/status"
|
"google.golang.org/grpc/status"
|
||||||
@ -17,7 +18,7 @@ func (k Keeper) GetCIDsByAddress(goCtx context.Context, req *types.QueryGetCIDsB
|
|||||||
|
|
||||||
ctx := sdk.UnwrapSDKContext(goCtx)
|
ctx := sdk.UnwrapSDKContext(goCtx)
|
||||||
|
|
||||||
cids, found := k.GetCidsByAddress(ctx, req.GetAddress())
|
cids, found := k.GetAssetsByAddress(ctx, req.GetAddress(), nil, util.SerializeUint64(req.GetNumElements()))
|
||||||
if !found {
|
if !found {
|
||||||
return nil, status.Error(codes.NotFound, "no CIDs found")
|
return nil, status.Error(codes.NotFound, "no CIDs found")
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
keepertest "github.com/planetmint/planetmint-go/testutil/keeper"
|
keepertest "github.com/planetmint/planetmint-go/testutil/keeper"
|
||||||
|
"github.com/planetmint/planetmint-go/util"
|
||||||
"github.com/planetmint/planetmint-go/x/asset/types"
|
"github.com/planetmint/planetmint-go/x/asset/types"
|
||||||
"google.golang.org/grpc/codes"
|
"google.golang.org/grpc/codes"
|
||||||
"google.golang.org/grpc/status"
|
"google.golang.org/grpc/status"
|
||||||
@ -16,7 +17,7 @@ func TestGetNotarizedAssetByAddress(t *testing.T) {
|
|||||||
keeper, ctx := keepertest.AssetKeeper(t)
|
keeper, ctx := keepertest.AssetKeeper(t)
|
||||||
wctx := sdk.WrapSDKContext(ctx)
|
wctx := sdk.WrapSDKContext(ctx)
|
||||||
_ = createNAsset(keeper, ctx, 10)
|
_ = createNAsset(keeper, ctx, 10)
|
||||||
assets, _ := keeper.GetCidsByAddress(ctx, "plmnt_address")
|
assets, _ := keeper.GetAssetsByAddress(ctx, "plmnt_address", nil, util.SerializeUint64(3))
|
||||||
for _, tc := range []struct {
|
for _, tc := range []struct {
|
||||||
desc string
|
desc string
|
||||||
request *types.QueryGetCIDsByAddressRequest
|
request *types.QueryGetCIDsByAddressRequest
|
||||||
@ -25,7 +26,7 @@ func TestGetNotarizedAssetByAddress(t *testing.T) {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
desc: "cid found",
|
desc: "cid found",
|
||||||
request: &types.QueryGetCIDsByAddressRequest{Address: "plmnt_address"},
|
request: &types.QueryGetCIDsByAddressRequest{Address: "plmnt_address", NumElements: 3},
|
||||||
response: &types.QueryGetCIDsByAddressResponse{Cids: assets},
|
response: &types.QueryGetCIDsByAddressResponse{Cids: assets},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
39
x/asset/migrations/v2/store.go
Normal file
39
x/asset/migrations/v2/store.go
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
package v2
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/cosmos/cosmos-sdk/codec"
|
||||||
|
"github.com/cosmos/cosmos-sdk/store/prefix"
|
||||||
|
storetypes "github.com/cosmos/cosmos-sdk/store/types"
|
||||||
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
"github.com/planetmint/planetmint-go/util"
|
||||||
|
"github.com/planetmint/planetmint-go/x/asset/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
func MigrateStore(ctx sdk.Context, storeKey storetypes.StoreKey, _ codec.BinaryCodec) error {
|
||||||
|
store := prefix.NewStore(ctx.KVStore(storeKey), types.KeyPrefix(types.AssetKey))
|
||||||
|
|
||||||
|
mapping := make(map[string][][]byte)
|
||||||
|
|
||||||
|
// read all cids
|
||||||
|
iterator := store.Iterator(nil, nil)
|
||||||
|
defer iterator.Close()
|
||||||
|
for ; iterator.Valid(); iterator.Next() {
|
||||||
|
addressBytes := iterator.Value()
|
||||||
|
cidBytes := iterator.Key()
|
||||||
|
|
||||||
|
// map all cids by address
|
||||||
|
mapping[string(addressBytes)] = append(mapping[string(addressBytes)], cidBytes)
|
||||||
|
}
|
||||||
|
|
||||||
|
// store all cids with new key
|
||||||
|
for address, cids := range mapping {
|
||||||
|
assetByAddressStore := prefix.NewStore(ctx.KVStore(storeKey), types.AddressPrefix(address))
|
||||||
|
for i, cid := range cids {
|
||||||
|
assetByAddressStore.Set(util.SerializeUint64(uint64(i)), cid)
|
||||||
|
}
|
||||||
|
addressAssetCountStore := prefix.NewStore(ctx.KVStore(storeKey), types.KeyPrefix(types.AssetKey))
|
||||||
|
addressAssetCountStore.Set(types.AddressCountKey(address), util.SerializeUint64(uint64(len(cids))))
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@ -116,6 +116,11 @@ func NewAppModule(
|
|||||||
func (am AppModule) RegisterServices(cfg module.Configurator) {
|
func (am AppModule) RegisterServices(cfg module.Configurator) {
|
||||||
types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper))
|
types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper))
|
||||||
types.RegisterQueryServer(cfg.QueryServer(), am.keeper)
|
types.RegisterQueryServer(cfg.QueryServer(), am.keeper)
|
||||||
|
|
||||||
|
m := keeper.NewMigrator(am.keeper)
|
||||||
|
if err := cfg.RegisterMigration(types.ModuleName, 1, m.Migrate1to2); err != nil {
|
||||||
|
panic(fmt.Errorf("failed to register migration of %s to v2: %w", types.ModuleName, err))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// RegisterInvariants registers the invariants of the module. If an invariant deviates from its predicted value, the InvariantRegistry triggers appropriate logic (most often the chain will be halted)
|
// RegisterInvariants registers the invariants of the module. If an invariant deviates from its predicted value, the InvariantRegistry triggers appropriate logic (most often the chain will be halted)
|
||||||
@ -141,7 +146,7 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ConsensusVersion is a sequence number for state-breaking change of the module. It should be incremented on each consensus-breaking change introduced by the module. To avoid wrong/empty versions, the initial version should be set to 1
|
// ConsensusVersion is a sequence number for state-breaking change of the module. It should be incremented on each consensus-breaking change introduced by the module. To avoid wrong/empty versions, the initial version should be set to 1
|
||||||
func (AppModule) ConsensusVersion() uint64 { return 1 }
|
func (AppModule) ConsensusVersion() uint64 { return 2 }
|
||||||
|
|
||||||
// BeginBlock contains the logic that is automatically triggered at the beginning of each block
|
// BeginBlock contains the logic that is automatically triggered at the beginning of each block
|
||||||
func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {
|
func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {
|
||||||
|
|||||||
@ -1,313 +0,0 @@
|
|||||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
|
||||||
// source: planetmintgo/asset/asset.proto
|
|
||||||
|
|
||||||
package types
|
|
||||||
|
|
||||||
import (
|
|
||||||
fmt "fmt"
|
|
||||||
proto "github.com/cosmos/gogoproto/proto"
|
|
||||||
io "io"
|
|
||||||
math "math"
|
|
||||||
math_bits "math/bits"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
|
||||||
var _ = proto.Marshal
|
|
||||||
var _ = fmt.Errorf
|
|
||||||
var _ = math.Inf
|
|
||||||
|
|
||||||
// This is a compile-time assertion to ensure that this generated file
|
|
||||||
// is compatible with the proto package it is being compiled against.
|
|
||||||
// A compilation error at this line likely means your copy of the
|
|
||||||
// proto package needs to be updated.
|
|
||||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
|
||||||
|
|
||||||
type Asset struct {
|
|
||||||
Cid string `protobuf:"bytes,1,opt,name=cid,proto3" json:"cid,omitempty"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Asset) Reset() { *m = Asset{} }
|
|
||||||
func (m *Asset) String() string { return proto.CompactTextString(m) }
|
|
||||||
func (*Asset) ProtoMessage() {}
|
|
||||||
func (*Asset) Descriptor() ([]byte, []int) {
|
|
||||||
return fileDescriptor_03dd37a25f684e6e, []int{0}
|
|
||||||
}
|
|
||||||
func (m *Asset) XXX_Unmarshal(b []byte) error {
|
|
||||||
return m.Unmarshal(b)
|
|
||||||
}
|
|
||||||
func (m *Asset) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
||||||
if deterministic {
|
|
||||||
return xxx_messageInfo_Asset.Marshal(b, m, deterministic)
|
|
||||||
} else {
|
|
||||||
b = b[:cap(b)]
|
|
||||||
n, err := m.MarshalToSizedBuffer(b)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return b[:n], nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
func (m *Asset) XXX_Merge(src proto.Message) {
|
|
||||||
xxx_messageInfo_Asset.Merge(m, src)
|
|
||||||
}
|
|
||||||
func (m *Asset) XXX_Size() int {
|
|
||||||
return m.Size()
|
|
||||||
}
|
|
||||||
func (m *Asset) XXX_DiscardUnknown() {
|
|
||||||
xxx_messageInfo_Asset.DiscardUnknown(m)
|
|
||||||
}
|
|
||||||
|
|
||||||
var xxx_messageInfo_Asset proto.InternalMessageInfo
|
|
||||||
|
|
||||||
func (m *Asset) GetCid() string {
|
|
||||||
if m != nil {
|
|
||||||
return m.Cid
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
proto.RegisterType((*Asset)(nil), "planetmintgo.asset.Asset")
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() { proto.RegisterFile("planetmintgo/asset/asset.proto", fileDescriptor_03dd37a25f684e6e) }
|
|
||||||
|
|
||||||
var fileDescriptor_03dd37a25f684e6e = []byte{
|
|
||||||
// 143 bytes of a gzipped FileDescriptorProto
|
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2b, 0xc8, 0x49, 0xcc,
|
|
||||||
0x4b, 0x2d, 0xc9, 0xcd, 0xcc, 0x2b, 0x49, 0xcf, 0xd7, 0x4f, 0x2c, 0x2e, 0x4e, 0x2d, 0x81, 0x90,
|
|
||||||
0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0x42, 0xc8, 0xf2, 0x7a, 0x60, 0x19, 0x25, 0x49, 0x2e,
|
|
||||||
0x56, 0x47, 0x10, 0x43, 0x48, 0x80, 0x8b, 0x39, 0x39, 0x33, 0x45, 0x82, 0x51, 0x81, 0x51, 0x83,
|
|
||||||
0x33, 0x08, 0xc4, 0x74, 0xf2, 0x3e, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f,
|
|
||||||
0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28,
|
|
||||||
0xc3, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x84, 0x99, 0x48, 0x4c,
|
|
||||||
0xdd, 0xf4, 0x7c, 0xfd, 0x0a, 0xa8, 0x0b, 0x4a, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x4e,
|
|
||||||
0x30, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xbc, 0x38, 0x8c, 0xdf, 0xa4, 0x00, 0x00, 0x00,
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Asset) Marshal() (dAtA []byte, err error) {
|
|
||||||
size := m.Size()
|
|
||||||
dAtA = make([]byte, size)
|
|
||||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
return dAtA[:n], nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Asset) MarshalTo(dAtA []byte) (int, error) {
|
|
||||||
size := m.Size()
|
|
||||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *Asset) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
||||||
i := len(dAtA)
|
|
||||||
_ = i
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
if len(m.Cid) > 0 {
|
|
||||||
i -= len(m.Cid)
|
|
||||||
copy(dAtA[i:], m.Cid)
|
|
||||||
i = encodeVarintAsset(dAtA, i, uint64(len(m.Cid)))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0xa
|
|
||||||
}
|
|
||||||
return len(dAtA) - i, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func encodeVarintAsset(dAtA []byte, offset int, v uint64) int {
|
|
||||||
offset -= sovAsset(v)
|
|
||||||
base := offset
|
|
||||||
for v >= 1<<7 {
|
|
||||||
dAtA[offset] = uint8(v&0x7f | 0x80)
|
|
||||||
v >>= 7
|
|
||||||
offset++
|
|
||||||
}
|
|
||||||
dAtA[offset] = uint8(v)
|
|
||||||
return base
|
|
||||||
}
|
|
||||||
func (m *Asset) Size() (n int) {
|
|
||||||
if m == nil {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
var l int
|
|
||||||
_ = l
|
|
||||||
l = len(m.Cid)
|
|
||||||
if l > 0 {
|
|
||||||
n += 1 + l + sovAsset(uint64(l))
|
|
||||||
}
|
|
||||||
return n
|
|
||||||
}
|
|
||||||
|
|
||||||
func sovAsset(x uint64) (n int) {
|
|
||||||
return (math_bits.Len64(x|1) + 6) / 7
|
|
||||||
}
|
|
||||||
func sozAsset(x uint64) (n int) {
|
|
||||||
return sovAsset(uint64((x << 1) ^ uint64((int64(x) >> 63))))
|
|
||||||
}
|
|
||||||
func (m *Asset) Unmarshal(dAtA []byte) error {
|
|
||||||
l := len(dAtA)
|
|
||||||
iNdEx := 0
|
|
||||||
for iNdEx < l {
|
|
||||||
preIndex := iNdEx
|
|
||||||
var wire uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowAsset
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
wire |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fieldNum := int32(wire >> 3)
|
|
||||||
wireType := int(wire & 0x7)
|
|
||||||
if wireType == 4 {
|
|
||||||
return fmt.Errorf("proto: Asset: wiretype end group for non-group")
|
|
||||||
}
|
|
||||||
if fieldNum <= 0 {
|
|
||||||
return fmt.Errorf("proto: Asset: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
||||||
}
|
|
||||||
switch fieldNum {
|
|
||||||
case 1:
|
|
||||||
if wireType != 2 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Cid", wireType)
|
|
||||||
}
|
|
||||||
var stringLen uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowAsset
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
stringLen |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
intStringLen := int(stringLen)
|
|
||||||
if intStringLen < 0 {
|
|
||||||
return ErrInvalidLengthAsset
|
|
||||||
}
|
|
||||||
postIndex := iNdEx + intStringLen
|
|
||||||
if postIndex < 0 {
|
|
||||||
return ErrInvalidLengthAsset
|
|
||||||
}
|
|
||||||
if postIndex > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
m.Cid = string(dAtA[iNdEx:postIndex])
|
|
||||||
iNdEx = postIndex
|
|
||||||
default:
|
|
||||||
iNdEx = preIndex
|
|
||||||
skippy, err := skipAsset(dAtA[iNdEx:])
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
||||||
return ErrInvalidLengthAsset
|
|
||||||
}
|
|
||||||
if (iNdEx + skippy) > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
iNdEx += skippy
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if iNdEx > l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
func skipAsset(dAtA []byte) (n int, err error) {
|
|
||||||
l := len(dAtA)
|
|
||||||
iNdEx := 0
|
|
||||||
depth := 0
|
|
||||||
for iNdEx < l {
|
|
||||||
var wire uint64
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return 0, ErrIntOverflowAsset
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
wire |= (uint64(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
wireType := int(wire & 0x7)
|
|
||||||
switch wireType {
|
|
||||||
case 0:
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return 0, ErrIntOverflowAsset
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
iNdEx++
|
|
||||||
if dAtA[iNdEx-1] < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
case 1:
|
|
||||||
iNdEx += 8
|
|
||||||
case 2:
|
|
||||||
var length int
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return 0, ErrIntOverflowAsset
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
length |= (int(b) & 0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if length < 0 {
|
|
||||||
return 0, ErrInvalidLengthAsset
|
|
||||||
}
|
|
||||||
iNdEx += length
|
|
||||||
case 3:
|
|
||||||
depth++
|
|
||||||
case 4:
|
|
||||||
if depth == 0 {
|
|
||||||
return 0, ErrUnexpectedEndOfGroupAsset
|
|
||||||
}
|
|
||||||
depth--
|
|
||||||
case 5:
|
|
||||||
iNdEx += 4
|
|
||||||
default:
|
|
||||||
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
|
|
||||||
}
|
|
||||||
if iNdEx < 0 {
|
|
||||||
return 0, ErrInvalidLengthAsset
|
|
||||||
}
|
|
||||||
if depth == 0 {
|
|
||||||
return iNdEx, nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0, io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
|
|
||||||
var (
|
|
||||||
ErrInvalidLengthAsset = fmt.Errorf("proto: negative length found during unmarshaling")
|
|
||||||
ErrIntOverflowAsset = fmt.Errorf("proto: integer overflow")
|
|
||||||
ErrUnexpectedEndOfGroupAsset = fmt.Errorf("proto: unexpected end of group")
|
|
||||||
)
|
|
||||||
@ -14,8 +14,23 @@ const (
|
|||||||
MemStoreKey = "mem_asset"
|
MemStoreKey = "mem_asset"
|
||||||
|
|
||||||
AssetKey = "Asset/value/"
|
AssetKey = "Asset/value/"
|
||||||
|
CountKey = "count/"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func AddressCountKey(address string) (prefix []byte) {
|
||||||
|
addressPrefix := AddressPrefix(address)
|
||||||
|
prefix = append(prefix, addressPrefix...)
|
||||||
|
prefix = append(prefix, []byte(CountKey)...)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func AddressPrefix(address string) (prefix []byte) {
|
||||||
|
addressBytes := []byte(address)
|
||||||
|
prefix = append(prefix, addressBytes...)
|
||||||
|
prefix = append(prefix, []byte("/")...)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func KeyPrefix(p string) []byte {
|
func KeyPrefix(p string) []byte {
|
||||||
return []byte(p)
|
return []byte(p)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -114,9 +114,9 @@ func (m *QueryParamsResponse) GetParams() Params {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type QueryGetCIDsByAddressRequest struct {
|
type QueryGetCIDsByAddressRequest struct {
|
||||||
Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
|
Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
|
||||||
LookupPeriodInMin uint64 `protobuf:"varint,2,opt,name=lookupPeriodInMin,proto3" json:"lookupPeriodInMin,omitempty"`
|
NumElements uint64 `protobuf:"varint,2,opt,name=numElements,proto3" json:"numElements,omitempty"`
|
||||||
Pagination *query.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"`
|
Pagination *query.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *QueryGetCIDsByAddressRequest) Reset() { *m = QueryGetCIDsByAddressRequest{} }
|
func (m *QueryGetCIDsByAddressRequest) Reset() { *m = QueryGetCIDsByAddressRequest{} }
|
||||||
@ -159,9 +159,9 @@ func (m *QueryGetCIDsByAddressRequest) GetAddress() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *QueryGetCIDsByAddressRequest) GetLookupPeriodInMin() uint64 {
|
func (m *QueryGetCIDsByAddressRequest) GetNumElements() uint64 {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
return m.LookupPeriodInMin
|
return m.NumElements
|
||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -333,42 +333,41 @@ func init() {
|
|||||||
func init() { proto.RegisterFile("planetmintgo/asset/query.proto", fileDescriptor_5832a953a81817c0) }
|
func init() { proto.RegisterFile("planetmintgo/asset/query.proto", fileDescriptor_5832a953a81817c0) }
|
||||||
|
|
||||||
var fileDescriptor_5832a953a81817c0 = []byte{
|
var fileDescriptor_5832a953a81817c0 = []byte{
|
||||||
// 547 bytes of a gzipped FileDescriptorProto
|
// 541 bytes of a gzipped FileDescriptorProto
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xcf, 0x6e, 0xd3, 0x30,
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0xcf, 0x6e, 0xd3, 0x30,
|
||||||
0x18, 0x6f, 0xda, 0x52, 0x34, 0x73, 0xd9, 0xcc, 0x0e, 0x51, 0xd8, 0xb2, 0x2a, 0x48, 0x5b, 0x85,
|
0x18, 0x6f, 0xda, 0x51, 0x34, 0xef, 0x32, 0xcc, 0x0e, 0x51, 0xd8, 0xb2, 0x2a, 0x48, 0x5b, 0x85,
|
||||||
0x20, 0x26, 0xe5, 0x00, 0x9c, 0xd0, 0x0a, 0x62, 0x9a, 0xf8, 0x57, 0x72, 0xe4, 0xe6, 0x26, 0x56,
|
0x44, 0x4c, 0xba, 0x0b, 0x1c, 0x57, 0xfe, 0x4c, 0x08, 0x04, 0x23, 0x47, 0x6e, 0x6e, 0x62, 0x05,
|
||||||
0xb0, 0x68, 0xed, 0x2c, 0x76, 0x11, 0xa5, 0xf4, 0xc2, 0x13, 0x20, 0xf1, 0x00, 0xbc, 0x01, 0x67,
|
0x4b, 0x8d, 0x9d, 0xc5, 0x2e, 0xa2, 0x94, 0x5e, 0x78, 0x02, 0x24, 0x1e, 0x00, 0x89, 0x47, 0xe0,
|
||||||
0x1e, 0x61, 0xc7, 0x49, 0x5c, 0x38, 0x21, 0x68, 0x79, 0x10, 0x14, 0xdb, 0x55, 0x1b, 0xd2, 0x32,
|
0x29, 0x76, 0x9c, 0xc4, 0x05, 0x09, 0x09, 0xa1, 0x96, 0x07, 0x41, 0xb1, 0x5d, 0x35, 0x21, 0x2d,
|
||||||
0xed, 0xf6, 0xd5, 0xdf, 0xf7, 0xfb, 0xd3, 0xdf, 0xf7, 0x29, 0xc0, 0x4d, 0xfb, 0x98, 0x11, 0x39,
|
0xd3, 0x6e, 0x5f, 0xec, 0xef, 0xf7, 0xc7, 0xbf, 0xef, 0x53, 0x80, 0x9b, 0x0d, 0x31, 0x23, 0x32,
|
||||||
0xa0, 0x4c, 0x26, 0x1c, 0x61, 0x21, 0x88, 0x44, 0x27, 0x43, 0x92, 0x8d, 0xfc, 0x34, 0xe3, 0x92,
|
0xa5, 0x4c, 0x26, 0x1c, 0x61, 0x21, 0x88, 0x44, 0x67, 0x23, 0x92, 0x8f, 0xfd, 0x2c, 0xe7, 0x92,
|
||||||
0x43, 0xb8, 0xdc, 0xf7, 0x55, 0xdf, 0xd9, 0x4e, 0x78, 0xc2, 0x55, 0x1b, 0xe5, 0x95, 0x9e, 0x74,
|
0x43, 0x58, 0xbe, 0xf7, 0xd5, 0xbd, 0xb3, 0x93, 0xf0, 0x84, 0xab, 0x6b, 0x54, 0x54, 0xba, 0xd3,
|
||||||
0x76, 0x12, 0xce, 0x93, 0x3e, 0x41, 0x38, 0xa5, 0x08, 0x33, 0xc6, 0x25, 0x96, 0x94, 0x33, 0x61,
|
0xd9, 0x4d, 0x38, 0x4f, 0x86, 0x04, 0xe1, 0x8c, 0x22, 0xcc, 0x18, 0x97, 0x58, 0x52, 0xce, 0x84,
|
||||||
0xba, 0x37, 0x22, 0x2e, 0x06, 0x5c, 0xa0, 0x1e, 0x16, 0x44, 0x0b, 0xa0, 0xb7, 0x41, 0x8f, 0x48,
|
0xb9, 0xbd, 0x13, 0x71, 0x91, 0x72, 0x81, 0x06, 0x58, 0x10, 0x2d, 0x80, 0xde, 0x06, 0x03, 0x22,
|
||||||
0x1c, 0xa0, 0x14, 0x27, 0x94, 0xa9, 0x61, 0x33, 0xbb, 0xb7, 0xc2, 0x53, 0x8a, 0x33, 0x3c, 0x30,
|
0x71, 0x80, 0x32, 0x9c, 0x50, 0xa6, 0x9a, 0x4d, 0xef, 0xfe, 0x0a, 0x4f, 0x19, 0xce, 0x71, 0x6a,
|
||||||
0x64, 0xde, 0x36, 0x80, 0x2f, 0x73, 0x8a, 0xae, 0x7a, 0x0c, 0xc9, 0xc9, 0x90, 0x08, 0xe9, 0xbd,
|
0xc8, 0xbc, 0x1d, 0x00, 0x5f, 0x15, 0x14, 0xa7, 0xea, 0x30, 0x24, 0x67, 0x23, 0x22, 0xa4, 0xf7,
|
||||||
0x00, 0x57, 0x0b, 0xaf, 0x22, 0xe5, 0x4c, 0x10, 0x78, 0x0f, 0x34, 0x34, 0xd8, 0xb6, 0x9a, 0x56,
|
0x12, 0xdc, 0xac, 0x9c, 0x8a, 0x8c, 0x33, 0x41, 0xe0, 0x7d, 0xd0, 0xd6, 0x60, 0xdb, 0xea, 0x58,
|
||||||
0xeb, 0x4a, 0xdb, 0xf1, 0xcb, 0x7f, 0xc9, 0xd7, 0x98, 0x4e, 0xfd, 0xf4, 0xe7, 0x5e, 0x25, 0x34,
|
0xdd, 0xad, 0x9e, 0xe3, 0xd7, 0x9f, 0xe4, 0x6b, 0x4c, 0x7f, 0xe3, 0xfc, 0xd7, 0x7e, 0x23, 0x34,
|
||||||
0xf3, 0xde, 0x57, 0x0b, 0xec, 0x28, 0xc6, 0x23, 0x22, 0x1f, 0x1e, 0x3f, 0x12, 0x9d, 0xd1, 0x61,
|
0xfd, 0xde, 0x57, 0x0b, 0xec, 0x2a, 0xc6, 0x13, 0x22, 0x1f, 0x3e, 0x7d, 0x24, 0xfa, 0xe3, 0xe3,
|
||||||
0x1c, 0x67, 0x44, 0xcc, 0x15, 0xa1, 0x0d, 0x2e, 0x63, 0xfd, 0xa2, 0xb8, 0x37, 0xc2, 0xf9, 0x4f,
|
0x38, 0xce, 0x89, 0x58, 0x28, 0x42, 0x1b, 0x5c, 0xc7, 0xfa, 0x44, 0x71, 0x6f, 0x86, 0x8b, 0x4f,
|
||||||
0x78, 0x13, 0x6c, 0xf5, 0x39, 0x7f, 0x33, 0x4c, 0xbb, 0x24, 0xa3, 0x3c, 0x3e, 0x66, 0xcf, 0x28,
|
0xd8, 0x01, 0x5b, 0x6c, 0x94, 0x3e, 0x1e, 0x92, 0x94, 0x30, 0x29, 0xec, 0x66, 0xc7, 0xea, 0x6e,
|
||||||
0xb3, 0xab, 0x4d, 0xab, 0x55, 0x0f, 0xcb, 0x0d, 0xf8, 0x18, 0x80, 0x45, 0x08, 0x76, 0x4d, 0xd9,
|
0x84, 0xe5, 0x23, 0xf8, 0x04, 0x80, 0xe5, 0xc3, 0xed, 0x96, 0xb2, 0x76, 0xe0, 0xeb, 0x94, 0xfc,
|
||||||
0xdc, 0xf7, 0x75, 0x62, 0x7e, 0x9e, 0x98, 0xaf, 0x57, 0x62, 0x12, 0xf3, 0xbb, 0x38, 0x21, 0xc6,
|
0x22, 0x25, 0x5f, 0x8f, 0xc1, 0xa4, 0xe4, 0x9f, 0xe2, 0x84, 0x18, 0xdd, 0xb0, 0x84, 0xf4, 0x3e,
|
||||||
0x43, 0xb8, 0x84, 0xf4, 0x3e, 0x80, 0xdd, 0x35, 0x7e, 0x4d, 0x16, 0x10, 0xd4, 0x23, 0x1a, 0xe7,
|
0x80, 0xbd, 0x35, 0x1e, 0xcd, 0xfb, 0x21, 0xd8, 0x88, 0x68, 0x5c, 0x38, 0x6c, 0x75, 0x37, 0x43,
|
||||||
0x6e, 0x6b, 0xad, 0x8d, 0x50, 0xd5, 0xf0, 0xa8, 0x20, 0x5e, 0x55, 0xe2, 0x07, 0xe7, 0x8a, 0x6b,
|
0x55, 0xc3, 0x93, 0x8a, 0x78, 0x53, 0x89, 0x1f, 0x5e, 0x2a, 0xae, 0x09, 0x2b, 0xea, 0xc1, 0x52,
|
||||||
0xc2, 0x82, 0x7a, 0xb0, 0x50, 0x7f, 0xce, 0x25, 0xce, 0xe8, 0x7b, 0x12, 0x1f, 0xe6, 0xe9, 0xce,
|
0xfd, 0x05, 0x97, 0x38, 0xa7, 0xef, 0x49, 0x7c, 0x5c, 0x24, 0xba, 0x88, 0x68, 0x1b, 0xb4, 0x22,
|
||||||
0xe3, 0xda, 0x04, 0xb5, 0x88, 0xc6, 0x26, 0xaa, 0xbc, 0xf4, 0x9e, 0x02, 0x77, 0x1d, 0xc4, 0x38,
|
0x1a, 0x9b, 0x78, 0x8a, 0xd2, 0x7b, 0x0e, 0xdc, 0x75, 0x10, 0xe3, 0xb8, 0x86, 0x29, 0x07, 0xdd,
|
||||||
0x2e, 0x61, 0x96, 0x43, 0xaf, 0x16, 0x42, 0x6f, 0xff, 0xae, 0x81, 0x4b, 0x8a, 0x0e, 0x8e, 0x41,
|
0xac, 0x04, 0xdd, 0xfb, 0xd9, 0x02, 0xd7, 0x14, 0x1d, 0x9c, 0x80, 0xb6, 0x9e, 0x22, 0x3c, 0x58,
|
||||||
0x43, 0x6f, 0x14, 0xee, 0xaf, 0xda, 0x76, 0xf9, 0x78, 0x9c, 0x83, 0x73, 0xe7, 0xb4, 0x21, 0xaf,
|
0x35, 0xe1, 0xfa, 0xc2, 0x38, 0x87, 0x97, 0xf6, 0x69, 0x43, 0x5e, 0xe7, 0xe3, 0xf7, 0x3f, 0x9f,
|
||||||
0xf9, 0xf1, 0xfb, 0x9f, 0xcf, 0x55, 0x07, 0xda, 0x68, 0x01, 0x28, 0xdc, 0x28, 0xfc, 0x66, 0x81,
|
0x9b, 0x0e, 0xb4, 0xd1, 0x12, 0x50, 0xd9, 0x4b, 0xf8, 0xcd, 0x02, 0xdb, 0xff, 0x4e, 0x00, 0xde,
|
||||||
0xcd, 0x7f, 0x37, 0x00, 0x6f, 0xaf, 0xe5, 0x5f, 0x73, 0x5c, 0x4e, 0x70, 0x01, 0x84, 0xf1, 0xf6,
|
0x5b, 0xcb, 0xbf, 0x66, 0xa1, 0x9c, 0xe0, 0x0a, 0x08, 0xe3, 0xed, 0x81, 0xf2, 0x76, 0x04, 0x83,
|
||||||
0x40, 0x79, 0xbb, 0x0f, 0xef, 0x96, 0xbd, 0x99, 0x8c, 0xd0, 0xd8, 0x14, 0x13, 0x34, 0x2e, 0xdd,
|
0xba, 0x37, 0x93, 0x11, 0x9a, 0x98, 0x62, 0x8a, 0x26, 0xa5, 0x0d, 0x9c, 0xc2, 0x2f, 0x16, 0xb8,
|
||||||
0xe1, 0x04, 0x7e, 0xb1, 0xc0, 0x56, 0x69, 0x17, 0xf0, 0xbf, 0x4e, 0x56, 0xae, 0xda, 0x69, 0x5f,
|
0x51, 0x9b, 0x02, 0xfc, 0xaf, 0x87, 0x95, 0x43, 0x76, 0x7a, 0x57, 0x81, 0x18, 0xdf, 0xb7, 0x95,
|
||||||
0x04, 0x62, 0xdc, 0x5f, 0x57, 0xee, 0x77, 0xe1, 0xb5, 0xb2, 0xfb, 0x88, 0xc6, 0x68, 0x1c, 0xd1,
|
0xef, 0x3d, 0x78, 0xab, 0xee, 0x3b, 0xa2, 0x31, 0x9a, 0x44, 0x34, 0x9e, 0xf6, 0x9f, 0x9d, 0xcf,
|
||||||
0x78, 0xd2, 0x79, 0x72, 0x3a, 0x75, 0xad, 0xb3, 0xa9, 0x6b, 0xfd, 0x9a, 0xba, 0xd6, 0xa7, 0x99,
|
0x5c, 0xeb, 0x62, 0xe6, 0x5a, 0xbf, 0x67, 0xae, 0xf5, 0x69, 0xee, 0x36, 0x2e, 0xe6, 0x6e, 0xe3,
|
||||||
0x5b, 0x39, 0x9b, 0xb9, 0x95, 0x1f, 0x33, 0xb7, 0xf2, 0x2a, 0x48, 0xa8, 0x7c, 0x3d, 0xec, 0xf9,
|
0xc7, 0xdc, 0x6d, 0xbc, 0x0e, 0x12, 0x2a, 0xdf, 0x8c, 0x06, 0x7e, 0xc4, 0xd3, 0x32, 0xc1, 0xb2,
|
||||||
0x11, 0x1f, 0x2c, 0x13, 0x2c, 0xca, 0x5b, 0x09, 0x47, 0xef, 0x0c, 0xa1, 0x1c, 0xa5, 0x44, 0xf4,
|
0xbc, 0x9b, 0x70, 0xf4, 0xce, 0x10, 0xca, 0x71, 0x46, 0xc4, 0xa0, 0xad, 0x7e, 0x1e, 0x47, 0x7f,
|
||||||
0x1a, 0xea, 0x73, 0x72, 0xe7, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x76, 0xa1, 0xdb, 0x5c, 0x05,
|
0x03, 0x00, 0x00, 0xff, 0xff, 0xb3, 0x7e, 0xf6, 0x2a, 0xf3, 0x04, 0x00, 0x00,
|
||||||
0x05, 0x00, 0x00,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
@ -617,8 +616,8 @@ func (m *QueryGetCIDsByAddressRequest) MarshalToSizedBuffer(dAtA []byte) (int, e
|
|||||||
i--
|
i--
|
||||||
dAtA[i] = 0x1a
|
dAtA[i] = 0x1a
|
||||||
}
|
}
|
||||||
if m.LookupPeriodInMin != 0 {
|
if m.NumElements != 0 {
|
||||||
i = encodeVarintQuery(dAtA, i, uint64(m.LookupPeriodInMin))
|
i = encodeVarintQuery(dAtA, i, uint64(m.NumElements))
|
||||||
i--
|
i--
|
||||||
dAtA[i] = 0x10
|
dAtA[i] = 0x10
|
||||||
}
|
}
|
||||||
@ -784,8 +783,8 @@ func (m *QueryGetCIDsByAddressRequest) Size() (n int) {
|
|||||||
if l > 0 {
|
if l > 0 {
|
||||||
n += 1 + l + sovQuery(uint64(l))
|
n += 1 + l + sovQuery(uint64(l))
|
||||||
}
|
}
|
||||||
if m.LookupPeriodInMin != 0 {
|
if m.NumElements != 0 {
|
||||||
n += 1 + sovQuery(uint64(m.LookupPeriodInMin))
|
n += 1 + sovQuery(uint64(m.NumElements))
|
||||||
}
|
}
|
||||||
if m.Pagination != nil {
|
if m.Pagination != nil {
|
||||||
l = m.Pagination.Size()
|
l = m.Pagination.Size()
|
||||||
@ -1045,9 +1044,9 @@ func (m *QueryGetCIDsByAddressRequest) Unmarshal(dAtA []byte) error {
|
|||||||
iNdEx = postIndex
|
iNdEx = postIndex
|
||||||
case 2:
|
case 2:
|
||||||
if wireType != 0 {
|
if wireType != 0 {
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field LookupPeriodInMin", wireType)
|
return fmt.Errorf("proto: wrong wireType = %d for field NumElements", wireType)
|
||||||
}
|
}
|
||||||
m.LookupPeriodInMin = 0
|
m.NumElements = 0
|
||||||
for shift := uint(0); ; shift += 7 {
|
for shift := uint(0); ; shift += 7 {
|
||||||
if shift >= 64 {
|
if shift >= 64 {
|
||||||
return ErrIntOverflowQuery
|
return ErrIntOverflowQuery
|
||||||
@ -1057,7 +1056,7 @@ func (m *QueryGetCIDsByAddressRequest) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
b := dAtA[iNdEx]
|
b := dAtA[iNdEx]
|
||||||
iNdEx++
|
iNdEx++
|
||||||
m.LookupPeriodInMin |= uint64(b&0x7F) << shift
|
m.NumElements |= uint64(b&0x7F) << shift
|
||||||
if b < 0x80 {
|
if b < 0x80 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,7 +52,7 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal
|
|||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
filter_Query_GetCIDsByAddress_0 = &utilities.DoubleArray{Encoding: map[string]int{"address": 0, "lookupPeriodInMin": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}}
|
filter_Query_GetCIDsByAddress_0 = &utilities.DoubleArray{Encoding: map[string]int{"address": 0, "numElements": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}}
|
||||||
)
|
)
|
||||||
|
|
||||||
func request_Query_GetCIDsByAddress_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
func request_Query_GetCIDsByAddress_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||||
@ -77,15 +77,15 @@ func request_Query_GetCIDsByAddress_0(ctx context.Context, marshaler runtime.Mar
|
|||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
val, ok = pathParams["lookupPeriodInMin"]
|
val, ok = pathParams["numElements"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "lookupPeriodInMin")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "numElements")
|
||||||
}
|
}
|
||||||
|
|
||||||
protoReq.LookupPeriodInMin, err = runtime.Uint64(val)
|
protoReq.NumElements, err = runtime.Uint64(val)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "lookupPeriodInMin", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "numElements", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := req.ParseForm(); err != nil {
|
if err := req.ParseForm(); err != nil {
|
||||||
@ -122,15 +122,15 @@ func local_request_Query_GetCIDsByAddress_0(ctx context.Context, marshaler runti
|
|||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "address", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
val, ok = pathParams["lookupPeriodInMin"]
|
val, ok = pathParams["numElements"]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "lookupPeriodInMin")
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "numElements")
|
||||||
}
|
}
|
||||||
|
|
||||||
protoReq.LookupPeriodInMin, err = runtime.Uint64(val)
|
protoReq.NumElements, err = runtime.Uint64(val)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "lookupPeriodInMin", err)
|
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "numElements", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := req.ParseForm(); err != nil {
|
if err := req.ParseForm(); err != nil {
|
||||||
@ -381,7 +381,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
|
|||||||
var (
|
var (
|
||||||
pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"planetmint", "asset", "params"}, "", runtime.AssumeColonVerbOpt(true)))
|
pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"planetmint", "asset", "params"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||||
|
|
||||||
pattern_Query_GetCIDsByAddress_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 2, 1, 0, 4, 1, 5, 3}, []string{"planetmint", "asset", "address", "lookupPeriodInMin"}, "", runtime.AssumeColonVerbOpt(true)))
|
pattern_Query_GetCIDsByAddress_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 2, 1, 0, 4, 1, 5, 3}, []string{"planetmint", "asset", "address", "numElements"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||||
|
|
||||||
pattern_Query_GetNotarizedAsset_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 2}, []string{"planetmint", "asset", "cid"}, "", runtime.AssumeColonVerbOpt(true)))
|
pattern_Query_GetNotarizedAsset_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 2}, []string{"planetmint", "asset", "cid"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||||
)
|
)
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package dao
|
|||||||
import (
|
import (
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
|
|
||||||
|
"github.com/planetmint/planetmint-go/monitor"
|
||||||
"github.com/planetmint/planetmint-go/util"
|
"github.com/planetmint/planetmint-go/util"
|
||||||
"github.com/planetmint/planetmint-go/x/dao/keeper"
|
"github.com/planetmint/planetmint-go/x/dao/keeper"
|
||||||
|
|
||||||
@ -23,7 +24,14 @@ func BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock, k keeper.Keeper)
|
|||||||
hexProposerAddress := hex.EncodeToString(proposerAddress)
|
hexProposerAddress := hex.EncodeToString(proposerAddress)
|
||||||
if isPopHeight(ctx, k, currentBlockHeight) {
|
if isPopHeight(ctx, k, currentBlockHeight) {
|
||||||
// select PoP participants
|
// select PoP participants
|
||||||
challenger, challengee := k.SelectPopParticipants(ctx)
|
challenger, challengee, err := monitor.SelectPoPParticipantsOutOfActiveActors()
|
||||||
|
if err != nil {
|
||||||
|
util.GetAppLogger().Error(ctx, "error during PoP Participant selection ", err)
|
||||||
|
}
|
||||||
|
if err != nil || challenger == "" || challengee == "" {
|
||||||
|
challenger = ""
|
||||||
|
challengee = ""
|
||||||
|
}
|
||||||
|
|
||||||
// Init PoP - independent from challenger and challengee
|
// Init PoP - independent from challenger and challengee
|
||||||
// The keeper will send the MQTT initializing message to challenger && challengee
|
// The keeper will send the MQTT initializing message to challenger && challengee
|
||||||
|
|||||||
@ -19,12 +19,6 @@ func CmdCreateRedeemClaim() *cobra.Command {
|
|||||||
// Get indexes
|
// Get indexes
|
||||||
indexBeneficiary := args[0]
|
indexBeneficiary := args[0]
|
||||||
|
|
||||||
// Get value arguments
|
|
||||||
argAmount, err := strconv.ParseUint(args[1], 10, 64)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
clientCtx, err := client.GetClientTxContext(cmd)
|
clientCtx, err := client.GetClientTxContext(cmd)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -33,7 +27,6 @@ func CmdCreateRedeemClaim() *cobra.Command {
|
|||||||
msg := types.NewMsgCreateRedeemClaim(
|
msg := types.NewMsgCreateRedeemClaim(
|
||||||
clientCtx.GetFromAddress().String(),
|
clientCtx.GetFromAddress().String(),
|
||||||
indexBeneficiary,
|
indexBeneficiary,
|
||||||
argAmount,
|
|
||||||
)
|
)
|
||||||
if err := msg.ValidateBasic(); err != nil {
|
if err := msg.ValidateBasic(); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
@ -1,16 +1,13 @@
|
|||||||
package keeper
|
package keeper
|
||||||
|
|
||||||
import (
|
import (
|
||||||
db "github.com/cometbft/cometbft-db"
|
|
||||||
"github.com/cometbft/cometbft/libs/log"
|
"github.com/cometbft/cometbft/libs/log"
|
||||||
"github.com/cosmos/cosmos-sdk/codec"
|
"github.com/cosmos/cosmos-sdk/codec"
|
||||||
"github.com/cosmos/cosmos-sdk/store/prefix"
|
|
||||||
storetypes "github.com/cosmos/cosmos-sdk/store/types"
|
storetypes "github.com/cosmos/cosmos-sdk/store/types"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
|
||||||
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
|
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
|
||||||
|
|
||||||
"github.com/planetmint/planetmint-go/util"
|
"github.com/planetmint/planetmint-go/monitor"
|
||||||
"github.com/planetmint/planetmint-go/x/dao/types"
|
"github.com/planetmint/planetmint-go/x/dao/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -53,7 +50,7 @@ func NewKeeper(
|
|||||||
if !ps.HasKeyTable() {
|
if !ps.HasKeyTable() {
|
||||||
ps = ps.WithKeyTable(types.ParamKeyTable())
|
ps = ps.WithKeyTable(types.ParamKeyTable())
|
||||||
}
|
}
|
||||||
|
monitor.LazyMqttMonitorLoader(rootDir)
|
||||||
return &Keeper{
|
return &Keeper{
|
||||||
cdc: cdc,
|
cdc: cdc,
|
||||||
storeKey: storeKey,
|
storeKey: storeKey,
|
||||||
@ -75,57 +72,3 @@ func NewKeeper(
|
|||||||
func (k Keeper) Logger(ctx sdk.Context) log.Logger {
|
func (k Keeper) Logger(ctx sdk.Context) log.Logger {
|
||||||
return ctx.Logger().With("module", "x/"+types.ModuleName)
|
return ctx.Logger().With("module", "x/"+types.ModuleName)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (k Keeper) SelectPopParticipants(ctx sdk.Context) (challenger string, challengee string) {
|
|
||||||
var startAccountNumber uint64
|
|
||||||
lastPopHeight := ctx.BlockHeight() - k.GetParams(ctx).PopEpochs
|
|
||||||
lastPop, found := k.LookupChallenge(ctx, lastPopHeight)
|
|
||||||
if lastPopHeight > 0 && found && lastPop.Challengee != "" {
|
|
||||||
lastAccountAddr := sdk.MustAccAddressFromBech32(lastPop.Challengee)
|
|
||||||
lastAccount := k.accountKeeper.GetAccount(ctx, lastAccountAddr)
|
|
||||||
startAccountNumber = lastAccount.GetAccountNumber() + 1
|
|
||||||
}
|
|
||||||
|
|
||||||
var participants []sdk.AccAddress
|
|
||||||
k.iterateAccountsForMachines(ctx, startAccountNumber, &participants, true)
|
|
||||||
if len(participants) != 2 {
|
|
||||||
k.iterateAccountsForMachines(ctx, startAccountNumber, &participants, false)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Not enough participants
|
|
||||||
if len(participants) != 2 {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
challenger = participants[0].String()
|
|
||||||
challengee = participants[1].String()
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (k Keeper) iterateAccountsForMachines(ctx sdk.Context, start uint64, participants *[]sdk.AccAddress, iterateFromStart bool) {
|
|
||||||
store := ctx.KVStore(k.accountKeeperKey)
|
|
||||||
accountStore := prefix.NewStore(store, authtypes.AccountNumberStoreKeyPrefix)
|
|
||||||
var iterator db.Iterator
|
|
||||||
if iterateFromStart {
|
|
||||||
iterator = accountStore.Iterator(sdk.Uint64ToBigEndian(start), nil)
|
|
||||||
} else {
|
|
||||||
iterator = accountStore.Iterator(nil, sdk.Uint64ToBigEndian(start))
|
|
||||||
}
|
|
||||||
defer iterator.Close()
|
|
||||||
|
|
||||||
for ; iterator.Valid(); iterator.Next() {
|
|
||||||
participant := sdk.AccAddress(iterator.Value())
|
|
||||||
_, found := k.machineKeeper.GetMachineIndexByAddress(ctx, participant.String())
|
|
||||||
if found {
|
|
||||||
available, err := util.GetMqttStatusOfParticipant(participant.String(), k.GetParams(ctx).MqttResponseTimeout)
|
|
||||||
if err == nil && available {
|
|
||||||
*participants = append(*participants, participant)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(*participants) == 2 {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@ -7,12 +7,12 @@ import (
|
|||||||
errorsmod "cosmossdk.io/errors"
|
errorsmod "cosmossdk.io/errors"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
||||||
|
"github.com/planetmint/planetmint-go/clients"
|
||||||
"github.com/planetmint/planetmint-go/util"
|
"github.com/planetmint/planetmint-go/util"
|
||||||
"github.com/planetmint/planetmint-go/x/dao/types"
|
"github.com/planetmint/planetmint-go/x/dao/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
redeemClaimContext = "redeem claim: "
|
|
||||||
createRedeemClaimTag = "create redeem claim: "
|
createRedeemClaimTag = "create redeem claim: "
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -20,18 +20,16 @@ func (k msgServer) CreateRedeemClaim(goCtx context.Context, msg *types.MsgCreate
|
|||||||
ctx := sdk.UnwrapSDKContext(goCtx)
|
ctx := sdk.UnwrapSDKContext(goCtx)
|
||||||
params := k.GetParams(ctx)
|
params := k.GetParams(ctx)
|
||||||
|
|
||||||
err := k.validateCreateRedeemClaim(ctx, msg)
|
addr := sdk.MustAccAddressFromBech32(msg.Creator)
|
||||||
if err != nil {
|
burnCoins := k.bankKeeper.GetBalance(ctx, addr, params.ClaimDenom)
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
var redeemClaim = types.RedeemClaim{
|
var redeemClaim = types.RedeemClaim{
|
||||||
Creator: msg.Creator,
|
Creator: msg.Creator,
|
||||||
Beneficiary: msg.Beneficiary,
|
Beneficiary: msg.Beneficiary,
|
||||||
Amount: msg.Amount,
|
Amount: burnCoins.Amount.Uint64(),
|
||||||
}
|
}
|
||||||
|
|
||||||
err = k.burnClaimAmount(ctx, sdk.MustAccAddressFromBech32(msg.Creator), msg.Amount)
|
err := k.burnClaimAmount(ctx, sdk.MustAccAddressFromBech32(msg.Creator), sdk.NewCoins(burnCoins))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
util.GetAppLogger().Error(ctx, createRedeemClaimTag+"could not burn claim")
|
util.GetAppLogger().Error(ctx, createRedeemClaimTag+"could not burn claim")
|
||||||
}
|
}
|
||||||
@ -42,30 +40,12 @@ func (k msgServer) CreateRedeemClaim(goCtx context.Context, msg *types.MsgCreate
|
|||||||
)
|
)
|
||||||
|
|
||||||
if util.IsValidatorBlockProposer(ctx, ctx.BlockHeader().ProposerAddress, k.RootDir) {
|
if util.IsValidatorBlockProposer(ctx, ctx.BlockHeader().ProposerAddress, k.RootDir) {
|
||||||
util.GetAppLogger().Info(ctx, fmt.Sprintf("Issuing RDDL claim: %s/%d", msg.Beneficiary, id))
|
go postClaimToService(goCtx, msg.GetBeneficiary(), burnCoins.Amount.Uint64(), id)
|
||||||
txID, err := util.DistributeAsset(msg.Beneficiary, util.UintValueToRDDLTokenString(msg.Amount), params.ReissuanceAsset)
|
|
||||||
if err != nil {
|
|
||||||
util.GetAppLogger().Error(ctx, createRedeemClaimTag+"could not issue claim to beneficiary: "+msg.GetBeneficiary())
|
|
||||||
}
|
|
||||||
util.SendUpdateRedeemClaim(goCtx, msg.Beneficiary, id, txID)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return &types.MsgCreateRedeemClaimResponse{}, nil
|
return &types.MsgCreateRedeemClaimResponse{}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (k msgServer) validateCreateRedeemClaim(ctx sdk.Context, msg *types.MsgCreateRedeemClaim) (err error) {
|
|
||||||
addr := sdk.MustAccAddressFromBech32(msg.Creator)
|
|
||||||
|
|
||||||
params := k.GetParams(ctx)
|
|
||||||
balance := k.bankKeeper.GetBalance(ctx, addr, params.ClaimDenom)
|
|
||||||
|
|
||||||
if !balance.Amount.GTE(sdk.NewIntFromUint64(msg.Amount)) {
|
|
||||||
return errorsmod.Wrap(sdkerrors.ErrInsufficientFunds, redeemClaimContext)
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (k msgServer) UpdateRedeemClaim(goCtx context.Context, msg *types.MsgUpdateRedeemClaim) (*types.MsgUpdateRedeemClaimResponse, error) {
|
func (k msgServer) UpdateRedeemClaim(goCtx context.Context, msg *types.MsgUpdateRedeemClaim) (*types.MsgUpdateRedeemClaimResponse, error) {
|
||||||
ctx := sdk.UnwrapSDKContext(goCtx)
|
ctx := sdk.UnwrapSDKContext(goCtx)
|
||||||
|
|
||||||
@ -134,9 +114,7 @@ func (k msgServer) validateConfirmRedeemClaim(ctx sdk.Context, msg *types.MsgCon
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (k msgServer) burnClaimAmount(ctx sdk.Context, addr sdk.AccAddress, amount uint64) (err error) {
|
func (k msgServer) burnClaimAmount(ctx sdk.Context, addr sdk.AccAddress, burnCoins sdk.Coins) (err error) {
|
||||||
params := k.GetParams(ctx)
|
|
||||||
burnCoins := sdk.NewCoins(sdk.NewCoin(params.ClaimDenom, sdk.NewIntFromUint64(amount)))
|
|
||||||
err = k.bankKeeper.SendCoinsFromAccountToModule(ctx, addr, types.ModuleName, burnCoins)
|
err = k.bankKeeper.SendCoinsFromAccountToModule(ctx, addr, types.ModuleName, burnCoins)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -147,3 +125,13 @@ func (k msgServer) burnClaimAmount(ctx sdk.Context, addr sdk.AccAddress, amount
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func postClaimToService(goCtx context.Context, beneficiary string, amount uint64, id uint64) {
|
||||||
|
ctx := sdk.UnwrapSDKContext(goCtx)
|
||||||
|
util.GetAppLogger().Info(ctx, fmt.Sprintf("Issuing RDDL claim: %s/%d", beneficiary, id))
|
||||||
|
txID, err := clients.PostClaim(goCtx, beneficiary, amount, id)
|
||||||
|
if err != nil {
|
||||||
|
util.GetAppLogger().Error(ctx, createRedeemClaimTag+"could not issue claim to beneficiary: "+beneficiary)
|
||||||
|
}
|
||||||
|
util.SendUpdateRedeemClaim(goCtx, beneficiary, id, txID)
|
||||||
|
}
|
||||||
|
|||||||
@ -18,13 +18,11 @@ var _ sdk.Msg = &MsgCreateRedeemClaim{}
|
|||||||
func NewMsgCreateRedeemClaim(
|
func NewMsgCreateRedeemClaim(
|
||||||
creator string,
|
creator string,
|
||||||
beneficiary string,
|
beneficiary string,
|
||||||
amount uint64,
|
|
||||||
|
|
||||||
) *MsgCreateRedeemClaim {
|
) *MsgCreateRedeemClaim {
|
||||||
return &MsgCreateRedeemClaim{
|
return &MsgCreateRedeemClaim{
|
||||||
Creator: creator,
|
Creator: creator,
|
||||||
Beneficiary: beneficiary,
|
Beneficiary: beneficiary,
|
||||||
Amount: amount,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -852,7 +852,6 @@ var xxx_messageInfo_MsgInitPopResponse proto.InternalMessageInfo
|
|||||||
type MsgCreateRedeemClaim struct {
|
type MsgCreateRedeemClaim struct {
|
||||||
Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"`
|
Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"`
|
||||||
Beneficiary string `protobuf:"bytes,2,opt,name=beneficiary,proto3" json:"beneficiary,omitempty"`
|
Beneficiary string `protobuf:"bytes,2,opt,name=beneficiary,proto3" json:"beneficiary,omitempty"`
|
||||||
Amount uint64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *MsgCreateRedeemClaim) Reset() { *m = MsgCreateRedeemClaim{} }
|
func (m *MsgCreateRedeemClaim) Reset() { *m = MsgCreateRedeemClaim{} }
|
||||||
@ -902,13 +901,6 @@ func (m *MsgCreateRedeemClaim) GetBeneficiary() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *MsgCreateRedeemClaim) GetAmount() uint64 {
|
|
||||||
if m != nil {
|
|
||||||
return m.Amount
|
|
||||||
}
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
type MsgCreateRedeemClaimResponse struct {
|
type MsgCreateRedeemClaimResponse struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1173,76 +1165,75 @@ func init() {
|
|||||||
func init() { proto.RegisterFile("planetmintgo/dao/tx.proto", fileDescriptor_7117c47dbc1828c7) }
|
func init() { proto.RegisterFile("planetmintgo/dao/tx.proto", fileDescriptor_7117c47dbc1828c7) }
|
||||||
|
|
||||||
var fileDescriptor_7117c47dbc1828c7 = []byte{
|
var fileDescriptor_7117c47dbc1828c7 = []byte{
|
||||||
// 1094 bytes of a gzipped FileDescriptorProto
|
// 1080 bytes of a gzipped FileDescriptorProto
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0xcf, 0x4f, 0xdc, 0xc6,
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0x4f, 0x6f, 0xdc, 0x44,
|
||||||
0x17, 0xc7, 0x40, 0x20, 0xfb, 0xe0, 0x1b, 0x82, 0xc3, 0x97, 0x2c, 0x2e, 0x38, 0x5b, 0x07, 0xd1,
|
0x14, 0x8f, 0x93, 0x34, 0xe9, 0xbe, 0x84, 0xa6, 0x71, 0x43, 0xba, 0x31, 0x89, 0xbb, 0xb8, 0x51,
|
||||||
0x0d, 0x4a, 0xd6, 0x6d, 0x2a, 0x55, 0x6a, 0x7b, 0xa8, 0x0a, 0x48, 0x0d, 0x52, 0x57, 0x45, 0x0e,
|
0xd8, 0x46, 0xed, 0x1a, 0x8a, 0x84, 0x04, 0x1c, 0x10, 0x49, 0x24, 0x1a, 0x89, 0x15, 0x91, 0x1b,
|
||||||
0xbd, 0x54, 0x95, 0xd0, 0x60, 0x0f, 0xde, 0x29, 0xb6, 0xc7, 0xcc, 0xcc, 0x46, 0xa0, 0xde, 0x72,
|
0x2e, 0x08, 0x29, 0x9a, 0xd8, 0x13, 0xef, 0x28, 0xb6, 0xc7, 0x99, 0x99, 0xad, 0x12, 0x71, 0xeb,
|
||||||
0xe8, 0xb9, 0xa7, 0x9e, 0xfa, 0x07, 0xf4, 0x98, 0x43, 0xff, 0x88, 0x1c, 0xa3, 0x9e, 0x7a, 0xaa,
|
0x81, 0x33, 0x27, 0x4e, 0x7c, 0x00, 0x8e, 0x3d, 0xf0, 0x21, 0x7a, 0xac, 0x38, 0x71, 0x42, 0x55,
|
||||||
0x22, 0x38, 0xe4, 0x4f, 0xe8, 0xa1, 0x97, 0xca, 0xe3, 0x59, 0xaf, 0x77, 0xc7, 0xfb, 0xe3, 0xd2,
|
0x72, 0xe8, 0x47, 0xe0, 0xc0, 0x05, 0x79, 0x3c, 0xeb, 0xf5, 0xee, 0x78, 0xff, 0x5c, 0xb8, 0xb4,
|
||||||
0x4b, 0x32, 0xef, 0xbd, 0xcf, 0x9b, 0xf7, 0xf1, 0x9b, 0x37, 0x9f, 0x61, 0x61, 0x23, 0x8d, 0x50,
|
0x9e, 0xf7, 0x7e, 0xef, 0xbd, 0x9f, 0xdf, 0xbc, 0xf7, 0x73, 0x16, 0x36, 0xd2, 0x08, 0x25, 0x58,
|
||||||
0x82, 0x45, 0x4c, 0x12, 0x11, 0x52, 0x37, 0x40, 0xd4, 0x15, 0x97, 0xad, 0x94, 0x51, 0x41, 0xcd,
|
0xc4, 0x24, 0x11, 0x21, 0x75, 0x03, 0x44, 0x5d, 0x71, 0xd9, 0x4a, 0x19, 0x15, 0xd4, 0xbc, 0x5b,
|
||||||
0xbb, 0xe5, 0x50, 0x2b, 0x40, 0xd4, 0x6a, 0x68, 0x60, 0xbf, 0x83, 0xa2, 0x08, 0x27, 0x21, 0xce,
|
0x76, 0xb5, 0x02, 0x44, 0xad, 0x86, 0x06, 0xf6, 0x3b, 0x28, 0x8a, 0x70, 0x12, 0xe2, 0x3c, 0xc6,
|
||||||
0x73, 0xac, 0x87, 0x1a, 0x22, 0x5b, 0x9e, 0x30, 0x7c, 0xd1, 0xc5, 0x5c, 0x28, 0xd0, 0x23, 0x0d,
|
0x7a, 0xa8, 0x21, 0xb2, 0xc7, 0x13, 0x86, 0x2f, 0xba, 0x98, 0x0b, 0x05, 0x7a, 0xa4, 0x81, 0x02,
|
||||||
0x14, 0x10, 0x2e, 0x18, 0x39, 0xed, 0x0a, 0x42, 0x93, 0x13, 0xca, 0x02, 0xcc, 0x14, 0x74, 0x4b,
|
0xc2, 0x05, 0x23, 0xa7, 0x5d, 0x41, 0x68, 0x72, 0x42, 0x59, 0x80, 0x99, 0x82, 0x6e, 0x69, 0xd0,
|
||||||
0x83, 0xa6, 0x88, 0xa1, 0x98, 0xab, 0xf0, 0x2a, 0x8a, 0x49, 0x42, 0x5d, 0xf9, 0xaf, 0x72, 0xad,
|
0x14, 0x31, 0x14, 0x73, 0xe5, 0x5e, 0x45, 0x31, 0x49, 0xa8, 0x2b, 0xff, 0x55, 0xa6, 0xb5, 0x90,
|
||||||
0x85, 0x34, 0xa4, 0x72, 0xe9, 0x66, 0x2b, 0xe5, 0xdd, 0xf0, 0x29, 0x8f, 0x29, 0x3f, 0xc9, 0x03,
|
0x86, 0x54, 0x3e, 0xba, 0xd9, 0x93, 0xb2, 0x6e, 0xf8, 0x94, 0xc7, 0x94, 0x9f, 0xe4, 0x8e, 0xfc,
|
||||||
0xb9, 0xa1, 0x42, 0xf7, 0x73, 0xcb, 0x8d, 0x79, 0xe8, 0xbe, 0xf8, 0x28, 0xfb, 0x6f, 0xe4, 0xb7,
|
0xa0, 0x5c, 0xf7, 0xf3, 0x93, 0x1b, 0xf3, 0xd0, 0x7d, 0xf1, 0x49, 0xf6, 0xdf, 0xc8, 0x77, 0x61,
|
||||||
0x30, 0x1c, 0x60, 0x1c, 0x9f, 0xf8, 0x11, 0x22, 0x71, 0x0e, 0x72, 0x08, 0x98, 0x6d, 0x1e, 0x7a,
|
0x38, 0xc0, 0x38, 0x3e, 0xf1, 0x23, 0x44, 0xe2, 0x1c, 0xe4, 0x10, 0x30, 0xdb, 0x3c, 0xf4, 0x70,
|
||||||
0x38, 0xa5, 0x4c, 0x1c, 0xd1, 0xd4, 0xc3, 0xbc, 0x1b, 0x09, 0xb3, 0x0e, 0x8b, 0x3e, 0xc3, 0x48,
|
0x4a, 0x99, 0x38, 0xa2, 0xa9, 0x87, 0x79, 0x37, 0x12, 0x66, 0x1d, 0x16, 0x7d, 0x86, 0x91, 0xa0,
|
||||||
0x50, 0x56, 0x37, 0x1a, 0x46, 0xb3, 0xe6, 0xf5, 0x4c, 0xf3, 0x53, 0xa8, 0x15, 0x3d, 0xab, 0xcf,
|
0xac, 0x6e, 0x34, 0x8c, 0x66, 0xcd, 0xeb, 0x1d, 0xcd, 0xcf, 0xa1, 0x56, 0xf4, 0xac, 0x3e, 0xdb,
|
||||||
0x36, 0x8c, 0xe6, 0xd2, 0xd3, 0xf7, 0x5a, 0xc3, 0x8d, 0x6e, 0xed, 0xf7, 0x20, 0x5e, 0x1f, 0xed,
|
0x30, 0x9a, 0x4b, 0x4f, 0x3f, 0x68, 0x0d, 0x37, 0xba, 0xb5, 0xdf, 0x83, 0x78, 0x7d, 0xb4, 0xb3,
|
||||||
0x6c, 0x82, 0xa5, 0x97, 0xf2, 0x30, 0x4f, 0x69, 0xc2, 0xb1, 0xf3, 0xd6, 0x80, 0x75, 0x19, 0x26,
|
0x09, 0x96, 0x5e, 0xca, 0xc3, 0x3c, 0xa5, 0x09, 0xc7, 0xce, 0x5b, 0x03, 0xd6, 0xa5, 0x9b, 0x70,
|
||||||
0x9c, 0x77, 0xb1, 0x77, 0x70, 0xf0, 0xf5, 0x11, 0xa3, 0x29, 0xe5, 0x28, 0x1a, 0xc3, 0xc6, 0x82,
|
0xde, 0xc5, 0xde, 0xc1, 0xc1, 0xb7, 0x47, 0x8c, 0xa6, 0x94, 0xa3, 0x68, 0x0c, 0x1b, 0x0b, 0x6e,
|
||||||
0xdb, 0xa9, 0x44, 0x61, 0x26, 0xc9, 0xd4, 0xbc, 0xc2, 0x96, 0x59, 0x34, 0x8e, 0x51, 0x12, 0xd4,
|
0xa7, 0x12, 0x85, 0x99, 0x24, 0x53, 0xf3, 0x8a, 0xb3, 0x8c, 0xa2, 0x71, 0x8c, 0x92, 0xa0, 0x3e,
|
||||||
0xe7, 0x54, 0x56, 0x6e, 0x9a, 0x0d, 0x58, 0x3a, 0x8d, 0xa8, 0x7f, 0xfe, 0x0c, 0x93, 0xb0, 0x23,
|
0xa7, 0xa2, 0xf2, 0xa3, 0xd9, 0x80, 0xa5, 0xd3, 0x88, 0xfa, 0xe7, 0xcf, 0x30, 0x09, 0x3b, 0xa2,
|
||||||
0xea, 0xf3, 0x0d, 0xa3, 0x39, 0xe7, 0x95, 0x5d, 0xe6, 0x2e, 0xdc, 0x3d, 0x23, 0x8c, 0x8b, 0xc3,
|
0x3e, 0xdf, 0x30, 0x9a, 0x73, 0x5e, 0xd9, 0x64, 0xee, 0xc2, 0xdd, 0x33, 0xc2, 0xb8, 0x38, 0x4c,
|
||||||
0xc4, 0x8f, 0xba, 0x01, 0x0e, 0x8e, 0x68, 0x5a, 0xbf, 0x25, 0x61, 0x9a, 0xdf, 0x6c, 0xc2, 0x4a,
|
0xfc, 0xa8, 0x1b, 0xe0, 0xe0, 0x88, 0xa6, 0xf5, 0x5b, 0x12, 0xa6, 0xd9, 0xcd, 0x26, 0xac, 0x44,
|
||||||
0x84, 0x06, 0xa1, 0x0b, 0x12, 0x3a, 0xec, 0x76, 0x1a, 0x60, 0x57, 0x7f, 0x61, 0xd1, 0x04, 0x02,
|
0x68, 0x10, 0xba, 0x20, 0xa1, 0xc3, 0x66, 0xa7, 0x01, 0x76, 0xf5, 0x1b, 0x16, 0x4d, 0x20, 0xb0,
|
||||||
0xcb, 0x6d, 0x1e, 0xb6, 0x49, 0x22, 0x8e, 0xe9, 0x39, 0x4e, 0xc6, 0x7c, 0xf9, 0x17, 0xb0, 0x94,
|
0xdc, 0xe6, 0x61, 0x9b, 0x24, 0xe2, 0x98, 0x9e, 0xe3, 0x64, 0xcc, 0x9b, 0x7f, 0x05, 0x4b, 0x59,
|
||||||
0xf5, 0xdb, 0xcb, 0x07, 0x53, 0x9d, 0xc4, 0x96, 0x7e, 0x12, 0xed, 0x3e, 0xc8, 0x2b, 0x67, 0x38,
|
0xbf, 0xbd, 0x7c, 0x30, 0xd5, 0x4d, 0x6c, 0xe9, 0x37, 0xd1, 0xee, 0x83, 0xbc, 0x72, 0x84, 0xb3,
|
||||||
0xeb, 0xb0, 0x56, 0x2e, 0x55, 0x50, 0x78, 0x69, 0xc8, 0x40, 0x89, 0xe5, 0xc4, 0x99, 0x18, 0x77,
|
0x0e, 0x6b, 0xe5, 0x52, 0x05, 0x85, 0x97, 0x86, 0x74, 0x94, 0x58, 0x4e, 0x9c, 0x89, 0x71, 0xb7,
|
||||||
0x0a, 0x26, 0xcc, 0x8b, 0xcb, 0xc3, 0x03, 0x75, 0x04, 0x72, 0x3d, 0xb9, 0xff, 0x8e, 0x0d, 0x9b,
|
0x60, 0xc2, 0xbc, 0xb8, 0x3c, 0x3c, 0x50, 0x57, 0x20, 0x9f, 0x27, 0xf7, 0xdf, 0xb1, 0x61, 0xb3,
|
||||||
0x55, 0x1c, 0x0a, 0x92, 0x7f, 0x1b, 0xf0, 0xff, 0x36, 0x0f, 0x0f, 0x4a, 0xd7, 0x6e, 0x22, 0xcb,
|
0x8a, 0x43, 0x41, 0xf2, 0x1f, 0x03, 0xde, 0x6f, 0xf3, 0xf0, 0xa0, 0xb4, 0x76, 0x13, 0x59, 0xd6,
|
||||||
0x3a, 0x2c, 0x66, 0x07, 0x92, 0x9d, 0xcf, 0xac, 0xac, 0xd8, 0x33, 0xb3, 0x48, 0x80, 0xe8, 0x71,
|
0x61, 0x31, 0xbb, 0x90, 0xec, 0x7e, 0x66, 0x65, 0xc5, 0xde, 0x31, 0xf3, 0x04, 0x88, 0x1e, 0xf7,
|
||||||
0x9f, 0x66, 0xcf, 0x34, 0x1d, 0x58, 0x26, 0xc9, 0x0b, 0xcc, 0x05, 0x65, 0x32, 0x3c, 0x2f, 0xc3,
|
0x69, 0xf6, 0x8e, 0xa6, 0x03, 0xcb, 0x24, 0x79, 0x81, 0xb9, 0xa0, 0x4c, 0xba, 0xe7, 0xa5, 0x7b,
|
||||||
0x03, 0xbe, 0x2c, 0x3b, 0xa5, 0xa9, 0x0c, 0xdf, 0xca, 0xb3, 0x95, 0x69, 0x3e, 0x86, 0x55, 0x8c,
|
0xc0, 0x96, 0x45, 0xa7, 0x34, 0x95, 0xee, 0x5b, 0x79, 0xb4, 0x3a, 0x9a, 0x8f, 0x61, 0x15, 0x23,
|
||||||
0x58, 0x74, 0x75, 0x58, 0xde, 0x62, 0x41, 0x62, 0xf4, 0x80, 0xb9, 0x0d, 0xff, 0xe3, 0x82, 0x21,
|
0x16, 0x5d, 0x1d, 0x96, 0x53, 0x2c, 0x48, 0x8c, 0xee, 0x30, 0xb7, 0xe1, 0x3d, 0x2e, 0x18, 0x12,
|
||||||
0x81, 0x43, 0xe2, 0x4b, 0xe4, 0xa2, 0x44, 0x0e, 0x3a, 0x9d, 0x07, 0xb0, 0x55, 0xf9, 0xe1, 0x45,
|
0x38, 0x24, 0xbe, 0x44, 0x2e, 0x4a, 0xe4, 0xa0, 0xd1, 0x79, 0x00, 0x5b, 0x95, 0x2f, 0x5e, 0xb4,
|
||||||
0x6b, 0x7e, 0x94, 0xd7, 0x68, 0x10, 0x20, 0x4f, 0x7c, 0x4c, 0x6b, 0xbe, 0x82, 0xe5, 0xb2, 0x82,
|
0xe6, 0x27, 0xb9, 0x46, 0x83, 0x00, 0x79, 0xe3, 0x63, 0x5a, 0xf3, 0x0d, 0x2c, 0x97, 0x15, 0x4c,
|
||||||
0xa9, 0x69, 0x7a, 0xa8, 0x4f, 0x53, 0x79, 0xdb, 0x6f, 0x32, 0x99, 0xf3, 0x06, 0x12, 0xd5, 0x84,
|
0x4d, 0xd3, 0x43, 0x7d, 0x9a, 0xca, 0x69, 0xbf, 0xcb, 0x64, 0xce, 0x1b, 0x08, 0x54, 0x13, 0x5e,
|
||||||
0x57, 0x14, 0x2f, 0xe8, 0xfd, 0x62, 0xc0, 0x4a, 0x9b, 0x87, 0xdf, 0xa6, 0x01, 0x12, 0xf8, 0x48,
|
0x51, 0xbc, 0xa0, 0xf7, 0xab, 0x01, 0x2b, 0x6d, 0x1e, 0x7e, 0x9f, 0x06, 0x48, 0xe0, 0x23, 0xa9,
|
||||||
0x6a, 0xa1, 0xf9, 0x09, 0xd4, 0x50, 0x57, 0x74, 0x28, 0x23, 0xe2, 0x2a, 0xa7, 0xb6, 0x57, 0xff,
|
0x85, 0xe6, 0x67, 0x50, 0x43, 0x5d, 0xd1, 0xa1, 0x8c, 0x88, 0xab, 0x9c, 0xda, 0x5e, 0xfd, 0xcf,
|
||||||
0xe3, 0xf7, 0x27, 0x6b, 0x4a, 0xe6, 0xbe, 0x0c, 0x02, 0x86, 0x39, 0x7f, 0x2e, 0x18, 0x49, 0x42,
|
0x3f, 0x9e, 0xac, 0x29, 0x99, 0xfb, 0x3a, 0x08, 0x18, 0xe6, 0xfc, 0xb9, 0x60, 0x24, 0x09, 0xbd,
|
||||||
0xaf, 0x0f, 0x35, 0x3f, 0x87, 0x85, 0x5c, 0x4d, 0x15, 0xe1, 0xba, 0x4e, 0x38, 0xaf, 0xb0, 0x57,
|
0x3e, 0xd4, 0xfc, 0x12, 0x16, 0x72, 0x35, 0x55, 0x84, 0xeb, 0x3a, 0xe1, 0xbc, 0xc2, 0x5e, 0xed,
|
||||||
0x7b, 0xfd, 0xd7, 0x83, 0x99, 0xdf, 0xde, 0xbd, 0xda, 0x35, 0x3c, 0x95, 0xf2, 0xd9, 0x9d, 0x97,
|
0xf5, 0xdf, 0x0f, 0x66, 0x7e, 0x7f, 0xf7, 0x6a, 0xd7, 0xf0, 0x54, 0xc8, 0x17, 0x77, 0x5e, 0xbe,
|
||||||
0xef, 0x5e, 0xed, 0xf6, 0x37, 0x73, 0x36, 0xe0, 0xfe, 0x10, 0xaf, 0x82, 0xf3, 0xaf, 0x06, 0x40,
|
0x7b, 0xb5, 0xdb, 0x4f, 0xe6, 0x6c, 0xc0, 0xfd, 0x21, 0x5e, 0x05, 0xe7, 0xdf, 0x0c, 0x80, 0x36,
|
||||||
0x9b, 0x87, 0x87, 0x09, 0xe9, 0x8d, 0xcb, 0x88, 0x3e, 0x6e, 0x42, 0x8d, 0x24, 0x44, 0x10, 0x19,
|
0x0f, 0x0f, 0x13, 0xd2, 0x1b, 0x97, 0x11, 0x7d, 0xdc, 0x84, 0x1a, 0x49, 0x88, 0x20, 0xd2, 0x97,
|
||||||
0xcb, 0x6f, 0x42, 0xdf, 0x61, 0xda, 0x00, 0x85, 0x18, 0x32, 0x35, 0x69, 0x25, 0xcf, 0x40, 0x1c,
|
0x6f, 0x42, 0xdf, 0x60, 0xda, 0x00, 0x85, 0x18, 0x32, 0x35, 0x69, 0x25, 0xcb, 0x80, 0x1f, 0xab,
|
||||||
0xab, 0x51, 0x2b, 0x79, 0xcc, 0x75, 0x58, 0xe8, 0xe4, 0x37, 0x26, 0x97, 0x22, 0x65, 0x39, 0x6b,
|
0x51, 0x2b, 0x59, 0xcc, 0x75, 0x58, 0xe8, 0xe4, 0x1b, 0x93, 0x4b, 0x91, 0x3a, 0x39, 0x6b, 0x52,
|
||||||
0x52, 0xc2, 0x15, 0xbb, 0x82, 0xf4, 0x0f, 0xf2, 0x1a, 0xef, 0x67, 0xcc, 0xb0, 0x27, 0x75, 0x7f,
|
0xc2, 0x15, 0xbb, 0x82, 0xb4, 0x27, 0xd7, 0x78, 0x3f, 0x63, 0x86, 0x3d, 0xa9, 0xfb, 0xfb, 0x99,
|
||||||
0x3f, 0x93, 0xfd, 0x31, 0xec, 0xb3, 0x6b, 0x89, 0x13, 0x7c, 0x46, 0x7c, 0x82, 0xd8, 0x95, 0xe2,
|
0xec, 0x8f, 0x61, 0x9f, 0xad, 0x25, 0x4e, 0xf0, 0x19, 0xf1, 0x09, 0x62, 0x57, 0x8a, 0x7f, 0xd9,
|
||||||
0x5f, 0x76, 0x65, 0x0c, 0x50, 0x4c, 0xbb, 0x89, 0x90, 0xec, 0xe7, 0x3d, 0x65, 0xa9, 0xeb, 0xaa,
|
0xa4, 0xd6, 0x52, 0xcb, 0x59, 0xd4, 0xfc, 0x39, 0xd7, 0x8e, 0xbc, 0x89, 0xd3, 0x15, 0xbd, 0x03,
|
||||||
0xd5, 0x2a, 0xb8, 0xfc, 0x94, 0x6b, 0x4a, 0xde, 0xdc, 0xe9, 0xc8, 0xdc, 0x81, 0x59, 0x12, 0x48,
|
0xb3, 0x24, 0x90, 0xb5, 0xe6, 0xbd, 0x59, 0x12, 0x0c, 0x93, 0x98, 0xd3, 0x48, 0x64, 0x3b, 0x19,
|
||||||
0x0e, 0xf3, 0xde, 0x2c, 0x09, 0x86, 0xc9, 0xcd, 0xe9, 0xe4, 0x1c, 0x58, 0x8e, 0xc8, 0x45, 0x97,
|
0x91, 0x8b, 0x2e, 0x09, 0x8e, 0x2f, 0x9f, 0x21, 0xde, 0xe9, 0xed, 0x64, 0xd9, 0xa6, 0x88, 0x6a,
|
||||||
0x04, 0xc7, 0x97, 0xcf, 0x10, 0xef, 0xf4, 0xee, 0x6a, 0xd9, 0xa7, 0x88, 0x6a, 0x3c, 0x0a, 0xa2,
|
0x3c, 0x0a, 0xa2, 0xbe, 0x94, 0x8f, 0x7d, 0x9a, 0x9c, 0x11, 0x16, 0xff, 0x4f, 0x44, 0xd5, 0xaa,
|
||||||
0xbe, 0x94, 0x95, 0x7d, 0x9a, 0x9c, 0x11, 0x16, 0xff, 0x47, 0x44, 0xd5, 0x15, 0xd6, 0x8b, 0xf4,
|
0xea, 0x45, 0x7a, 0x2c, 0x9e, 0xfe, 0x7b, 0x1b, 0xe6, 0xda, 0x3c, 0x34, 0x2f, 0xe0, 0x5e, 0xd5,
|
||||||
0x58, 0x3c, 0xfd, 0xe7, 0x36, 0xcc, 0xb5, 0x79, 0x68, 0x5e, 0xc0, 0xbd, 0xaa, 0xe7, 0xb0, 0x59,
|
0x67, 0xaf, 0x59, 0xa1, 0xe6, 0x95, 0x9f, 0x0f, 0xeb, 0xe3, 0x69, 0x91, 0xbd, 0xd2, 0xe6, 0x73,
|
||||||
0xa1, 0xf2, 0x95, 0xcf, 0x8a, 0xf5, 0xe1, 0xb4, 0xc8, 0x5e, 0x69, 0xf3, 0x39, 0xd4, 0xfa, 0xaf,
|
0xa8, 0xf5, 0xbf, 0x32, 0x76, 0x65, 0x78, 0xe1, 0xb7, 0x76, 0xc6, 0xfb, 0x8b, 0xa4, 0xe7, 0xb0,
|
||||||
0x8f, 0x5d, 0x99, 0x5e, 0xc4, 0xad, 0x9d, 0xf1, 0xf1, 0x62, 0xd3, 0x73, 0x58, 0xd5, 0x9f, 0x93,
|
0xaa, 0x7f, 0x36, 0x76, 0x26, 0x71, 0xcb, 0x71, 0x56, 0x6b, 0x3a, 0x5c, 0x51, 0x2c, 0x01, 0xb3,
|
||||||
0x9d, 0x49, 0xdc, 0x72, 0x9c, 0xd5, 0x9a, 0x0e, 0x57, 0x14, 0x4b, 0xc0, 0xac, 0x78, 0x16, 0x3e,
|
0x42, 0xfe, 0x3f, 0xaa, 0xcc, 0xa2, 0x03, 0x2d, 0x77, 0x4a, 0x60, 0x51, 0xef, 0x02, 0xee, 0x55,
|
||||||
0xa8, 0xdc, 0x45, 0x07, 0x5a, 0xee, 0x94, 0xc0, 0xa2, 0xde, 0x05, 0xdc, 0xab, 0x12, 0xdb, 0xe6,
|
0x89, 0x6a, 0x73, 0x8a, 0x3c, 0x12, 0x39, 0xe2, 0x92, 0xc6, 0x68, 0xa5, 0xf9, 0x23, 0x2c, 0x0f,
|
||||||
0x14, 0xfb, 0x48, 0xe4, 0x88, 0x43, 0x1a, 0xa3, 0xa1, 0xe6, 0xf7, 0xb0, 0x3c, 0xa0, 0x9f, 0xef,
|
0xe8, 0xe4, 0x87, 0x95, 0x19, 0xca, 0x10, 0xeb, 0xd1, 0x44, 0x48, 0x91, 0x1d, 0xc3, 0xca, 0xf0,
|
||||||
0x57, 0xee, 0x50, 0x86, 0x58, 0x8f, 0x26, 0x42, 0x8a, 0xdd, 0x31, 0xac, 0x0c, 0xff, 0x39, 0xb8,
|
0x9f, 0x7d, 0xdb, 0x23, 0xee, 0x60, 0x00, 0x65, 0x3d, 0x9e, 0x06, 0x55, 0x94, 0x69, 0xc3, 0x62,
|
||||||
0x3d, 0xe2, 0x0c, 0x06, 0x50, 0xd6, 0xe3, 0x69, 0x50, 0x45, 0x99, 0x36, 0x2c, 0xf6, 0x04, 0x75,
|
0x4f, 0x38, 0x37, 0x2b, 0x03, 0x95, 0xd7, 0xda, 0x1e, 0xe7, 0x2d, 0xcf, 0x98, 0xae, 0x69, 0xd5,
|
||||||
0xb3, 0x32, 0x51, 0x45, 0xad, 0xed, 0x71, 0xd1, 0xf2, 0x8c, 0xe9, 0x5a, 0x57, 0x3d, 0x63, 0x1a,
|
0x33, 0xa6, 0xe1, 0x46, 0xcc, 0xd8, 0x48, 0x3d, 0xcb, 0x8a, 0xe9, 0x5a, 0xb6, 0x33, 0xa6, 0xc5,
|
||||||
0x6e, 0xc4, 0x8c, 0x8d, 0xd4, 0xb3, 0xac, 0x98, 0xae, 0x65, 0x3b, 0x63, 0x5a, 0x3c, 0xb9, 0xd8,
|
0x93, 0x8b, 0x8d, 0xd4, 0xa4, 0x6c, 0xa0, 0x2b, 0x04, 0xa9, 0x7a, 0xa0, 0x75, 0xe0, 0x88, 0x81,
|
||||||
0x48, 0x4d, 0xca, 0x06, 0xba, 0x42, 0x90, 0xaa, 0x07, 0x5a, 0x07, 0x8e, 0x18, 0xe8, 0xd1, 0xea,
|
0x1e, 0xad, 0x3e, 0x7b, 0x87, 0xaf, 0xaf, 0x6d, 0xe3, 0xcd, 0xb5, 0x6d, 0xbc, 0xbd, 0xb6, 0x8d,
|
||||||
0xb3, 0x77, 0xf8, 0xfa, 0xda, 0x36, 0xde, 0x5c, 0xdb, 0xc6, 0xdb, 0x6b, 0xdb, 0xf8, 0xf9, 0xc6,
|
0x5f, 0x6e, 0xec, 0x99, 0x37, 0x37, 0xf6, 0xcc, 0x5f, 0x37, 0xf6, 0xcc, 0x0f, 0x6e, 0x48, 0x44,
|
||||||
0x9e, 0x79, 0x73, 0x63, 0xcf, 0xfc, 0x79, 0x63, 0xcf, 0x7c, 0xe7, 0x86, 0x44, 0x74, 0xba, 0xa7,
|
0xa7, 0x7b, 0xda, 0xf2, 0x69, 0xec, 0xf6, 0x93, 0x96, 0x1e, 0x9f, 0x84, 0xd4, 0xbd, 0xcc, 0x7f,
|
||||||
0x2d, 0x9f, 0xc6, 0x6e, 0x7f, 0xd3, 0xd2, 0xf2, 0x49, 0x48, 0xdd, 0xcb, 0xfc, 0x47, 0xd8, 0x55,
|
0x6c, 0x5d, 0xa5, 0x98, 0x9f, 0x2e, 0xc8, 0xdf, 0x12, 0x9f, 0xfe, 0x17, 0x00, 0x00, 0xff, 0xff,
|
||||||
0x8a, 0xf9, 0xe9, 0x82, 0xfc, 0x8d, 0xf1, 0xf1, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x81, 0x5c,
|
0x09, 0x2c, 0x96, 0x95, 0x8d, 0x0d, 0x00, 0x00,
|
||||||
0x0d, 0x9f, 0xa5, 0x0d, 0x00, 0x00,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
@ -2289,11 +2280,6 @@ func (m *MsgCreateRedeemClaim) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
if m.Amount != 0 {
|
|
||||||
i = encodeVarintTx(dAtA, i, uint64(m.Amount))
|
|
||||||
i--
|
|
||||||
dAtA[i] = 0x18
|
|
||||||
}
|
|
||||||
if len(m.Beneficiary) > 0 {
|
if len(m.Beneficiary) > 0 {
|
||||||
i -= len(m.Beneficiary)
|
i -= len(m.Beneficiary)
|
||||||
copy(dAtA[i:], m.Beneficiary)
|
copy(dAtA[i:], m.Beneficiary)
|
||||||
@ -2752,9 +2738,6 @@ func (m *MsgCreateRedeemClaim) Size() (n int) {
|
|||||||
if l > 0 {
|
if l > 0 {
|
||||||
n += 1 + l + sovTx(uint64(l))
|
n += 1 + l + sovTx(uint64(l))
|
||||||
}
|
}
|
||||||
if m.Amount != 0 {
|
|
||||||
n += 1 + sovTx(uint64(m.Amount))
|
|
||||||
}
|
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4623,25 +4606,6 @@ func (m *MsgCreateRedeemClaim) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
m.Beneficiary = string(dAtA[iNdEx:postIndex])
|
m.Beneficiary = string(dAtA[iNdEx:postIndex])
|
||||||
iNdEx = postIndex
|
iNdEx = postIndex
|
||||||
case 3:
|
|
||||||
if wireType != 0 {
|
|
||||||
return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType)
|
|
||||||
}
|
|
||||||
m.Amount = 0
|
|
||||||
for shift := uint(0); ; shift += 7 {
|
|
||||||
if shift >= 64 {
|
|
||||||
return ErrIntOverflowTx
|
|
||||||
}
|
|
||||||
if iNdEx >= l {
|
|
||||||
return io.ErrUnexpectedEOF
|
|
||||||
}
|
|
||||||
b := dAtA[iNdEx]
|
|
||||||
iNdEx++
|
|
||||||
m.Amount |= uint64(b&0x7F) << shift
|
|
||||||
if b < 0x80 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
iNdEx = preIndex
|
iNdEx = preIndex
|
||||||
skippy, err := skipTx(dAtA[iNdEx:])
|
skippy, err := skipTx(dAtA[iNdEx:])
|
||||||
|
|||||||
@ -2,6 +2,8 @@ package keeper
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"errors"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
config "github.com/planetmint/planetmint-go/config"
|
config "github.com/planetmint/planetmint-go/config"
|
||||||
"github.com/planetmint/planetmint-go/util"
|
"github.com/planetmint/planetmint-go/util"
|
||||||
@ -12,6 +14,7 @@ import (
|
|||||||
|
|
||||||
errorsmod "cosmossdk.io/errors"
|
errorsmod "cosmossdk.io/errors"
|
||||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||||
|
"github.com/rddl-network/go-utils/signature"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (k msgServer) AttestMachine(goCtx context.Context, msg *types.MsgAttestMachine) (*types.MsgAttestMachineResponse, error) {
|
func (k msgServer) AttestMachine(goCtx context.Context, msg *types.MsgAttestMachine) (*types.MsgAttestMachineResponse, error) {
|
||||||
@ -21,9 +24,17 @@ func (k msgServer) AttestMachine(goCtx context.Context, msg *types.MsgAttestMach
|
|||||||
// and removed from here due to inconsistency or checking the same thing over and over again.
|
// and removed from here due to inconsistency or checking the same thing over and over again.
|
||||||
ta, _, _ := k.GetTrustAnchor(ctx, msg.Machine.MachineId)
|
ta, _, _ := k.GetTrustAnchor(ctx, msg.Machine.MachineId)
|
||||||
|
|
||||||
isValidMachineID, err := util.ValidateSignature(msg.Machine.MachineId, msg.Machine.MachineIdSignature, msg.Machine.MachineId)
|
isValidSecp256r1, errR1 := signature.ValidateSECP256R1Signature(msg.Machine.MachineId, msg.Machine.MachineIdSignature, msg.Machine.MachineId)
|
||||||
if !isValidMachineID {
|
if errR1 != nil || !isValidSecp256r1 {
|
||||||
return nil, err
|
isValidSecp256k1, errK1 := signature.ValidateSignature(msg.Machine.MachineId, msg.Machine.MachineIdSignature, msg.Machine.MachineId)
|
||||||
|
if errK1 != nil || !isValidSecp256k1 {
|
||||||
|
errStr := ""
|
||||||
|
if errR1 != nil {
|
||||||
|
errStr = errR1.Error()
|
||||||
|
}
|
||||||
|
aggreatedErrorMessage := "Invalid machine signature: " + errStr + ", " + errK1.Error()
|
||||||
|
return nil, errors.New(aggreatedErrorMessage)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
isValidIssuerPlanetmint := validateExtendedPublicKey(msg.Machine.IssuerPlanetmint, config.PlmntNetParams)
|
isValidIssuerPlanetmint := validateExtendedPublicKey(msg.Machine.IssuerPlanetmint, config.PlmntNetParams)
|
||||||
@ -50,19 +61,35 @@ func (k msgServer) AttestMachine(goCtx context.Context, msg *types.MsgAttestMach
|
|||||||
} else {
|
} else {
|
||||||
util.GetAppLogger().Info(ctx, "Machine NFT issuance successful: "+msg.Machine.String())
|
util.GetAppLogger().Info(ctx, "Machine NFT issuance successful: "+msg.Machine.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
k.sendInitialFundingTokensToMachine(goCtx, msg.GetMachine().GetAddress(), params)
|
||||||
} else {
|
} else {
|
||||||
util.GetAppLogger().Info(ctx, "Not block proposer: skipping Machine NFT issuance")
|
util.GetAppLogger().Info(ctx, "Not block proposer: skipping Machine NFT issuance")
|
||||||
}
|
}
|
||||||
|
|
||||||
k.StoreMachine(ctx, *msg.Machine)
|
k.StoreMachine(ctx, *msg.Machine)
|
||||||
k.StoreMachineIndex(ctx, *msg.Machine)
|
k.StoreMachineIndex(ctx, *msg.Machine)
|
||||||
err = k.StoreTrustAnchor(ctx, ta, true)
|
err := k.StoreTrustAnchor(ctx, ta, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return &types.MsgAttestMachineResponse{}, err
|
return &types.MsgAttestMachineResponse{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (k msgServer) sendInitialFundingTokensToMachine(goCtx context.Context, machineAddressString string, keeperParams types.Params) {
|
||||||
|
ctx := sdk.UnwrapSDKContext(goCtx)
|
||||||
|
machineAddress, err := sdk.AccAddressFromBech32(machineAddressString)
|
||||||
|
if err != nil {
|
||||||
|
util.GetAppLogger().Error(ctx, "error: for provided address "+machineAddress.String())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
logMsg := fmt.Sprintf("transferring %v tokens to address %s", keeperParams.GetDaoMachineFundingAmount(), machineAddress.String())
|
||||||
|
util.GetAppLogger().Info(ctx, logMsg)
|
||||||
|
util.SendTokens(goCtx, machineAddress, keeperParams.GetDaoMachineFundingAmount(), keeperParams.GetDaoMachineFundingDenom())
|
||||||
|
}
|
||||||
|
|
||||||
func validateExtendedPublicKey(issuer string, cfg chaincfg.Params) bool {
|
func validateExtendedPublicKey(issuer string, cfg chaincfg.Params) bool {
|
||||||
xpubKey, err := hdkeychain.NewKeyFromString(issuer)
|
xpubKey, err := hdkeychain.NewKeyFromString(issuer)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@ -35,6 +35,12 @@ func validatePublicKey(pubkey string) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// uncompressed key
|
||||||
|
if len(pubkeyBytes) == 64 {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// compressed key
|
||||||
// Check if byte slice has correct length
|
// Check if byte slice has correct length
|
||||||
if len(pubkeyBytes) != 33 {
|
if len(pubkeyBytes) != 33 {
|
||||||
return false
|
return false
|
||||||
|
|||||||
@ -71,6 +71,18 @@ func TestMsgServerRegisterTrustAnchor(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestMsgServerRegisterTrustAnchorUncompressedKey(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
pk := "6003d0ab9af4ec112629195a7266a244aecf1ac7691da0084be3e7ceea2ee71571b0963fffd9c80a640317509a681ac66c2ed70ecc9f317a0d2b1a9bff94ff74"
|
||||||
|
ta := moduleobject.TrustAnchor(pk)
|
||||||
|
msg := types.NewMsgRegisterTrustAnchor(pk, &ta)
|
||||||
|
msgServer, ctx := setupMsgServer(t)
|
||||||
|
res, err := msgServer.RegisterTrustAnchor(ctx, msg)
|
||||||
|
if assert.NoError(t, err) {
|
||||||
|
assert.Equal(t, &types.MsgRegisterTrustAnchorResponse{}, res)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestMsgServerRegisterTrustAnchorTwice(t *testing.T) {
|
func TestMsgServerRegisterTrustAnchorTwice(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
_, pk := sample.KeyPair()
|
_, pk := sample.KeyPair()
|
||||||
|
|||||||
@ -21,4 +21,6 @@ var (
|
|||||||
ErrAssetRegistryReqFailure = errorsmod.Register(ModuleName, 13, "request to asset registry could not be created")
|
ErrAssetRegistryReqFailure = errorsmod.Register(ModuleName, 13, "request to asset registry could not be created")
|
||||||
ErrAssetRegistryReqSending = errorsmod.Register(ModuleName, 14, "request to asset registry could not be sent")
|
ErrAssetRegistryReqSending = errorsmod.Register(ModuleName, 14, "request to asset registry could not be sent")
|
||||||
ErrAssetRegistryRepsonse = errorsmod.Register(ModuleName, 15, "request response issue")
|
ErrAssetRegistryRepsonse = errorsmod.Register(ModuleName, 15, "request response issue")
|
||||||
|
ErrInvalidAddress = errorsmod.Register(ModuleName, 16, "invalid address")
|
||||||
|
ErrTransferFailed = errorsmod.Register(ModuleName, 17, "transfer failed")
|
||||||
)
|
)
|
||||||
|
|||||||
@ -13,17 +13,20 @@ func ParamKeyTable() paramtypes.KeyTable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewParams creates a new Params instance
|
// NewParams creates a new Params instance
|
||||||
func NewParams(assetRegistryScheme string, assetRegistryDomain string, assetRegistryPath string) Params {
|
func NewParams(assetRegistryScheme string, assetRegistryDomain string, assetRegistryPath string,
|
||||||
|
daoMachineFundingAmount uint64, daoMachineFundingDenom string) Params {
|
||||||
return Params{
|
return Params{
|
||||||
AssetRegistryScheme: assetRegistryScheme,
|
AssetRegistryScheme: assetRegistryScheme,
|
||||||
AssetRegistryDomain: assetRegistryDomain,
|
AssetRegistryDomain: assetRegistryDomain,
|
||||||
AssetRegistryPath: assetRegistryPath,
|
AssetRegistryPath: assetRegistryPath,
|
||||||
|
DaoMachineFundingAmount: daoMachineFundingAmount,
|
||||||
|
DaoMachineFundingDenom: daoMachineFundingDenom,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// DefaultParams returns a default set of parameters
|
// DefaultParams returns a default set of parameters
|
||||||
func DefaultParams() Params {
|
func DefaultParams() Params {
|
||||||
return NewParams("https", "testnet-assets.rddl.io", "register_asset")
|
return NewParams("https", "testnet-assets.rddl.io", "register_asset", 8800, "plmnt")
|
||||||
}
|
}
|
||||||
|
|
||||||
// ParamSetPairs get the params.ParamSet
|
// ParamSetPairs get the params.ParamSet
|
||||||
|
|||||||
@ -25,9 +25,11 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
|||||||
|
|
||||||
// Params defines the parameters for the module.
|
// Params defines the parameters for the module.
|
||||||
type Params struct {
|
type Params struct {
|
||||||
AssetRegistryScheme string `protobuf:"bytes,1,opt,name=asset_registry_scheme,json=assetRegistryScheme,proto3" json:"asset_registry_scheme,omitempty"`
|
AssetRegistryScheme string `protobuf:"bytes,1,opt,name=asset_registry_scheme,json=assetRegistryScheme,proto3" json:"asset_registry_scheme,omitempty"`
|
||||||
AssetRegistryDomain string `protobuf:"bytes,2,opt,name=asset_registry_domain,json=assetRegistryDomain,proto3" json:"asset_registry_domain,omitempty"`
|
AssetRegistryDomain string `protobuf:"bytes,2,opt,name=asset_registry_domain,json=assetRegistryDomain,proto3" json:"asset_registry_domain,omitempty"`
|
||||||
AssetRegistryPath string `protobuf:"bytes,3,opt,name=asset_registry_path,json=assetRegistryPath,proto3" json:"asset_registry_path,omitempty"`
|
AssetRegistryPath string `protobuf:"bytes,3,opt,name=asset_registry_path,json=assetRegistryPath,proto3" json:"asset_registry_path,omitempty"`
|
||||||
|
DaoMachineFundingAmount uint64 `protobuf:"varint,4,opt,name=dao_machine_funding_amount,json=daoMachineFundingAmount,proto3" json:"dao_machine_funding_amount,omitempty"`
|
||||||
|
DaoMachineFundingDenom string `protobuf:"bytes,5,opt,name=dao_machine_funding_denom,json=daoMachineFundingDenom,proto3" json:"dao_machine_funding_denom,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Params) Reset() { *m = Params{} }
|
func (m *Params) Reset() { *m = Params{} }
|
||||||
@ -83,6 +85,20 @@ func (m *Params) GetAssetRegistryPath() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *Params) GetDaoMachineFundingAmount() uint64 {
|
||||||
|
if m != nil {
|
||||||
|
return m.DaoMachineFundingAmount
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Params) GetDaoMachineFundingDenom() string {
|
||||||
|
if m != nil {
|
||||||
|
return m.DaoMachineFundingDenom
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
proto.RegisterType((*Params)(nil), "planetmintgo.machine.Params")
|
proto.RegisterType((*Params)(nil), "planetmintgo.machine.Params")
|
||||||
}
|
}
|
||||||
@ -90,22 +106,26 @@ func init() {
|
|||||||
func init() { proto.RegisterFile("planetmintgo/machine/params.proto", fileDescriptor_84cd778d65e6639c) }
|
func init() { proto.RegisterFile("planetmintgo/machine/params.proto", fileDescriptor_84cd778d65e6639c) }
|
||||||
|
|
||||||
var fileDescriptor_84cd778d65e6639c = []byte{
|
var fileDescriptor_84cd778d65e6639c = []byte{
|
||||||
// 233 bytes of a gzipped FileDescriptorProto
|
// 295 bytes of a gzipped FileDescriptorProto
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x2c, 0xc8, 0x49, 0xcc,
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0xb1, 0x4e, 0xeb, 0x30,
|
||||||
0x4b, 0x2d, 0xc9, 0xcd, 0xcc, 0x2b, 0x49, 0xcf, 0xd7, 0xcf, 0x4d, 0x4c, 0xce, 0xc8, 0xcc, 0x4b,
|
0x14, 0x40, 0xe3, 0xbe, 0xbc, 0x4a, 0x78, 0x23, 0x2d, 0x10, 0x3a, 0x98, 0xc2, 0xd4, 0x85, 0x44,
|
||||||
0xd5, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x41,
|
0xa2, 0x13, 0x30, 0x81, 0x2a, 0xb6, 0x4a, 0x55, 0xd8, 0x58, 0x22, 0x37, 0x31, 0x8e, 0x25, 0xec,
|
||||||
0x56, 0xa2, 0x07, 0x55, 0x22, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, 0x56, 0xa0, 0x0f, 0x62, 0x41,
|
0x1b, 0xc5, 0x8e, 0x44, 0xff, 0x82, 0x91, 0x09, 0xf1, 0x39, 0x8c, 0x1d, 0x19, 0x51, 0xf2, 0x23,
|
||||||
0xd4, 0x2a, 0x2d, 0x63, 0xe4, 0x62, 0x0b, 0x00, 0x6b, 0x16, 0x32, 0xe2, 0x12, 0x4d, 0x2c, 0x2e,
|
0xa8, 0x4e, 0x04, 0x05, 0xb2, 0x5d, 0xe9, 0x9c, 0x23, 0xcb, 0xf7, 0xe2, 0xe3, 0xfc, 0x81, 0x2a,
|
||||||
0x4e, 0x2d, 0x89, 0x2f, 0x4a, 0x4d, 0xcf, 0x2c, 0x2e, 0x29, 0xaa, 0x8c, 0x2f, 0x4e, 0xce, 0x48,
|
0x66, 0xa4, 0x50, 0x86, 0x43, 0x28, 0x69, 0x92, 0x09, 0xc5, 0xc2, 0x9c, 0x16, 0x54, 0xea, 0x20,
|
||||||
0xcd, 0x4d, 0x95, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x12, 0x06, 0x4b, 0x06, 0x41, 0xe5, 0x82,
|
0x2f, 0xc0, 0x80, 0x37, 0xdc, 0x56, 0x82, 0x56, 0x19, 0x0d, 0x39, 0x70, 0xb0, 0x42, 0xb8, 0x99,
|
||||||
0xc1, 0x52, 0x58, 0xf4, 0xa4, 0xe4, 0xe7, 0x26, 0x66, 0xe6, 0x49, 0x30, 0x61, 0xd1, 0xe3, 0x02,
|
0x1a, 0xf7, 0xe4, 0xa5, 0x87, 0xfb, 0x0b, 0x1b, 0x7b, 0x67, 0x78, 0x8f, 0x6a, 0xcd, 0x4c, 0x5c,
|
||||||
0x96, 0x12, 0xd2, 0xe3, 0x12, 0x46, 0xd3, 0x53, 0x90, 0x58, 0x92, 0x21, 0xc1, 0x0c, 0xd6, 0x21,
|
0x30, 0x2e, 0xb4, 0x29, 0x56, 0xb1, 0x4e, 0x32, 0x26, 0x99, 0x8f, 0xc6, 0x68, 0xb2, 0x13, 0x0d,
|
||||||
0x88, 0xa2, 0x23, 0x20, 0xb1, 0x24, 0xc3, 0x8a, 0x65, 0xc6, 0x02, 0x79, 0x06, 0x27, 0xdf, 0x13,
|
0x2c, 0x8c, 0x5a, 0x76, 0x6b, 0x51, 0x47, 0x93, 0x82, 0xa4, 0x42, 0xf9, 0xbd, 0x8e, 0x66, 0x66,
|
||||||
0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86,
|
0x91, 0x17, 0xe0, 0xc1, 0xaf, 0x26, 0xa7, 0x26, 0xf3, 0xff, 0xd9, 0x62, 0xf7, 0x47, 0xb1, 0xa0,
|
||||||
0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0x32, 0x4e, 0xcf, 0x2c, 0xc9, 0x28, 0x4d,
|
0x26, 0xf3, 0x2e, 0xf1, 0x28, 0xa5, 0x10, 0xb7, 0xff, 0x88, 0xef, 0x4b, 0x95, 0x0a, 0xc5, 0x63,
|
||||||
0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x47, 0xf8, 0x1c, 0x89, 0xa9, 0x9b, 0x9e, 0xaf, 0x5f, 0x01, 0x0f,
|
0x2a, 0xa1, 0x54, 0xc6, 0x77, 0xc7, 0x68, 0xe2, 0x46, 0x07, 0x29, 0x85, 0x79, 0x23, 0xdc, 0x34,
|
||||||
0xaa, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0xf7, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff,
|
0xfc, 0xca, 0x62, 0xef, 0x1c, 0x1f, 0x76, 0xc5, 0x29, 0x53, 0x20, 0xfd, 0xff, 0xf6, 0xc9, 0xfd,
|
||||||
0xff, 0x50, 0x39, 0xf4, 0xa3, 0x4f, 0x01, 0x00, 0x00,
|
0x3f, 0xed, 0x6c, 0x43, 0x2f, 0xdc, 0xe7, 0xd7, 0x23, 0xe7, 0x7a, 0xfe, 0x56, 0x11, 0xb4, 0xae,
|
||||||
|
0x08, 0xfa, 0xa8, 0x08, 0x7a, 0xaa, 0x89, 0xb3, 0xae, 0x89, 0xf3, 0x5e, 0x13, 0xe7, 0x6e, 0xca,
|
||||||
|
0x85, 0xc9, 0xca, 0x65, 0x90, 0x80, 0x0c, 0xbf, 0x37, 0xbe, 0x35, 0x9e, 0x72, 0x08, 0x1f, 0xbf,
|
||||||
|
0x4e, 0x64, 0x56, 0x39, 0xd3, 0xcb, 0xbe, 0x5d, 0xfb, 0xf4, 0x33, 0x00, 0x00, 0xff, 0xff, 0xb0,
|
||||||
|
0xd8, 0x7a, 0xbe, 0xc7, 0x01, 0x00, 0x00,
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Params) Marshal() (dAtA []byte, err error) {
|
func (m *Params) Marshal() (dAtA []byte, err error) {
|
||||||
@ -128,6 +148,18 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|||||||
_ = i
|
_ = i
|
||||||
var l int
|
var l int
|
||||||
_ = l
|
_ = l
|
||||||
|
if len(m.DaoMachineFundingDenom) > 0 {
|
||||||
|
i -= len(m.DaoMachineFundingDenom)
|
||||||
|
copy(dAtA[i:], m.DaoMachineFundingDenom)
|
||||||
|
i = encodeVarintParams(dAtA, i, uint64(len(m.DaoMachineFundingDenom)))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x2a
|
||||||
|
}
|
||||||
|
if m.DaoMachineFundingAmount != 0 {
|
||||||
|
i = encodeVarintParams(dAtA, i, uint64(m.DaoMachineFundingAmount))
|
||||||
|
i--
|
||||||
|
dAtA[i] = 0x20
|
||||||
|
}
|
||||||
if len(m.AssetRegistryPath) > 0 {
|
if len(m.AssetRegistryPath) > 0 {
|
||||||
i -= len(m.AssetRegistryPath)
|
i -= len(m.AssetRegistryPath)
|
||||||
copy(dAtA[i:], m.AssetRegistryPath)
|
copy(dAtA[i:], m.AssetRegistryPath)
|
||||||
@ -181,6 +213,13 @@ func (m *Params) Size() (n int) {
|
|||||||
if l > 0 {
|
if l > 0 {
|
||||||
n += 1 + l + sovParams(uint64(l))
|
n += 1 + l + sovParams(uint64(l))
|
||||||
}
|
}
|
||||||
|
if m.DaoMachineFundingAmount != 0 {
|
||||||
|
n += 1 + sovParams(uint64(m.DaoMachineFundingAmount))
|
||||||
|
}
|
||||||
|
l = len(m.DaoMachineFundingDenom)
|
||||||
|
if l > 0 {
|
||||||
|
n += 1 + l + sovParams(uint64(l))
|
||||||
|
}
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -315,6 +354,57 @@ func (m *Params) Unmarshal(dAtA []byte) error {
|
|||||||
}
|
}
|
||||||
m.AssetRegistryPath = string(dAtA[iNdEx:postIndex])
|
m.AssetRegistryPath = string(dAtA[iNdEx:postIndex])
|
||||||
iNdEx = postIndex
|
iNdEx = postIndex
|
||||||
|
case 4:
|
||||||
|
if wireType != 0 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field DaoMachineFundingAmount", wireType)
|
||||||
|
}
|
||||||
|
m.DaoMachineFundingAmount = 0
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowParams
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
m.DaoMachineFundingAmount |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
case 5:
|
||||||
|
if wireType != 2 {
|
||||||
|
return fmt.Errorf("proto: wrong wireType = %d for field DaoMachineFundingDenom", wireType)
|
||||||
|
}
|
||||||
|
var stringLen uint64
|
||||||
|
for shift := uint(0); ; shift += 7 {
|
||||||
|
if shift >= 64 {
|
||||||
|
return ErrIntOverflowParams
|
||||||
|
}
|
||||||
|
if iNdEx >= l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
b := dAtA[iNdEx]
|
||||||
|
iNdEx++
|
||||||
|
stringLen |= uint64(b&0x7F) << shift
|
||||||
|
if b < 0x80 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
intStringLen := int(stringLen)
|
||||||
|
if intStringLen < 0 {
|
||||||
|
return ErrInvalidLengthParams
|
||||||
|
}
|
||||||
|
postIndex := iNdEx + intStringLen
|
||||||
|
if postIndex < 0 {
|
||||||
|
return ErrInvalidLengthParams
|
||||||
|
}
|
||||||
|
if postIndex > l {
|
||||||
|
return io.ErrUnexpectedEOF
|
||||||
|
}
|
||||||
|
m.DaoMachineFundingDenom = string(dAtA[iNdEx:postIndex])
|
||||||
|
iNdEx = postIndex
|
||||||
default:
|
default:
|
||||||
iNdEx = preIndex
|
iNdEx = preIndex
|
||||||
skippy, err := skipParams(dAtA[iNdEx:])
|
skippy, err := skipParams(dAtA[iNdEx:])
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user