Skip to content

Commit

Permalink
fix the lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
TimmyExogenous committed Mar 7, 2024
1 parent bb6b18a commit c413c7b
Show file tree
Hide file tree
Showing 65 changed files with 2,097 additions and 1,393 deletions.
5 changes: 3 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ import (
"context"
"encoding/json"
"fmt"
"github.com/ExocoreNetwork/exocore/x/operator"
operatorKeeper "github.com/ExocoreNetwork/exocore/x/operator/keeper"
"io"
"net/http"
"os"
"path/filepath"
"sort"

"github.com/ExocoreNetwork/exocore/x/operator"
operatorKeeper "github.com/ExocoreNetwork/exocore/x/operator/keeper"

exoslash "github.com/ExocoreNetwork/exocore/x/slash"

slashKeeper "github.com/ExocoreNetwork/exocore/x/slash/keeper"
Expand Down
5 changes: 3 additions & 2 deletions app/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package app

import (
"encoding/json"
pruningtypes "github.com/cosmos/cosmos-sdk/store/pruning/types"
"os"
"time"

pruningtypes "github.com/cosmos/cosmos-sdk/store/pruning/types"

"cosmossdk.io/simapp"
dbm "github.com/cometbft/cometbft-db"
abci "github.com/cometbft/cometbft/abci/types"
Expand Down Expand Up @@ -221,7 +222,7 @@ func SetupTestingApp(chainID string, pruneOpts *pruningtypes.PruningOptions, isP
map[int64]bool{},
DefaultNodeHome, 5, cfg,
simtestutil.NewAppOptionsWithFlagHome(DefaultNodeHome),
baseAppOptions[:]...,
baseAppOptions...,
)
return app, NewDefaultGenesisState(app.appCodec)
}
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@ require (
go.opencensus.io v0.24.0
golang.org/x/crypto v0.12.0
golang.org/x/exp v0.0.0-20230811145659-89c5cff77bcb
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2
google.golang.org/genproto/googleapis/api v0.0.0-20230726155614-23370e0ffb3e
google.golang.org/grpc v1.57.1
google.golang.org/protobuf v1.31.0
gopkg.in/yaml.v2 v2.4.0
sigs.k8s.io/yaml v1.3.0
)

Expand Down Expand Up @@ -196,15 +199,12 @@ require (
golang.org/x/term v0.11.0 // indirect
golang.org/x/text v0.12.0 // indirect
golang.org/x/tools v0.10.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/api v0.126.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230815205213-6bfd019c3878 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
nhooyr.io/websocket v1.8.7 // indirect
pgregory.net/rapid v0.5.5 // indirect
Expand Down
4 changes: 0 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -786,8 +786,6 @@ github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:Htrtb
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM=
github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU=
github.com/dvsekhvalnov/jose2go v1.5.1-0.20231206184617-48ba0b76bc88 h1:y87odSHhV8WSSnjuFYC+K2V6LpZtEVcjmVWxtUkXZiQ=
github.com/dvsekhvalnov/jose2go v1.5.1-0.20231206184617-48ba0b76bc88/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU=
github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
Expand Down Expand Up @@ -2232,8 +2230,6 @@ google.golang.org/grpc v1.51.0/go.mod h1:wgNDFcnuBGmxLKI/qn4T+m5BtEBYXJPvibbUPsA
google.golang.org/grpc v1.52.0/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5vorUY=
google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw=
google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8=
google.golang.org/grpc v1.57.0 h1:kfzNeI/klCGD2YPMUlaGNT3pxvYfga7smW3Vth8Zsiw=
google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo=
google.golang.org/grpc v1.57.1 h1:upNTNqv0ES+2ZOOqACwVtS3Il8M12/+Hz41RCPzAjQg=
google.golang.org/grpc v1.57.1/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo=
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw=
Expand Down
3 changes: 2 additions & 1 deletion precompiles/delegation/delegation_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package delegation_test

import (
operatortypes "github.com/ExocoreNetwork/exocore/x/operator/types"
"math/big"
"strings"

operatortypes "github.com/ExocoreNetwork/exocore/x/operator/types"

sdkmath "cosmossdk.io/math"

"github.com/ExocoreNetwork/exocore/app"
Expand Down
3 changes: 2 additions & 1 deletion precompiles/delegation/setup_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package delegation_test

import (
"testing"

"github.com/ExocoreNetwork/exocore/precompiles/delegation"
"github.com/ExocoreNetwork/exocore/testutil"
"testing"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
Expand Down
3 changes: 2 additions & 1 deletion precompiles/deposit/setup_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package deposit_test

import (
"github.com/ExocoreNetwork/exocore/testutil"
"testing"

"github.com/ExocoreNetwork/exocore/testutil"

"github.com/ExocoreNetwork/exocore/precompiles/deposit"

. "github.com/onsi/ginkgo/v2"
Expand Down
3 changes: 2 additions & 1 deletion precompiles/reward/setup_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package reward_test

import (
"github.com/ExocoreNetwork/exocore/testutil"
"testing"

"github.com/ExocoreNetwork/exocore/testutil"

"github.com/ExocoreNetwork/exocore/precompiles/reward"

. "github.com/onsi/ginkgo/v2"
Expand Down
3 changes: 2 additions & 1 deletion precompiles/slash/setup_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package slash_test

import (
"github.com/ExocoreNetwork/exocore/testutil"
"testing"

"github.com/ExocoreNetwork/exocore/testutil"

"github.com/ExocoreNetwork/exocore/precompiles/slash"

. "github.com/onsi/ginkgo/v2"
Expand Down
3 changes: 2 additions & 1 deletion precompiles/withdraw/setup_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package withdraw_test

import (
"github.com/ExocoreNetwork/exocore/testutil"
"testing"

"github.com/ExocoreNetwork/exocore/testutil"

"github.com/ExocoreNetwork/exocore/precompiles/withdraw"

. "github.com/onsi/ginkgo/v2"
Expand Down
15 changes: 9 additions & 6 deletions proto/exocore/delegation/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ message DelegationInfoReq {

// DelegationAmounts is the delegation amount response for a single delegation.
message DelegationAmounts {
// can_undelegation_amount is the amount that can be undelegated.
string can_undelegation_amount = 1
// can_be_undelegated_amount is the amount that can be undelegated.
string can_be_undelegated_amount = 1

Check failure on line 24 in proto/exocore/delegation/v1/query.proto

View workflow job for this annotation

GitHub Actions / break-check

Field "1" with name "can_be_undelegated_amount" on message "DelegationAmounts" changed option "json_name" from "canUndelegationAmount" to "canBeUndelegatedAmount".

Check failure on line 24 in proto/exocore/delegation/v1/query.proto

View workflow job for this annotation

GitHub Actions / break-check

Field "1" on message "DelegationAmounts" changed name from "can_undelegation_amount" to "can_be_undelegated_amount".
[
(cosmos_proto.scalar) = "cosmos.Int",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
Expand All @@ -34,6 +34,13 @@ message DelegationAmounts {
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false
];
// can_be_undelegated_after_slash is the amount that can be undelegated after slash
string can_be_undelegated_after_slash = 3
[
(cosmos_proto.scalar) = "cosmos.Int",
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int",
(gogoproto.nullable) = false
];
}

// QueryDelegationInfoResponse is the response for delegations by staker id and
Expand Down Expand Up @@ -69,10 +76,6 @@ message QueryOperatorInfoReq {

// Query is the service API for the delegation module.
service Query {

Check failure on line 78 in proto/exocore/delegation/v1/query.proto

View workflow job for this annotation

GitHub Actions / break-check

Previously present RPC "QueryOperatorInfo" on service "Query" was deleted.
// OperatorInfo queries the operator information.
rpc QueryOperatorInfo(QueryOperatorInfoReq) returns (OperatorInfo) {
option (google.api.http).get = "/exocore/delegation/v1/GetOperatorInfo";
}
// DelegationInfo queries the delegation information for {stakerID, assetID}.
rpc QueryDelegationInfo(DelegationInfoReq) returns (QueryDelegationInfoResponse) {
option (cosmos.query.v1.module_query_safe) = true;
Expand Down
2 changes: 0 additions & 2 deletions proto/exocore/delegation/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,6 @@ message UndelegationResponse {}
// Msg defines the delegation Msg service.
service Msg {

Check failure on line 167 in proto/exocore/delegation/v1/tx.proto

View workflow job for this annotation

GitHub Actions / break-check

Previously present RPC "RegisterOperator" on service "Msg" was deleted.
option (cosmos.msg.v1.service) = true;
// RegisterOperator registers a new operator.
rpc RegisterOperator(RegisterOperatorReq) returns (RegisterOperatorResponse);
// DelegateAssetToOperator delegates asset to operator.
rpc DelegateAssetToOperator(MsgDelegation) returns (DelegationResponse);
// UndelegateAssetFromOperator undelegates asset from operator.
Expand Down
19 changes: 14 additions & 5 deletions proto/exocore/operator/v1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,36 @@ import "tendermint/crypto/keys.proto";

option go_package = "github.com/ExocoreNetwork/exocore/x/operator/types";

// QueryOperatorInfoReq is the request to obtain the operator information.
message GetOperatorInfoReq {
string OperatorAddr = 1
// operator_addr is the operator address.
string operator_addr = 1
[(cosmos_proto.scalar) = "cosmos.AddressString"];
}

message QueryOperatorConsKeyForChainIdRequest {
// QueryOperatorConsKeyForChainIDRequest is the request to obtain the consensus public key of the operator
message QueryOperatorConsKeyForChainIDRequest {
// addr is the ACC address of operator
string addr = 1;
// chain_id is the id of the chain served by the operator
string chain_id = 2;
}

message QueryOperatorConsKeyForChainIdResponse {
// QueryOperatorConsKeyForChainIDResponse is the response for QueryOperatorConsKeyForChainId
message QueryOperatorConsKeyForChainIDResponse {
// public_key is the consensus public key of the operator
tendermint.crypto.PublicKey public_key = 1 [ (gogoproto.nullable) = false ];
}

// Query defines the gRPC querier service.
service Query {
// OperatorInfo queries the operator information.
rpc GetOperatorInfo(GetOperatorInfoReq) returns(OperatorInfo){
option (google.api.http).get = "/exocore/delegation/v1/GetOperatorInfo";
}

// add services for dogfood
rpc QueryOperatorConsKeyForChainId(QueryOperatorConsKeyForChainIdRequest) returns (QueryOperatorConsKeyForChainIdResponse) {
// QueryOperatorConsKeyForChainID queries the consensus public key for the operator
rpc QueryOperatorConsKeyForChainID(QueryOperatorConsKeyForChainIDRequest) returns (QueryOperatorConsKeyForChainIDResponse) {
option (google.api.http) = {
get: "/exocore/operator_consent/v1/GetOperatorConsKey/{addr}/{chain_id}"
};
Expand Down
Loading

0 comments on commit c413c7b

Please sign in to comment.