Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tubackkhoa committed Dec 15, 2022
2 parents 5b1c0ef + 189b0cf commit 211e2a4
Show file tree
Hide file tree
Showing 54 changed files with 2,621 additions and 1,671 deletions.
5 changes: 3 additions & 2 deletions module/contrib/local/protocgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

set -eo pipefail

GOPATH=${GOPATH:-$(go env GOPATH)}
if [ -z $GOPATH ]; then
echo "GOPATH not set!"
exit 1
Expand All @@ -14,15 +15,15 @@ fi

proto_dirs=$(find ./proto -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq)
for dir in $proto_dirs; do
buf protoc \
buf alpha protoc \
-I "proto" \
-I "third_party/proto" \
--gocosmos_out=plugins=interfacetype+grpc,\
Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types:. \
$(find "${dir}" -maxdepth 1 -name '*.proto')

# # command to generate gRPC gateway (*.pb.gw.go in respective modules) files
buf protoc \
buf alpha protoc \
-I "proto" \
-I "third_party/proto" \
--grpc-gateway_out=logtostderr=true,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types:. \
Expand Down
2 changes: 1 addition & 1 deletion module/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ require (
github.com/stretchr/testify v1.8.0
github.com/tendermint/tendermint v0.34.21
github.com/tendermint/tm-db v0.6.7
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e
google.golang.org/genproto v0.0.0-20220725144611-272f38e5d71b
google.golang.org/grpc v1.48.0
)
Expand Down Expand Up @@ -137,7 +138,6 @@ require (
github.com/zondax/hid v0.9.0 // indirect
go.etcd.io/bbolt v1.3.6 // indirect
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
golang.org/x/net v0.0.0-20220726230323-06994584191e // indirect
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect
golang.org/x/sys v0.0.0-20220727055044-e65921a090b8 // indirect
Expand Down
2 changes: 1 addition & 1 deletion module/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1414,4 +1414,4 @@ rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU=
sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU=
12 changes: 12 additions & 0 deletions module/proto/gravity/v1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ message Params {
// GenesisState struct, containing all persistant data required by the Gravity module
message GenesisState {
Params params = 1;
repeated EvmChainData evm_chains = 2 [(gogoproto.nullable) = false];
}

// EvmChainData struct, containing all persistant data per EVM chain required by the Gravity module
message EvmChainData {
EvmChain evm_chain = 1 [(gogoproto.nullable) = false];
GravityNonces gravity_nonces = 2 [(gogoproto.nullable) = false];
repeated Valset valsets = 3 [(gogoproto.nullable) = false];
repeated MsgValsetConfirm valset_confirms = 4 [(gogoproto.nullable) = false];
Expand All @@ -155,6 +161,12 @@ message GenesisState {
repeated PendingIbcAutoForward pending_ibc_auto_forwards = 13 [(gogoproto.nullable) = false];
}

// EvmChain struct contains EVM chain specific data
message EvmChain {
string evm_chain_prefix = 1;
string evm_chain_name = 2;
}

// GravityCounters contains the many noces and counters required to maintain the bridge state in the genesis
message GravityNonces {
// the nonce of the last generated validator set
Expand Down
149 changes: 76 additions & 73 deletions module/x/gravity/abci.go

Large diffs are not rendered by default.

Loading

0 comments on commit 211e2a4

Please sign in to comment.