Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit cb9eb06

Browse files
committedApr 17, 2024··
feat(ci): adds more CI validations, introduces semantic release (#74)
- Adds eslint check on before commit and in CI - Adds commit lint in CI for main - Uses semantic release
1 parent 7f11ac8 commit cb9eb06

23 files changed

+12071
-4792
lines changed
 

‎.eslintrc.json

+11-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@
1212
},
1313
"plugins": ["@typescript-eslint"],
1414
"rules": {
15-
"@typescript-eslint/no-unused-vars": ["error", { "ignoreRestSiblings": true }]
16-
}
15+
"@typescript-eslint/no-unused-vars": ["error", { "ignoreRestSiblings": true }],
16+
"@typescript-eslint/no-explicit-any": "warn"
17+
},
18+
"overrides": [
19+
{
20+
"files": ["*.js"],
21+
"rules": {
22+
"@typescript-eslint/no-var-requires": "off"
23+
}
24+
}
25+
]
1726
}

‎.github/workflows/build.yml

-30
This file was deleted.

‎.github/workflows/commit-lint.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Commit Lint
2+
3+
on:
4+
- push
5+
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
cancel-in-progress: true
9+
10+
env:
11+
HUSKY: 0
12+
13+
jobs:
14+
duplicate-check:
15+
runs-on: ubuntu-latest
16+
outputs:
17+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
18+
steps:
19+
- id: skip_check
20+
uses: fkirc/skip-duplicate-actions@v5
21+
with:
22+
concurrent_skipping: 'never'
23+
skip_after_successful_duplicate: 'true'
24+
25+
commit-lint:
26+
if: needs.duplicate-check.outputs.should_skip != 'true'
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@master
30+
with:
31+
ref: main
32+
33+
- name: Fetch other branches for commitlint
34+
run: git fetch --prune --unshallow
35+
36+
# - name: Validate PR commits with commitlint
37+
# if: github.event_name == 'pull_request'
38+
# run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
39+
40+
- name: Validate PR commits with commitlint
41+
if: github.event_name == 'push'
42+
run: npx commitlint --from ${{ github.event.before }}~${{ github.event.commits }} --to ${{ github.event.after }} --verbose

‎.github/workflows/lint.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Lint
2+
3+
on:
4+
- pull_request
5+
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
cancel-in-progress: true
9+
10+
env:
11+
HUSKY: 0
12+
13+
jobs:
14+
lint:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@master
18+
with:
19+
ref: main
20+
21+
- name: Setup Node.js
22+
id: setup_node
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 18.0.0
26+
27+
- name: Restore node_modules cache
28+
id: deps-cache
29+
uses: martijnhols/actions-cache/restore@v3
30+
with:
31+
path: node_modules
32+
key: ${{ runner.os }}-build-ts-deps-cache-${{ hashFiles('ts/package-lock.json') }}
33+
34+
- name: Install dependencies
35+
if: steps.deps-cache.outputs.cache-hit != 'true'
36+
run: npm install
37+
38+
- name: Lint
39+
run: npm run lint
40+
41+
- name: Cache node modules
42+
if: steps.deps-cache.outputs.cache-hit != 'true'
43+
uses: martijnhols/actions-cache/save@v3
44+
with:
45+
path: node_modules
46+
key: ${{ runner.os }}-build-ts-deps-cache-${{ hashFiles('ts/package-lock.json') }}

‎.github/workflows/npm.yml

-36
This file was deleted.

