Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Editor configuration, see https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true
max_line_length = 240

[*.ts]
quote_type = single

[*.md]
max_line_length = off
trim_trailing_whitespace = false
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,15 @@
"@babel/preset-typescript": "^7.8.3",
"@types/jest": "^26.0.20",
"@types/ledgerhq__hw-transport-node-hid": "^4.22.2",
"axios": "^0.21.1",
"cross-env": "^7.0.3",
"eslint": "^7.19.0",
"gts": "^3.1.0",
"jest": "^26.6.3",
"prettier": "^2.2.1",
"rimraf": "^3.0.2",
"ts-jest": "^26.5.0",
"ts-proto": "^1.67.0",
"ts-proto": "^1.79.7",
"typedoc": "^0.20.25",
"typedoc-plugin-markdown": "^3.5.0",
"typescript": "^4.1.3"
Expand Down
14 changes: 7 additions & 7 deletions scripts/define-proto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ command -v shellcheck >/dev/null && shellcheck "$0"
ROOT_PROTO_DIR="./proto/cosmos/cosmos-sdk"
COSMOS_PROTO_DIR="$ROOT_PROTO_DIR/proto"
THIRD_PARTY_PROTO_DIR="$ROOT_PROTO_DIR/third_party/proto"

ROOT_LUM_PROTO_DIR="./proto/lum-network/chain"
LUM_PROTO_DIR="$ROOT_LUM_PROTO_DIR/proto"

OUT_DIR="./src/codec/"

mkdir -p "$OUT_DIR"
Expand All @@ -14,6 +18,7 @@ protoc \
--ts_proto_out="$OUT_DIR" \
--proto_path="$COSMOS_PROTO_DIR" \
--proto_path="$THIRD_PARTY_PROTO_DIR" \
--proto_path="$LUM_PROTO_DIR" \
--ts_proto_opt="esModuleInterop=true,forceLong=long,useOptionals=true" \
"$COSMOS_PROTO_DIR/cosmos/auth/v1beta1/auth.proto" \
"$COSMOS_PROTO_DIR/cosmos/auth/v1beta1/query.proto" \
Expand All @@ -33,12 +38,6 @@ protoc \
"$COSMOS_PROTO_DIR/cosmos/staking/v1beta1/tx.proto" \
"$COSMOS_PROTO_DIR/cosmos/tx/signing/v1beta1/signing.proto" \
"$COSMOS_PROTO_DIR/cosmos/tx/v1beta1/tx.proto" \
"$COSMOS_PROTO_DIR/ibc/core/channel/v1/channel.proto" \
"$COSMOS_PROTO_DIR/ibc/core/channel/v1/query.proto" \
"$COSMOS_PROTO_DIR/ibc/core/client/v1/client.proto" \
"$COSMOS_PROTO_DIR/ibc/core/commitment/v1/commitment.proto" \
"$COSMOS_PROTO_DIR/ibc/core/connection/v1/connection.proto" \
"$COSMOS_PROTO_DIR/ibc/core/connection/v1/query.proto" \
"$THIRD_PARTY_PROTO_DIR/confio/proofs.proto" \
"$THIRD_PARTY_PROTO_DIR/tendermint/abci/types.proto" \
"$THIRD_PARTY_PROTO_DIR/tendermint/crypto/keys.proto" \
Expand All @@ -47,7 +46,8 @@ protoc \
"$THIRD_PARTY_PROTO_DIR/tendermint/types/params.proto" \
"$THIRD_PARTY_PROTO_DIR/tendermint/types/types.proto" \
"$THIRD_PARTY_PROTO_DIR/tendermint/types/validator.proto" \
"$THIRD_PARTY_PROTO_DIR/tendermint/version/types.proto"
"$THIRD_PARTY_PROTO_DIR/tendermint/version/types.proto" \
"$LUM_PROTO_DIR/chain/beam/beam.proto"

# Remove unnecessary codec files
rm -rf \
Expand Down
12 changes: 12 additions & 0 deletions scripts/get-proto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,26 @@ PROTO_DIR="./proto"
COSMOS_DIR="$PROTO_DIR/cosmos"
COSMOS_SDK_DIR="$COSMOS_DIR/cosmos-sdk"
ZIP_FILE="$COSMOS_DIR/tmp.zip"

LUM_NETWORK_DIR="$PROTO_DIR/lum-network"
LUM_NETWORK_SDK_DIR="$LUM_NETWORK_DIR/chain"

REF=${REF:-"master"}
SUFFIX=${REF}

[[ $SUFFIX =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-.+)?$ ]] && SUFFIX=${SUFFIX#v}

# Create the cosmos dir
mkdir -p "$COSMOS_DIR"

# Download the cosmos archive
wget -qO "$ZIP_FILE" "https://github.com/cosmos/cosmos-sdk/archive/$REF.zip"
unzip "$ZIP_FILE" "*.proto" -d "$COSMOS_DIR"
mv "$COSMOS_SDK_DIR-$SUFFIX" "$COSMOS_SDK_DIR"
rm "$ZIP_FILE"

# Create the lum network dir
mkdir -p "$LUM_NETWORK_SDK_DIR/proto/chain/beam"

# Download the beam archive
wget -qO "$LUM_NETWORK_SDK_DIR/proto/chain/beam/beam.proto" "https://raw.githubusercontent.com/lum-network/chain/master/proto/beam/beam.proto?token=ABH2VUAPWO3DRGHMRGXWZWDASVAMY"
Loading