Skip to content

Commit

Permalink
Merge pull request #7 from neutron-org/fix/change-autogen-behaviour
Browse files Browse the repository at this point in the history
fix: change autogen behaviour #NTRN-397
  • Loading branch information
pr0n00gler authored Oct 9, 2024
2 parents a751ce1 + 3a88c35 commit 8279890
Show file tree
Hide file tree
Showing 20 changed files with 203 additions and 581 deletions.
1 change: 0 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
[submodule "neutron"]
path = protos/neutron-src
url = git@github.com:neutron-org/neutron.git
branch = feat/choose-cron-blocker-2
[submodule "slinky"]
path = protos/slinky-src
url = git@github.com:skip-mev/slinky.git
Expand Down
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Cosmjs types for users of Neutron chain.

https://www.neutron.org/
<https://www.neutron.org/>

Version of this package is synced with Neutron chain version.

Expand All @@ -20,11 +20,18 @@ git submodule update --init --recursive

# Install dependencies
npm install

# Set specified versions for submodules
# Submodules versions (commits or tags) should be set in the ./scripts/set-versions.sh script for the corresponding *_REV constants
npm run set-versions
```

### Rebuilding types

```sh
npm run codegen # Generate .ts files into ./src
npm run build # Build .js/.d.ts files
# Generate .ts files into ./src
npm run codegen