‎.github/workflows/release.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Release from Master on Push
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
concurrency:
9+
group: ${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
env:
13+
HUSKY: 0
14+
15+
jobs:
16+
release:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@master
20+
with:
21+
ref: main
22+
23+
- name: Fetch other branches for commitlint
24+
run: git fetch --prune --unshallow
25+
26+
- name: Setup Node.js
27+
if: steps.changes.outputs.ts == 'true'
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: 18.0.0
31+
cache: npm
32+
33+
- name: Install dependencies
34+
run: npm install
35+
36+
- name: Validate PR commits with commitlint
37+
uses: wagoid/commitlint-github-action@v6
38+
39+
- name: Lint
40+
run: npm run lint
41+
42+
- name: Test
43+
run: npm run test:cov
44+
45+
- name: Release npm package
46+
uses: cycjimmy/semantic-release-action@v4
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
50+
51+
- name: Upload Test Coverage
52+
uses: codecov/codecov-action@v4
53+
with:
54+
files: ./ts/coverage
55+
token: ${{ secrets.CODECOV_TOKEN }}

‎.github/workflows/test.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Test
2+
3+
on:
4+
- pull_request
5+
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
cancel-in-progress: true
9+
10+
env:
11+
HUSKY: 0
12+
13+
jobs:
14+
test:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@master
18+
with:
19+
ref: main
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: 18.0.0
25+
cache: npm
26+
27+
- name: Restore node_modules cache
28+
id: deps-cache
29+
uses: martijnhols/actions-cache/restore@v3
30+
with:
31+
path: node_modules
32+
key: ${{ runner.os }}-build-ts-deps-cache-${{ hashFiles('ts/package-lock.json') }}
33+
34+
- name: Install dependencies
35+
run: npm install
36+
37+
- name: Test
38+
run: npm run test:cov
39+
40+
- name: Upload Test Coverage
41+
uses: codecov/codecov-action@v4
42+
with:
43+
files: ./ts/coverage
44+
token: ${{ secrets.CODECOV_TOKEN }}
45+
46+
- name: Cache node modules
47+
if: steps.deps-cache.outputs.cache-hit != 'true'
48+
uses: martijnhols/actions-cache/save@v3
49+
with:
50+
path: node_modules
51+
key: ${{ runner.os }}-build-ts-deps-cache-${{ hashFiles('ts/package-lock.json') }}

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ umd/
77

88
# Coverage directory
99
.nyc_output/
10+
coverage
1011

1112
# Log files
1213
yarn-error.log

‎.husky/commit-msg

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx --no -- commitlint --edit $1

‎.releaserc

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"plugins": [
3+
"@semantic-release/commit-analyzer",
4+
"@semantic-release/release-notes-generator",
5+
[
6+
"@semantic-release/changelog",
7+
{
8+
"changelogFile": "CHANGELOG.md"
9+
}
10+
],
11+
[
12+
"@semantic-release/npm",
13+
{
14+
"tarballDir": "package"
15+
}
16+
],
17+
[
18+
"@semantic-release/github",
19+
{
20+
"assets": "package/*.tgz"
21+
}
22+
],
23+
"@semantic-release/git"
24+
],
25+
"branches": [
26+
{
27+
"name": "main"
28+
}
29+
],
30+
"preset": "conventionalcommits"
31+
}

‎README.md

