From 6f06753a2ab0db20899413cb6c281f8821ae9b58 Mon Sep 17 00:00:00 2001 From: omahs <73983677+omahs@users.noreply.github.com> Date: Thu, 5 Jan 2023 14:51:51 +0100 Subject: [PATCH 1/4] Fix: typos Fix: typos --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6168198bd3..705372998d 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ This is forked from [`cosmos-sdk`](https://github.com/cosmos/cosmos-sdk) at 2021 The [LBM SDK](https://github.com/line/lbm-sdk) is an open-source framework for building multi-asset public Proof-of-Stake (PoS) blockchains, as well as permissioned Proof-Of-Authority (PoA) blockchains. Blockchains built with the Cosmos SDK are generally referred to as **application-specific blockchains**. -The purpose of `LBM SDK` is to succeed to [the objectives of `Cosmos sdk`](https://github.com/cosmos/cosmos-sdk/blob/master/docs/intro/overview.md) while helping develop blockchains that requires faster transaction processing to be applied to reality. +The purpose of `LBM SDK` is to succeed to [the objectives of `Cosmos sdk`](https://github.com/cosmos/cosmos-sdk/blob/master/docs/intro/overview.md) while helping develop blockchains that require faster transaction processing to be applied to reality. ## Why the LBM SDK? @@ -68,6 +68,6 @@ simd start --home ~/.simapp/simapp1   ## Follow Guide -You can refer the sample tx commands at [here](docs/sample-tx.md) +You can refer to the sample tx commands [here](docs/sample-tx.md). Test different commands to get a broader understanding of lbm From 6fd7203ebc726a59026601919a6ca10b8926e80e Mon Sep 17 00:00:00 2001 From: omahs <73983677+omahs@users.noreply.github.com> Date: Thu, 5 Jan 2023 14:54:32 +0100 Subject: [PATCH 2/4] Fix: typo Fix: typo --- store/types/listening.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/store/types/listening.go b/store/types/listening.go index afa9dce7f2..641bbe03bb 100644 --- a/store/types/listening.go +++ b/store/types/listening.go @@ -9,7 +9,7 @@ import ( // WriteListener interface for streaming data out from a listenkv.Store type WriteListener interface { // if value is nil then it was deleted - // storeKey indicates the source KVStore, to facilitate using the the same WriteListener across separate KVStores + // storeKey indicates the source KVStore, to facilitate using the same WriteListener across separate KVStores // delete bool indicates if it was a delete; true: delete, false: set OnWrite(storeKey StoreKey, key []byte, value []byte, delete bool) error } From ba3060df6dc1b15932f9228c033ac25e18e0f848 Mon Sep 17 00:00:00 2001 From: omahs <73983677+omahs@users.noreply.github.com> Date: Thu, 5 Jan 2023 14:56:18 +0100 Subject: [PATCH 3/4] Fix: typo Fix: typo --- client/context.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/context.go b/client/context.go index 575610a959..f270e88c4b 100644 --- a/client/context.go +++ b/client/context.go @@ -71,7 +71,7 @@ func (ctx Context) WithKeyringOptions(opts ...keyring.Option) Context { // WithInput returns a copy of the context with an updated input. func (ctx Context) WithInput(r io.Reader) Context { - // convert to a bufio.Reader to have a shared buffer between the keyring and the + // convert to a bufio.Reader to have a shared buffer between the keyring and // the Commands, ensuring a read from one advance the read pointer for the other. // see https://github.com/cosmos/cosmos-sdk/issues/9566. ctx.Input = bufio.NewReader(r) From 58d8f82a776aad4832a8b01abf538253253be308 Mon Sep 17 00:00:00 2001 From: Jayden Lee <41176085+tkxkd0159@users.noreply.github.com> Date: Wed, 15 Feb 2023 14:48:51 +0900 Subject: [PATCH 4/4] go fmt --- baseapp/testutil/messages.pb.go | 2 +- client/context.go | 2 +- .../secp256k1/internal/secp256k1/curve.go | 2 +- types/query/pagination.pb.go | 16 +-- types/result.go | 1 + x/authz/codec/doc.go | 9 +- x/bankplus/keeper/inactive.go | 3 +- x/distribution/types/distribution.pb.go | 11 +- x/foundation/foundation.pb.go | 16 +-- x/simulation/doc.go | 105 +++++++++--------- 10 files changed, 84 insertions(+), 83 deletions(-) diff --git a/baseapp/testutil/messages.pb.go b/baseapp/testutil/messages.pb.go index 97b19a9db6..801c559332 100644 --- a/baseapp/testutil/messages.pb.go +++ b/baseapp/testutil/messages.pb.go @@ -6,10 +6,10 @@ package testutil import ( context "context" fmt "fmt" - _ "github.com/line/lbm-sdk/codec/types" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" + _ "github.com/line/lbm-sdk/codec/types" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" diff --git a/client/context.go b/client/context.go index f270e88c4b..93caeed094 100644 --- a/client/context.go +++ b/client/context.go @@ -71,7 +71,7 @@ func (ctx Context) WithKeyringOptions(opts ...keyring.Option) Context { // WithInput returns a copy of the context with an updated input. func (ctx Context) WithInput(r io.Reader) Context { - // convert to a bufio.Reader to have a shared buffer between the keyring and + // convert to a bufio.Reader to have a shared buffer between the keyring and // the Commands, ensuring a read from one advance the read pointer for the other. // see https://github.com/cosmos/cosmos-sdk/issues/9566. ctx.Input = bufio.NewReader(r) diff --git a/crypto/keys/secp256k1/internal/secp256k1/curve.go b/crypto/keys/secp256k1/internal/secp256k1/curve.go index 795d9b31ee..b9903f751e 100644 --- a/crypto/keys/secp256k1/internal/secp256k1/curve.go +++ b/crypto/keys/secp256k1/internal/secp256k1/curve.go @@ -30,7 +30,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -//nolint +// nolint package secp256k1 import ( diff --git a/types/query/pagination.pb.go b/types/query/pagination.pb.go index 9ae58ba42a..6de11763c7 100644 --- a/types/query/pagination.pb.go +++ b/types/query/pagination.pb.go @@ -25,10 +25,10 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // PageRequest is to be embedded in gRPC request messages for efficient // pagination. Ex: // -// message SomeRequest { -// Foo some_parameter = 1; -// PageRequest pagination = 2; -// } +// message SomeRequest { +// Foo some_parameter = 1; +// PageRequest pagination = 2; +// } type PageRequest struct { // key is a value returned in PageResponse.next_key to begin // querying the next page most efficiently. Only one of offset or key @@ -123,10 +123,10 @@ func (m *PageRequest) GetReverse() bool { // PageResponse is to be embedded in gRPC response messages where the // corresponding request message has used PageRequest. // -// message SomeResponse { -// repeated Bar results = 1; -// PageResponse page = 2; -// } +// message SomeResponse { +// repeated Bar results = 1; +// PageResponse page = 2; +// } type PageResponse struct { // next_key is the key to be passed to PageRequest.key to // query the next page most efficiently diff --git a/types/result.go b/types/result.go index 19fe717cad..325273b9d0 100644 --- a/types/result.go +++ b/types/result.go @@ -35,6 +35,7 @@ func (r Result) GetEvents() Events { } // ABCIMessageLogs represents a slice of ABCIMessageLog. +// //easyjson:json type ABCIMessageLogs []ABCIMessageLog diff --git a/x/authz/codec/doc.go b/x/authz/codec/doc.go index ecc365a221..90ba63f6d6 100644 --- a/x/authz/codec/doc.go +++ b/x/authz/codec/doc.go @@ -6,13 +6,12 @@ can be (de)serialized properly. Amino types should be ideally registered inside this codec within the init function of each module's codec.go file as follows: -func init() { - // ... + func init() { + // ... - RegisterLegacyAminoCodec(authzcodec.Amino) -} + RegisterLegacyAminoCodec(authzcodec.Amino) + } The codec instance is put inside this package and not the x/authz package in order to avoid any dependency cycle. - */ package codec diff --git a/x/bankplus/keeper/inactive.go b/x/bankplus/keeper/inactive.go index 5abca4b16d..b1efdc82b7 100644 --- a/x/bankplus/keeper/inactive.go +++ b/x/bankplus/keeper/inactive.go @@ -13,8 +13,9 @@ func inactiveAddrKey(addr sdk.AccAddress) []byte { return append(inactiveAddrsKeyPrefix, addr.Bytes()...) } -//nolint:deadcode,unused // isStoredInactiveAddr checks if the address is stored or not as blocked address +// +//nolint:deadcode,unused func (keeper BaseKeeper) isStoredInactiveAddr(ctx sdk.Context, address sdk.AccAddress) bool { store := ctx.KVStore(keeper.storeKey) bz := store.Get(inactiveAddrKey(address)) diff --git a/x/distribution/types/distribution.pb.go b/x/distribution/types/distribution.pb.go index c935368ff3..73527fbf43 100644 --- a/x/distribution/types/distribution.pb.go +++ b/x/distribution/types/distribution.pb.go @@ -79,11 +79,12 @@ func (m *Params) GetWithdrawAddrEnabled() bool { // The reference count indicates the number of objects // which might need to reference this historical entry at any point. // ReferenceCount = -// number of outstanding delegations which ended the associated period (and -// might need to read that record) -// + number of slashes which ended the associated period (and might need to -// read that record) -// + one per validator for the zeroeth period, set on initialization +// +// number of outstanding delegations which ended the associated period (and +// might need to read that record) +// + number of slashes which ended the associated period (and might need to +// read that record) +// + one per validator for the zeroeth period, set on initialization type ValidatorHistoricalRewards struct { CumulativeRewardRatio github_com_line_lbm_sdk_types.DecCoins `protobuf:"bytes,1,rep,name=cumulative_reward_ratio,json=cumulativeRewardRatio,proto3,castrepeated=github.com/line/lbm-sdk/types.DecCoins" json:"cumulative_reward_ratio" yaml:"cumulative_reward_ratio"` ReferenceCount uint32 `protobuf:"varint,2,opt,name=reference_count,json=referenceCount,proto3" json:"reference_count,omitempty" yaml:"reference_count"` diff --git a/x/foundation/foundation.pb.go b/x/foundation/foundation.pb.go index bef3ece392..c99bfb0b54 100644 --- a/x/foundation/foundation.pb.go +++ b/x/foundation/foundation.pb.go @@ -334,10 +334,10 @@ func (m *MemberRequest) GetMetadata() string { // ThresholdDecisionPolicy is a decision policy where a proposal passes when it // satisfies the two following conditions: -// 1. The sum of all `YES` voters' weights is greater or equal than the defined -// `threshold`. -// 2. The voting and execution periods of the proposal respect the parameters -// given by `windows`. +// 1. The sum of all `YES` voters' weights is greater or equal than the defined +// `threshold`. +// 2. The voting and execution periods of the proposal respect the parameters +// given by `windows`. type ThresholdDecisionPolicy struct { // threshold is the minimum sum of yes votes that must be met or exceeded for a proposal to succeed. Threshold github_com_line_lbm_sdk_types.Dec `protobuf:"bytes,1,opt,name=threshold,proto3,customtype=github.com/line/lbm-sdk/types.Dec" json:"threshold"` @@ -387,10 +387,10 @@ func (m *ThresholdDecisionPolicy) GetWindows() *DecisionPolicyWindows { // PercentageDecisionPolicy is a decision policy where a proposal passes when // it satisfies the two following conditions: -// 1. The percentage of all `YES` voters' weights out of the total group weight -// is greater or equal than the given `percentage`. -// 2. The voting and execution periods of the proposal respect the parameters -// given by `windows`. +// 1. The percentage of all `YES` voters' weights out of the total group weight +// is greater or equal than the given `percentage`. +// 2. The voting and execution periods of the proposal respect the parameters +// given by `windows`. type PercentageDecisionPolicy struct { // percentage is the minimum percentage the sum of yes votes must meet for a proposal to succeed. Percentage github_com_line_lbm_sdk_types.Dec `protobuf:"bytes,1,opt,name=percentage,proto3,customtype=github.com/line/lbm-sdk/types.Dec" json:"percentage"` diff --git a/x/simulation/doc.go b/x/simulation/doc.go index 7598983148..b4dbda4726 100644 --- a/x/simulation/doc.go +++ b/x/simulation/doc.go @@ -48,71 +48,70 @@ others state execution outcome. To execute a completely pseudo-random simulation: - $ go test -mod=readonly github.com/line/lbm-sdk/simapp \ - -run=TestFullAppSimulation \ - -Enabled=true \ - -NumBlocks=100 \ - -BlockSize=200 \ - -Commit=true \ - -Seed=99 \ - -Period=5 \ - -v -timeout 24h + $ go test -mod=readonly github.com/line/lbm-sdk/simapp \ + -run=TestFullAppSimulation \ + -Enabled=true \ + -NumBlocks=100 \ + -BlockSize=200 \ + -Commit=true \ + -Seed=99 \ + -Period=5 \ + -v -timeout 24h To execute simulation from a genesis file: - $ go test -mod=readonly github.com/line/lbm-sdk/simapp \ - -run=TestFullAppSimulation \ - -Enabled=true \ - -NumBlocks=100 \ - -BlockSize=200 \ - -Commit=true \ - -Seed=99 \ - -Period=5 \ - -Genesis=/path/to/genesis.json \ - -v -timeout 24h + $ go test -mod=readonly github.com/line/lbm-sdk/simapp \ + -run=TestFullAppSimulation \ + -Enabled=true \ + -NumBlocks=100 \ + -BlockSize=200 \ + -Commit=true \ + -Seed=99 \ + -Period=5 \ + -Genesis=/path/to/genesis.json \ + -v -timeout 24h To execute simulation from a simulation params file: - $ go test -mod=readonly github.com/line/lbm-sdk/simapp \ - -run=TestFullAppSimulation \ - -Enabled=true \ - -NumBlocks=100 \ - -BlockSize=200 \ - -Commit=true \ - -Seed=99 \ - -Period=5 \ - -Params=/path/to/params.json \ - -v -timeout 24h + $ go test -mod=readonly github.com/line/lbm-sdk/simapp \ + -run=TestFullAppSimulation \ + -Enabled=true \ + -NumBlocks=100 \ + -BlockSize=200 \ + -Commit=true \ + -Seed=99 \ + -Period=5 \ + -Params=/path/to/params.json \ + -v -timeout 24h To export the simulation params to a file at a given block height: - $ go test -mod=readonly github.com/line/lbm-sdk/simapp \ - -run=TestFullAppSimulation \ - -Enabled=true \ - -NumBlocks=100 \ - -BlockSize=200 \ - -Commit=true \ - -Seed=99 \ - -Period=5 \ - -ExportParamsPath=/path/to/params.json \ - -ExportParamsHeight=50 \ - -v -timeout 24h - + $ go test -mod=readonly github.com/line/lbm-sdk/simapp \ + -run=TestFullAppSimulation \ + -Enabled=true \ + -NumBlocks=100 \ + -BlockSize=200 \ + -Commit=true \ + -Seed=99 \ + -Period=5 \ + -ExportParamsPath=/path/to/params.json \ + -ExportParamsHeight=50 \ + -v -timeout 24h To export the simulation app state (i.e genesis) to a file: - $ go test -mod=readonly github.com/line/lbm-sdk/simapp \ - -run=TestFullAppSimulation \ - -Enabled=true \ - -NumBlocks=100 \ - -BlockSize=200 \ - -Commit=true \ - -Seed=99 \ - -Period=5 \ - -ExportStatePath=/path/to/genesis.json \ - v -timeout 24h - -Params + $ go test -mod=readonly github.com/line/lbm-sdk/simapp \ + -run=TestFullAppSimulation \ + -Enabled=true \ + -NumBlocks=100 \ + -BlockSize=200 \ + -Commit=true \ + -Seed=99 \ + -Period=5 \ + -ExportStatePath=/path/to/genesis.json \ + v -timeout 24h + +# Params Params that are provided to simulation from a JSON file are used to used to set both module parameters and simulation parameters. See sim_test.go for the full