# Build .js/.d.ts files
npm run build
```
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,15 @@
"!cosmos-sdk-*/**/*.md"
],
"scripts": {
"set-versions": "./scripts/set-versions.sh",
"format": "prettier --write --log-level warn \"./src/**/*.ts\" \"./scripts/**/*.js\"",
"precodegen": "./scripts/exports_protos.sh",
"codegen": "rm -rf ./src && ./scripts/codegen.js && cp -rf copypaste_files/* ./src/ && npm run format",
"prepare-publishing": "./scripts/prepare-publishing.sh",
"build": "rm -rf ./build && tsc && npm run prepare-publishing"
},
"dependencies": {
"clean": "./scripts/clean.sh",
"build": "rm -rf ./build && tsc && npm run prepare-publishing && npm run clean"
},
"dependencies": {},
"devDependencies": {
"@cosmology/telescope": "^1.5.4",
"@types/node": "^15.6.2",
Expand Down
2 changes: 1 addition & 1 deletion protos/admin-module-src
2 changes: 1 addition & 1 deletion protos/block-sdk-src
2 changes: 1 addition & 1 deletion protos/cosmos-sdk-src
Submodule cosmos-sdk-src updated 159 files
2 changes: 1 addition & 1 deletion protos/ibc-go-src
1 change: 1 addition & 0 deletions protos/neutron-src
Submodule neutron-src added at a31922
2 changes: 1 addition & 1 deletion protos/slinky-src
41 changes: 41 additions & 0 deletions scripts/clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env bash

set -o errexit -o nounset -o pipefail
command -v shellcheck >/dev/null && shellcheck "$0"

DIRS=(capability cosmos cosmos_proto cosmwasm feemarket gaia gogoproto google ibc neutron osmosis sdk slinky tendermint)
FILES=(
binary.d.ts
binary.js
binary.js.map
helpers.d.ts
helpers.js
helpers.js.map
json-safe.d.ts
json-safe.js
json-safe.js.map
utf8.d.ts
utf8.js
utf8.js.map
varint.d.ts
varint.js
varint.js.map
querier_types.js
querier_types.d.ts
)

for dir in "${DIRS[@]}"; do
rm -rf "$dir"
done

for f in "${FILES[@]}"; do
if [[ $f != *"json-safe"* ]]; then
rm -rf "$f"
fi
done

rm -rf ./build

for dir in admin-module block-sdk cosmos-sdk feemarket ibc-go neutron slinky wasmd ; do
rm -rf "protos/$dir"
done
1 change: 1 addition & 0 deletions scripts/codegen.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ telescope({
"neutron/dex/genesis.proto",
"neutron/transfer/v1/query.proto",
"slinky/abci/v1/vote_extensions.proto",
"slinky/marketmap/v1/tx.proto",
],
packages: ["google.api"],
},
Expand Down
35 changes: 35 additions & 0 deletions scripts/set-versions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env bash

set -o errexit -o nounset -o pipefail
command -v shellcheck >/dev/null && shellcheck "$0"

readonly ADMIN_MODULE_DIR="admin-module-src"
readonly BLOCK_SDK_DIR="block-sdk-src"
readonly COSMOS_SDK_DIR="cosmos-sdk-src"
readonly FEEMARKET_DIR="feemarket-src"
readonly IBC_GO_DIR="ibc-go-src"
readonly NEUTRON_DIR="neutron-src"
readonly SLINKY_DIR="slinky-src"
readonly WASMD_DIR="wasmd-src"

readonly ADMIN_MODULE_REV="v2.0.2"
readonly BLOCK_SDK_REV="v2.1.5"
readonly COSMOS_SDK_REV="v0.50.9-neutron"
readonly FEEMARKET_REV="v1.1.1"
readonly IBC_GO_REV="v8.5.1"
readonly NEUTRON_REV="main"
readonly SLINKY_REV="v1.0.12"
readonly WASMD_REV="v0.51.2-neutron"

checkout_version () {
git -C protos/$1 checkout $2
}

checkout_version $ADMIN_MODULE_DIR $ADMIN_MODULE_REV
checkout_version $BLOCK_SDK_DIR $BLOCK_SDK_REV
checkout_version $COSMOS_SDK_DIR $COSMOS_SDK_REV
checkout_version $FEEMARKET_DIR $FEEMARKET_REV
checkout_version $IBC_GO_DIR $IBC_GO_REV
checkout_version $NEUTRON_DIR $NEUTRON_REV
checkout_version $SLINKY_DIR $SLINKY_REV
checkout_version $WASMD_DIR $WASMD_REV
39 changes: 0 additions & 39 deletions src/cosmwasm/wasm/v1/ibc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ export interface MsgIBCSendResponse {
/** Sequence number of the IBC packet sent */
sequence: bigint;
}
/** MsgIBCWriteAcknowledgementResponse */
export interface MsgIBCWriteAcknowledgementResponse {}
/** MsgIBCCloseChannel port and channel need to be owned by the contract */
export interface MsgIBCCloseChannel {
channel: string;
Expand Down Expand Up @@ -165,43 +163,6 @@ export const MsgIBCSendResponse = {
return message;
},
};
function createBaseMsgIBCWriteAcknowledgementResponse(): MsgIBCWriteAcknowledgementResponse {
return {};
}
export const MsgIBCWriteAcknowledgementResponse = {
typeUrl: "/cosmwasm.wasm.v1.MsgIBCWriteAcknowledgementResponse",
encode(_: MsgIBCWriteAcknowledgementResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
return writer;
},
decode(input: BinaryReader | Uint8Array, length?: number): MsgIBCWriteAcknowledgementResponse {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
const message = createBaseMsgIBCWriteAcknowledgementResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(_: any): MsgIBCWriteAcknowledgementResponse {
const obj = createBaseMsgIBCWriteAcknowledgementResponse();
return obj;
},
toJSON(_: MsgIBCWriteAcknowledgementResponse): JsonSafe<MsgIBCWriteAcknowledgementResponse> {
const obj: any = {};
return obj;
},
fromPartial<I extends Exact<DeepPartial<MsgIBCWriteAcknowledgementResponse>, I>>(
_: I,
): MsgIBCWriteAcknowledgementResponse {
const message = createBaseMsgIBCWriteAcknowledgementResponse();
return message;
},
};
function createBaseMsgIBCCloseChannel(): MsgIBCCloseChannel {
return {
channel: "",
Expand Down
2 changes: 1 addition & 1 deletion src/cosmwasm/wasm/v1/tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export interface MsgInstantiateContractResponse {
}
/**
* MsgInstantiateContract2 create a new smart contract instance for the given
* code id with a predictable address.
* code id with a predicable address.
*/
export interface MsgInstantiateContract2 {
/** Sender is the that actor that signed the messages */
Expand Down
60 changes: 0 additions & 60 deletions src/slinky/marketmap/v1/tx.rpc.msg.ts

This file was deleted.

Loading

0 comments on commit 8279890

Please sign in to comment.