Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert: cosmos submodule only #362

Merged
merged 4 commits into from
Jun 26, 2024
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
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"ignorePatterns": ["nibiru/*", "cosmos-sdk/*"]
"ignorePatterns": ["nibiru/*"]
}
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "cosmos-sdk"]
path = cosmos-sdk
url = https://github.com/cosmos/cosmos-sdk
[submodule "nibiru"]
path = nibiru
url = https://github.com/NibiruChain/nibiru
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/nibiru
/cosmos-sdk

# Rest of file is .gitignore

Expand Down
1 change: 0 additions & 1 deletion cosmos-sdk
Submodule cosmos-sdk deleted from b48fd6
12 changes: 1 addition & 11 deletions scripts/protocgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ set -eo pipefail
# PKG_OUT_DIR: Output path where the generated code will go upon
# successful execution.
NIBIRU_REPO="./nibiru"
COSMOS_SDK_REPO="./cosmos-sdk"
PKG_OUT_DIR="./src/protojs"

# -----------------------------------------------------------------------------
Expand All @@ -28,13 +27,6 @@ for dir in $(find $NIBIRU_REPO/proto -path -prune -o -name '*.proto' -print0 | x
done
done;

for dir in $(find $COSMOS_SDK_REPO/x/staking/proto -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | uniq | sort); do \
for file in $(find "${dir}" -maxdepth 1 -name '*.proto'); do
echo "Generating ts proto code for $file"
buf generate --template $NIBIRU_REPO/proto/buf.gen.ts.yaml -o $PKG_OUT_DIR $file
done
done;

yarn generate-barrels
# # the `descriptor.ts` file is only used for gogoproto, and it causes issues with TS-generated code
rm $PKG_OUT_DIR/google/protobuf/descriptor.ts
Expand All @@ -47,14 +39,12 @@ rm -rf $PKG_OUT_DIR/cosmos/msg
rm $PKG_OUT_DIR/google/api/annotations.ts
rm $PKG_OUT_DIR/index.gogoproto.ts
rm $PKG_OUT_DIR/index.amino.ts
rm $PKG_OUT_DIR/index.google.ts
rm $PKG_OUT_DIR/index.cosmos.msg.v1.ts
rm $PKG_OUT_DIR/index.cosmos.msg.ts
rm $PKG_OUT_DIR/index.cosmos.query.v1.ts
rm $PKG_OUT_DIR/index.cosmos.query.ts

sed 's/export \* as gogoproto from \"\.\/index\.gogoproto\"\;//' $PKG_OUT_DIR/index.ts > tmpfile && mv tmpfile $PKG_OUT_DIR/index.ts
sed 's/export \* as amino from \"\.\/index\.amino\"\;//' $PKG_OUT_DIR/index.ts > tmpfile && mv tmpfile $PKG_OUT_DIR/index.ts
sed 's/export \* as google from \"\.\/index\.google\"\;//' $PKG_OUT_DIR/index.ts > tmpfile && mv tmpfile $PKG_OUT_DIR/index.ts
sed 's/export \* from \"\.\/google\/api\/annotations\"\;//' $PKG_OUT_DIR/index.google.api.ts > tmpfile && mv tmpfile $PKG_OUT_DIR/index.google.api.ts
sed 's/export \* as protobuf from \"\.\/index.google.protobuf\"\;//' $PKG_OUT_DIR/index.google.ts > tmpfile && mv tmpfile $PKG_OUT_DIR/index.google.ts
sed 's/export \* as msg from \"\.\/index.cosmos.msg\"\;//' $PKG_OUT_DIR/index.cosmos.ts > tmpfile && mv tmpfile $PKG_OUT_DIR/index.cosmos.ts
1 change: 0 additions & 1 deletion src/sdk/query/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ export * from "./epochs"
export * from "./inflation"
export * from "./oracle"
export * from "./query"
export * from "./staking"
export * from "./sudo"
6 changes: 1 addition & 5 deletions src/sdk/query/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,11 @@ import {
SudoExtension,
InflationExtension,
setupInflationExtension,
setupStakeExtension,
Result,
bytesToHex,
hexToBytes,
setupDevgasExtension,
DevgasExtension,
StakeExtension,
} from ".."

export type NibiruExtensions = StargateQueryClient &
Expand All @@ -47,7 +45,6 @@ export type NibiruExtensions = StargateQueryClient &
DistributionExtension &
GovExtension &
StakingExtension &
StakeExtension &
IbcExtension &
WasmExtension &
AuthExtension
Expand Down Expand Up @@ -93,8 +90,7 @@ export class NibiruQuerier extends StargateClient {
setupStakingExtension,
setupIbcExtension,
setupWasmExtension,
setupAuthExtension,
setupStakeExtension
setupAuthExtension
)
}

Expand Down
39 changes: 0 additions & 39 deletions src/sdk/query/staking.test.ts

This file was deleted.

29 changes: 0 additions & 29 deletions src/sdk/query/staking.ts

This file was deleted.

2 changes: 0 additions & 2 deletions src/sdk/tx/txClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import {
setupOracleExtension,
setupEpochsExtension,
setupDevgasExtension,
setupStakeExtension,
} from ".."

export const nibiruRegistryTypes: ReadonlyArray<[string, GeneratedType]> = [
Expand Down Expand Up @@ -53,7 +52,6 @@ export class NibiruTxClient extends SigningStargateClient {
setupDistributionExtension,
setupGovExtension,
setupStakingExtension,
setupStakeExtension,
setupIbcExtension,
setupWasmExtension,
setupAuthExtension
Expand Down
Loading