From 321aed823c882ac893c739c8a4d50905ec702c62 Mon Sep 17 00:00:00 2001 From: Amaury <1293565+amaurym@users.noreply.github.com> Date: Mon, 17 May 2021 14:57:24 +0200 Subject: [PATCH] v043 audit changes for `types/` (#9290) --- docs/core/proto-docs.md | 2 +- proto/cosmos/base/query/v1beta1/pagination.proto | 2 +- proto/cosmos/base/reflection/v1beta1/reflection.proto | 2 +- types/address.go | 3 +-- types/address/README.md | 2 +- types/address/hash.go | 1 + types/query/pagination.go | 3 +-- types/query/pagination.pb.go | 2 +- types/query/pagination_test.go | 1 - 9 files changed, 8 insertions(+), 10 deletions(-) diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index 254ce496c8..7e57d3225b 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -715,7 +715,7 @@ pagination. Ex: | `offset` | [uint64](#uint64) | | offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of offset or key should be set. | | `limit` | [uint64](#uint64) | | limit is the total number of results to be returned in the result page. If left empty it will default to a value to be set by each app. | | `count_total` | [bool](#bool) | | count_total is set to true to indicate that the result set should include a count of the total number of items available for pagination in UIs. count_total is only respected when offset is used. It is ignored when key is set. | -| `reverse` | [bool](#bool) | | reverse is set to true indicates that, results to be returned in the descending order. | +| `reverse` | [bool](#bool) | | reverse is set to true if results are to be returned in the descending order. | diff --git a/proto/cosmos/base/query/v1beta1/pagination.proto b/proto/cosmos/base/query/v1beta1/pagination.proto index 7ee60f18d5..784c479562 100644 --- a/proto/cosmos/base/query/v1beta1/pagination.proto +++ b/proto/cosmos/base/query/v1beta1/pagination.proto @@ -31,7 +31,7 @@ message PageRequest { // is set. bool count_total = 4; - // reverse is set to true indicates that, results to be returned in the descending order. + // reverse is set to true if results are to be returned in the descending order. bool reverse = 5; } diff --git a/proto/cosmos/base/reflection/v1beta1/reflection.proto b/proto/cosmos/base/reflection/v1beta1/reflection.proto index 8ac4f11586..22670e72b8 100644 --- a/proto/cosmos/base/reflection/v1beta1/reflection.proto +++ b/proto/cosmos/base/reflection/v1beta1/reflection.proto @@ -41,4 +41,4 @@ message ListImplementationsRequest { // RPC. message ListImplementationsResponse { repeated string implementation_message_names = 1; -} \ No newline at end of file +} diff --git a/types/address.go b/types/address.go index 16b14a3f90..8ae46d119c 100644 --- a/types/address.go +++ b/types/address.go @@ -9,9 +9,8 @@ import ( "strings" "sync" - yaml "gopkg.in/yaml.v2" - "github.com/hashicorp/golang-lru/simplelru" + yaml "gopkg.in/yaml.v2" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/internal/conv" diff --git a/types/address/README.md b/types/address/README.md index ebc647ec0f..2697548d6d 100644 --- a/types/address/README.md +++ b/types/address/README.md @@ -1,6 +1,6 @@ # Account -This package defines Cosmos SDK address related functions. +This package defines Cosmos SDK address-related functions. ## References diff --git a/types/address/hash.go b/types/address/hash.go index 8d9c5b39e1..2e5496897a 100644 --- a/types/address/hash.go +++ b/types/address/hash.go @@ -13,6 +13,7 @@ import ( // Len is the length of base addresses const Len = sha256.Size +// Addressable represents any type from which we can derive an address. type Addressable interface { Address() []byte } diff --git a/types/query/pagination.go b/types/query/pagination.go index dc7f678c56..3244e28325 100644 --- a/types/query/pagination.go +++ b/types/query/pagination.go @@ -4,11 +4,10 @@ import ( "fmt" "math" + db "github.com/tendermint/tm-db" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - db "github.com/tendermint/tm-db" - "github.com/cosmos/cosmos-sdk/store/types" ) diff --git a/types/query/pagination.pb.go b/types/query/pagination.pb.go index cf1be5b980..3b1455d6f2 100644 --- a/types/query/pagination.pb.go +++ b/types/query/pagination.pb.go @@ -46,7 +46,7 @@ type PageRequest struct { // count_total is only respected when offset is used. It is ignored when key // is set. CountTotal bool `protobuf:"varint,4,opt,name=count_total,json=countTotal,proto3" json:"count_total,omitempty"` - // reverse is set to true indicates that, results to be returned in the descending order. + // reverse is set to true if results are to be returned in the descending order. Reverse bool `protobuf:"varint,5,opt,name=reverse,proto3" json:"reverse,omitempty"` } diff --git a/types/query/pagination_test.go b/types/query/pagination_test.go index 0ecc948a62..7bf1956ad4 100644 --- a/types/query/pagination_test.go +++ b/types/query/pagination_test.go @@ -6,7 +6,6 @@ import ( "testing" "github.com/stretchr/testify/suite" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db"