Skip to content

Commit

Permalink
feat(api): use generated code by version from akash-api
Browse files Browse the repository at this point in the history
Also remove relevant local barrel index files.

refs akash-network/support#184
  • Loading branch information
ygrishajev committed May 8, 2024
1 parent 7bc1464 commit eadc869
Show file tree
Hide file tree
Showing 8 changed files with 565 additions and 3,187 deletions.
3,694 changes: 553 additions & 3,141 deletions indexer/package-lock.json

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions indexer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
"test": "jest"
},
"dependencies": {
"@akashnetwork/akash-api": "^1.0.3",
"@akashnetwork/akashjs": "^0.6.1",
"@akashnetwork/akash-api": "^1.3.0",
"@connectrpc/connect": "^1.3.0",
"@connectrpc/connect-node": "^1.3.0",
"@cosmjs/crypto": "^0.31.1",
Expand Down Expand Up @@ -54,7 +53,7 @@
"devDependencies": {
"@types/async": "^3.2.15",
"@types/express": "^4.17.13",
"@types/lodash": "^4.17.0",
"@types/lodash": "^4.17.1",
"@types/node": "^16.11.68",
"@types/node-fetch": "^2.6.2",
"@types/node-gzip": "^1.1.0",
Expand Down
8 changes: 4 additions & 4 deletions indexer/src/indexers/akashStatsIndexer.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as benchmark from "../shared/utils/benchmark";
import * as v1beta1 from "../proto/akash/v1beta1";
import * as v1beta2 from "../proto/akash/v1beta2";
import * as v1beta3 from "../proto/akash/v1beta3";
import * as v1beta4 from "../proto/akash/v1beta4";
import * as v1beta1 from "@akashnetwork/akash-api/v1beta1";
import * as v1beta2 from "@akashnetwork/akash-api/v1beta2";
import * as v1beta3 from "@akashnetwork/akash-api/v1beta3";
import * as v1beta4 from "@akashnetwork/akash-api/v1beta4";
import * as uuid from "uuid";
import { uint8arrayToString } from "@src/shared/utils/protobuf";
import { accountSettle } from "@src/shared/utils/akashPaymentSettle";
Expand Down
9 changes: 0 additions & 9 deletions indexer/src/proto/akash/v1beta1.ts

This file was deleted.

14 changes: 0 additions & 14 deletions indexer/src/proto/akash/v1beta2.ts

This file was deleted.

9 changes: 0 additions & 9 deletions indexer/src/proto/akash/v1beta3.ts

This file was deleted.

2 changes: 0 additions & 2 deletions indexer/src/proto/akash/v1beta4.ts

This file was deleted.

11 changes: 6 additions & 5 deletions indexer/src/shared/utils/protobuf.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import { Registry, isTsProtoGeneratedType, GeneratedType } from "@cosmjs/proto-signing";
import { defaultRegistryTypes } from "@cosmjs/stargate";
import { MsgUnjail } from "cosmjs-types/cosmos/slashing/v1beta1/tx";
import omit from "lodash/omit";

import * as v1beta1 from "../../proto/akash/v1beta1";
import * as v1beta2 from "../../proto/akash/v1beta2";
import * as v1beta3 from "../../proto/akash/v1beta3";
import * as v1beta4 from "../../proto/akash/v1beta4";
import * as v1beta1 from "@akashnetwork/akash-api/v1beta1";
import * as v1beta2 from "@akashnetwork/akash-api/v1beta2";
import * as v1beta3 from "@akashnetwork/akash-api/v1beta3";
import * as v1beta4 from "@akashnetwork/akash-api/v1beta4";

const akashTypes: ReadonlyArray<[string, GeneratedType]> = [
...Object.values(v1beta1),
...Object.values(v1beta2),
...Object.values(v1beta3),
...Object.values(omit(v1beta3, 'DepositDeploymentAuthorization')),
...Object.values(v1beta4)
].map((x) => ["/" + x.$type, x]);
const missingTypes: ReadonlyArray<[string, GeneratedType]> = [["/cosmos.slashing.v1beta1.MsgUnjail", MsgUnjail]];
Expand Down

0 comments on commit eadc869

Please sign in to comment.