+25-2
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,29 @@ const signedMessage = await client.signAndBroadcast(
109109

110110
Additional examples can be found in the [examples directory]( https://github.com/ovrclk/akashjs/tree/main/)
111111

112-
## contributing
112+
## Contribution Guidelines
113+
114+
### Project Stack
115+
116+
This repository is primarily written in TypeScript and uses Node.js version 18. We use Webpack 5 for UMD bundling. These tools ensure that our development environment is consistent and our builds are stable.
117+
118+
### Automated CI Checks and Releases
119+
120+
Our project enforces high standards of code quality and consistency to ensure that all contributions adhere to our guidelines and maintain a high level of reliability. Here's what you should be aware of when contributing to our repository:
121+
122+
- **Code Linting**: We use ESLint to analyze the code for potential errors and coding style issues. This ensures that all contributions maintain a consistent style and follow best practices.
123+
124+
- **Code Formatting**: Prettier is configured to format code automatically. This helps keep our codebase clean and readable without requiring manual adjustments for styling.
125+
126+
- **Commit Linting**: All commit messages must adhere to the Conventional Commits specification. This is enforced through automated linting of commits, helping us keep our project history clear and easy to navigate. See [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) for more information.
127+
128+
- **Automated Testing**: Upon creating a pull request, automated tests are run to verify that the new code does not break any existing functionality and meets all testing standards.
129+
130+
- **Semantic Release**: When changes are merged into the `main` branch, a semantic release process is triggered. This process automatically determines version numbers and generates changelogs based on the commit messages, streamlining the release process and ensuring consistent versioning.
131+
132+
- **Continuous Integration**: Our CI workflows are designed to validate pull requests and manage releases. They perform multiple checks including fetching other branches for commit validation, linting, and testing code coverage before merging changes.
133+
134+
### Contributing
135+
136+
PRs are welcome! By adhering to these guidelines and leveraging our automated systems, we can maintain a high-quality codebase and streamline our development processes. We appreciate your contributions to making this project even better!
113137

114-
This repository uses node 16, and yarn 1.2+, webpack 5 for umd bundling and is written in typescript. PRs are welcome.

‎commitlint.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = { extends: ["@commitlint/config-conventional"] };

‎jest.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const common = {
77
};
88

99
module.exports = {
10-
collectCoverageFrom: ["./src/**/*.{js,ts}"],
10+
collectCoverageFrom: ["./src/**/*.{js,ts}", "!./src/protobuf/**/*"],
1111
projects: [
1212
{
1313
displayName: "unit",

‎package-lock.json

+11,735-4,589
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+58-39
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,10 @@
11
{
2-
"name": "@akashnetwork/akashjs",
3-
"version": "0.5.11",
4-
"description": "Akash Network JS SDK",
5-
"repository": {
6-
"url": "https://github.com/ovrclk/akashjs"
7-
},
8-
"license": "Apache-2.0",
92
"author": "",
10-
"main": "build/index.js",
113
"browser": {
124
"fs": false,
135
"os": false,
146
"path": false
157
},
16-
"types": "build/",
17-
"files": [
18-
"umd/",
19-
"build/**/*.d.ts",
20-
"build/**/*.js"
21-
],
22-
"scripts": {
23-
"build": "rimraf build && npm run build:tsc && npm run build:build",
24-
"build:build": "webpack",
25-
"build:production": "NODE_ENV=production npm run build:tsc && npm run build:build",
26-
"build:tsc": "rimraf build && tsc",
27-
"dev:watch": "tsc -- --watch",
28-
"format": "prettier --write './**/*.{js,ts,json}' --config ./.prettierrc",
29-
"lint": "eslint . --ext .js,.ts,.json",
30-
"lint:fix": "npm run lint -- --fix",
31-
"prepare": "husky",
32-
"prepublishOnly": "npm run build:production",
33-
"test": "npm run test:unit",
34-
"test:cov": "jest --selectProjects unit functional --coverage",
35-
"test:unit": "tap --ts tests/test_*.ts && jest --selectProjects unit",
36-
"test:unit-snapshot": "tap --ts --snapshot tests/test_*.ts",
37-
"test:unit:cov": "jest --selectProjects unit --coverage",
38-
"test:unit:watch": "jest --selectProjects unit --watch"
39-
},
40-
"lint-staged": {
41-
"*.{js,ts}": [
42-
"npm run format"
43-
]
44-
},
458
"dependencies": {
469
"@cosmjs/launchpad": "^0.27.0",
4710
"@cosmjs/proto-signing": "^0.28.11",
@@ -59,10 +22,19 @@
5922
"pkijs": "^3.0.0",
6023
"process": "^0.11.10",
6124
"pvutils": "^1.0.17",
62-
"simple-jsonrpc-js": "^1.2.0"
25+
"simple-jsonrpc-js": "^1.2.0",
26+
"sort-json": "^2.0.1"
6327
},
28+
"description": "Akash Network JS SDK",
6429
"devDependencies": {
30+
"@commitlint/cli": "^19.2.2",
31+
"@commitlint/config-conventional": "^19.2.2",
6532
"@faker-js/faker": "^8.4.1",
33+
"@semantic-release/changelog": "^6.0.3",
34+
"@semantic-release/commit-analyzer": "^12.0.0",
35+
"@semantic-release/git": "^10.0.1",
36+
"@semantic-release/github": "^10.0.3",
37+
"@semantic-release/release-notes-generator": "^13.0.0",
6638
"@types/atob": "^2.1.2",
6739
"@types/jest": "^29.5.12",
6840
"@types/js-yaml": "^4.0.5",
@@ -71,6 +43,8 @@
7143
"@types/sinon": "^10.0.11",
7244
"@types/tap": "^15.0.5",
7345
"@typescript-eslint/eslint-plugin": "^7.2.0",
46+
"commitlint": "^19.2.2",
47+
"conventional-changelog-conventionalcommits": "^7.0.2",
7448
"husky": "^9.0.11",
7549
"jest": "^29.7.0",
7650
"lint-staged": "^15.2.2",
@@ -89,5 +63,50 @@
8963
},
9064
"engines": {
9165
"node": ">18.0.0"
92-
}
66+
},
67+
"files": [
68+
"umd/",
69+
"build/**/*.d.ts",
70+
"build/**/*.js"
71+
],
72+
"license": "Apache-2.0",
73+
"lint-staged": {
74+
"*.{js,jsx,ts,tsx}": [
75+
"npm run test",
76+
"npm run lint:fix",
77+
"npm run format"
78+
],
79+
"package.json": [
80+
"sort-json package.json"
81+
],
82+
"tsconfig.json": [
83+
"sort-json tsconfig.json"
84+
]
85+
},
86+
"main": "build/index.js",
87+
"name": "@akashnetwork/akashjs",
88+
"repository": {
89+
"url": "https://github.com/ovrclk/akashjs"
90+
},
91+
"scripts": {
92+
"build": "rimraf build && npm run build:tsc && npm run build:build",
93+
"build:build": "webpack",
94+
"build:production": "NODE_ENV=production npm run build:tsc && npm run build:build",
95+
"build:tsc": "rimraf build && tsc",
96+
"commitlint": "commitlint --edit",
97+
"dev:watch": "tsc -- --watch",
98+
"format": "prettier --write './**/*.{js,ts,json}' --config ./.prettierrc",
99+
"lint": "eslint . --ext .js,.ts,.json -c .eslintrc.json",
100+
"lint:fix": "npm run lint -- --fix",
101+
"prepare": "husky",
102+
"prepublishOnly": "npm run build:production",
103+
"test": "npm run test:unit",
104+
"test:cov": "jest --selectProjects unit functional --coverage",
105+
"test:unit": "tap --ts tests/test_*.ts && jest --selectProjects unit",
106+
"test:unit-snapshot": "tap --ts --snapshot tests/test_*.ts",
107+
"test:unit:cov": "jest --selectProjects unit --coverage",
108+
"test:unit:watch": "jest --selectProjects unit --watch"
109+
},
110+
"types": "build/",
111+
"version": "0.5.11"
93112
}

‎src/certificates/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import { QueryCertificatesRequest, QueryCertificatesResponse } from "../protobuf/akash/cert/v1beta3/query";
77
import { CertificateFilter } from "../protobuf/akash/cert/v1beta1/cert";
88

9+
// eslint-disable-next-line @typescript-eslint/no-var-requires
910
const JsonRPC = require("simple-jsonrpc-js");
1011

1112
import { toBase64 } from "pvutils";

‎src/keplr/index.ts

-3
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,26 @@
1515
};
1616
}
1717

1818
export function getSigner(chain: any) {
1919
return (window as any).getOfflineSignerAuto(chain.id);
2020
}
2121

2222
export async function get(chain: any, signer: any, endPoint: string) {
2323
const customAminoTypes: any = new AminoTypes({
2424
"/akash.cert.v1beta2.MsgCreateCertificate": {
2525
aminoType: "cert/cert-create-certificate",
2626
toAmino: ({ owner, cert, pubkey }: any) => {
2727
const buf: any = Certificate.encode(
2828
Certificate.fromPartial({
2929
owner,
3030
cert,
3131
pubkey
3232
} as any)
3333
).finish();
3434
const encoded = Buffer.from(buf);
3535
return encoded.toString("base64");
3636
},
3737
fromAmino: ({ owner, cert, pubkey }: any) => {
3838
return Certificate.fromPartial({
3939
owner,
4040
cert,
@@ -54,6 +54,3 @@
5454
aminoTypes: customAminoTypes
5555
} as any);
5656
}
57-
function bufferToHex(buffer: any) {
58-
return [...new Uint8Array(buffer)].map(b => b.toString(16).padStart(2, "0")).join("");
59-
}

‎src/rpc/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { Tendermint34Client } from "@cosmjs/tendermint-rpc";
22
import { createProtobufRpcClient, GasPrice, QueryClient, SigningStargateClient, SigningStargateClientOptions } from "@cosmjs/stargate";
33
import { getAkashTypeRegistry } from "../stargate";
44
import { OfflineSigner, Registry } from "@cosmjs/proto-signing";
5-
import { Decimal } from "cosmwasm";
65

76
export async function getRpc(endpoint: string) {
87
return getQueryClient(endpoint);

‎src/sdl/index.ts

+9-8
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ export class SDL {
5959
}
6060

6161
static fromString(yaml: string, version: NetworkVersion = "beta2") {
62-
const data = SDL.validate(yaml, version) as v2Sdl;
62+
const data = SDL.validate(yaml) as v2Sdl;
6363

6464
return new SDL(data, version);
6565
}
6666

67-
static validate(yaml: string, version: NetworkVersion) {
67+
static validate(yaml: string) {
6868
// TODO: this should really be cast to unknown, then assigned
6969
// to v2 or v3 SDL only after being validated
7070
const data = YAML.load(yaml) as v3Sdl;
@@ -110,7 +110,9 @@ export class SDL {
110110

111111
if (
112112
units > 0 &&
113-
Object.values(gpu.attributes?.vendor || {}).some(models => models?.some(model => model.interface && !GPU_SUPPORTED_INTERFACES.includes(model.interface)))
113+
Object.values(gpu.attributes?.vendor || {}).some(models =>
114+
models?.some(model => model.interface && !GPU_SUPPORTED_INTERFACES.includes(model.interface))
115+
)
114116
) {
115117
throw new Error(`GPU interface must be one of the supported interfaces (${GPU_SUPPORTED_INTERFACES.join(",")}).`);
116118
}
@@ -129,7 +131,7 @@ export class SDL {
129131
throw new Error("Storage size is required for service " + name);
130132
}
131133

132-
if (!!storage.attributes) {
134+
if (storage.attributes) {
133135
for (const [key, value] of Object.entries(storage.attributes)) {
134136
if (key === "class" && value === "ram" && storage.attributes.persistent === true) {
135137
throw new Error("Storage attribute 'ram' must have 'persistent' set to 'false' or not defined for service " + name);
@@ -179,7 +181,7 @@ export class SDL {
179181
deploymentsByPlacement(placement: string) {
180182
const deployments = this.data ? this.data.deployment : [];
181183

182-
return Object.entries(deployments as object).filter(([name, deployment]) => deployment.hasOwnProperty(placement));
184+
return Object.entries(deployments as object).filter(({ 1: deployment }) => Object.prototype.hasOwnProperty.call(deployment, placement));
183185
}
184186

185187
resourceUnit(val: string, asString: boolean) {
@@ -799,7 +801,6 @@ export class SDL {
799801
}
800802

801803
v2Groups() {
802-
const sdl = this;
803804
const yamlJson = this.data;
804805
const ipEndpointNames = this.computeEndpointSequenceNumbers(yamlJson);
805806

@@ -861,7 +862,7 @@ export class SDL {
861862
const exposeSpec = {
862863
port: expose.port,
863864
externalPort: expose.as || 0,
864-
proto: sdl.parseServiceProto(expose.proto),
865+
proto: this.parseServiceProto(expose.proto),
865866
global: !!to.global
866867
};
867868

@@ -873,7 +874,7 @@ export class SDL {
873874
});
874875
}
875876

876-
const kind = sdl.exposeShouldBeIngress(exposeSpec) ? Endpoint_SHARED_HTTP : Endpoint_RANDOM_PORT;
877+
const kind = this.exposeShouldBeIngress(exposeSpec) ? Endpoint_SHARED_HTTP : Endpoint_RANDOM_PORT;
877878

878879
endpoints.push({ kind: kind, sequence_number: 0 });
879880
});

‎src/sdl/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export type v3ServiceExposeHttpOptions = {
5454
nextCases: string[];
5555
};
5656

57-
export type ResourceUnits = {};
57+
export type ResourceUnits = Record<string, any>;
5858

5959
export type v2ServiceExpose = {
6060
Port: number;

‎src/wallet/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import keytar from "keytar";
33

44
let wallet: any;
55

6-
export async function createAccount(password: string) {
6+
export async function createAccount() {
77
wallet = await Secp256k1HdWallet.generate(undefined, { prefix: "akash" });
88
const [{ address }] = await wallet.getAccounts();
99
keytar.setPassword("AkashNetwork", address, wallet.mnemonic);

‎tests/test_sdl_empty_profile.ts

-78
Original file line numberDiff line numberDiff line change
@@ -97,84 +97,6 @@ const expectedManifest = [
9797
}
9898
];
9999

100-
const expectedGroups = [
101-
{
102-
name: "akash",
103-
requirements: {
104-
attributes: [
105-
{
106-
key: "host",
107-
value: "akash"
108-
}
109-
],
110-
signedBy: {
111-
allOf: [],
112-
anyOf: ["akash1365yvmc4s7awdyj3n2sav7xfx76adc6dnmlx63", "akash18qa2a2ltfyvkyj0ggj3hkvuj6twzyumuaru9s4"]
113-
}
114-
},
115-
resources: [
116-
{
117-
resources: {
118-
cpu: {
119-
units: {
120-
val: {
121-
"0": 49,
122-
"1": 48,
123-
"2": 48,
124-
"3": 48
125-
}
126-
}
127-
},
128-
memory: {
129-
quantity: {
130-
val: {
131-
"0": 53,
132-
"1": 51,
133-
"2": 54,
134-
"3": 56,
135-
"4": 55,
136-
"5": 48,
137-
"6": 57,
138-
"7": 49,
139-
"8": 50
140-
}
141-
}
142-
},
143-
storage: [
144-
{
145-
name: "default",
146-
quantity: {
147-
val: {
148-
"0": 53,
149-
"1": 51,
150-
"2": 54,
151-
"3": 56,
152-
"4": 55,
153-
"5": 48,
154-
"6": 57,
155-
"7": 49,
156-
"8": 50
157-
}
158-
}
159-
}
160-
],
161-
endpoints: [
162-
{
163-
kind: 0,
164-
sequence_number: 0
165-
}
166-
]
167-
},
168-
price: {
169-
denom: "uakt",
170-
amount: "10000"
171-
},
172-
count: 1
173-
}
174-
]
175-
}
176-
];
177-
178100
const expectedPreVersionJson =
179101
'[{"Name":"akash","Services":[{"Args":null,"Command":null,"Count":1,"Env":null,"Expose":[{"EndpointSequenceNumber":0,"ExternalPort":80,"Global":true,"HTTPOptions":{"MaxBodySize":1048576,"NextCases":["error","timeout"],"NextTimeout":0,"NextTries":3,"ReadTimeout":60000,"SendTimeout":60000},"Hosts":null,"IP":"","Port":80,"Proto":"TCP","Service":""}],"Image":"bsord/tetris","Name":"tetris-main","Resources":{"cpu":{"units":{"val":"1000"}},"endpoints":null,"memory":{"size":{"val":"536870912"}},"storage":[{"name":"default","size":{"val":"536870912"}}]}}]}]';
180102

‎tests/util.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import sinon from "sinon";
22

3-
export function testRpc(spy: sinon.SinonSpy, response = null) {
3+
export function testRpc(spy: sinon.SinonSpy) {
44
return {
55
request: spy
66
};

0 commit comments

Comments
 (0)
Please sign in to comment.