forked from cerc-io/laconic-sdk
Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fb3edfabd3 | ||
|
|
ff3d70cc0d | ||
|
|
b1d3c83d32 | ||
|
|
b07df23804 |
@@ -1,4 +1,4 @@
|
|||||||
# chiba-clonk-client
|
# laconic-client
|
||||||
|
|
||||||
## Tests
|
## Tests
|
||||||
|
|
||||||
@@ -12,19 +12,19 @@ Follow these steps to run the tests:
|
|||||||
|
|
||||||
- Copy [.env.example](./.env.example) file and create a `.env` file.
|
- Copy [.env.example](./.env.example) file and create a `.env` file.
|
||||||
|
|
||||||
- Clone the [chiba-clonk repo](https://github.com/vulcanize/chiba-clonk) and change to repo directory.
|
- Clone the [laconicd repo](https://github.com/cerc-io/laconicd) and change to repo directory.
|
||||||
|
|
||||||
- Run the chain using `./init.sh`.
|
- Run the chain using `./init.sh`.
|
||||||
|
|
||||||
- Export the private key using:
|
- Export the private key using:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
chibaclonkd keys export mykey --unarmored-hex --unsafe
|
laconicd keys export mykey --unarmored-hex --unsafe
|
||||||
```
|
```
|
||||||
|
|
||||||
- Copy the private key and assign it to variable `PRIVATE_KEY` in the `.env` file.
|
- Copy the private key and assign it to variable `PRIVATE_KEY` in the `.env` file.
|
||||||
|
|
||||||
- Run the tests in chiba-clonk-client repo:
|
- Run the tests in laconic-client repo:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
yarn test
|
yarn test
|
||||||
@@ -32,7 +32,7 @@ Follow these steps to run the tests:
|
|||||||
|
|
||||||
- Run the tests with auctions enabled
|
- Run the tests with auctions enabled
|
||||||
|
|
||||||
- In chiba-clonk repo run:
|
- In laconicd repo run:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
TEST_AUCTION_ENABLED=true ./init.sh
|
TEST_AUCTION_ENABLED=true ./init.sh
|
||||||
@@ -41,7 +41,7 @@ Follow these steps to run the tests:
|
|||||||
- Export the private key and change it in `.env` file again using:
|
- Export the private key and change it in `.env` file again using:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
chibaclonkd keys export mykey --unarmored-hex --unsafe
|
laconicd keys export mykey --unarmored-hex --unsafe
|
||||||
```
|
```
|
||||||
|
|
||||||
- Run tests:
|
- Run tests:
|
||||||
@@ -52,7 +52,7 @@ Follow these steps to run the tests:
|
|||||||
|
|
||||||
- Run the tests for record and authority expiry
|
- Run the tests for record and authority expiry
|
||||||
|
|
||||||
- In chiba-clonk repo run:
|
- In laconicd repo run:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
TEST_NAMESERVICE_EXPIRY=true ./init.sh
|
TEST_NAMESERVICE_EXPIRY=true ./init.sh
|
||||||
@@ -61,7 +61,7 @@ Follow these steps to run the tests:
|
|||||||
- Export the private key and change it in `.env` file again using:
|
- Export the private key and change it in `.env` file again using:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
chibaclonkd keys export mykey --unarmored-hex --unsafe
|
laconicd keys export mykey --unarmored-hex --unsafe
|
||||||
```
|
```
|
||||||
|
|
||||||
- Run tests:
|
- Run tests:
|
||||||
@@ -81,7 +81,7 @@ Follow these steps to run the tests:
|
|||||||
failed to execute message; message index: 0: Invalid signature.: unauthorized
|
failed to execute message; message index: 0: Invalid signature.: unauthorized
|
||||||
```
|
```
|
||||||
|
|
||||||
- When sending `setRecord` message, an integer value passed in watcher attributes is parsed as float type in chiba-clonk while [unmarshalling json](https://pkg.go.dev/encoding/json#Unmarshal).
|
- When sending `setRecord` message, an integer value passed in watcher attributes is parsed as float type in laconicd while [unmarshalling json](https://pkg.go.dev/encoding/json#Unmarshal).
|
||||||
|
|
||||||
- `setRecord` message throws error when fileds in [Record](./src/types.ts) message are not assigned.
|
- `setRecord` message throws error when fileds in [Record](./src/types.ts) message are not assigned.
|
||||||
```
|
```
|
||||||
|
|||||||
+6
-7
@@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"name": "chiba-clonk-client",
|
"name": "laconic-client",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
"repository": "git@github.com:vulcanize/chiba-clonk-client.git",
|
"repository": "git@github.com:cerc-io/laconic-client.git",
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "UNLICENSED",
|
"license": "UNLICENSED",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@@ -12,10 +12,9 @@
|
|||||||
"@types/lodash": "^4.14.181",
|
"@types/lodash": "^4.14.181",
|
||||||
"@types/semver": "^7.3.9",
|
"@types/semver": "^7.3.9",
|
||||||
"dotenv": "^16.0.0",
|
"dotenv": "^16.0.0",
|
||||||
"protoc-gen-ts": "^0.8.5",
|
"jest": "^27.5.1",
|
||||||
"google-protobuf": "^3.21.0",
|
"protoc-gen-ts": "^0.8.2",
|
||||||
"jest": "29.0.0",
|
"ts-jest": "^27.1.3",
|
||||||
"ts-jest": "^29.0.2",
|
|
||||||
"typescript": "^4.6.2"
|
"typescript": "^4.6.2"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -34,7 +33,7 @@
|
|||||||
"graphql.js": "^0.6.8",
|
"graphql.js": "^0.6.8",
|
||||||
"is-url": "^1.2.4",
|
"is-url": "^1.2.4",
|
||||||
"js-sha256": "^0.9.0",
|
"js-sha256": "^0.9.0",
|
||||||
"js-yaml": "^3.14.1",
|
"js-yaml": "^4.1.0",
|
||||||
"jsonschema": "^1.4.0",
|
"jsonschema": "^1.4.0",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"node-yaml": "^4.0.1",
|
"node-yaml": "^4.0.1",
|
||||||
|
|||||||
+2
-2
@@ -30,7 +30,7 @@ const auctionTests = (numBidders = 3) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('Reserve authority.', async () => {
|
test('Reserve authority.', async () => {
|
||||||
authorityName = `chiba-clonk-${Date.now()}`;
|
authorityName = `laconic-${Date.now()}`;
|
||||||
await registry.reserveAuthority({ name: authorityName }, accounts[0].privateKey, fee);
|
await registry.reserveAuthority({ name: authorityName }, accounts[0].privateKey, fee);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -115,7 +115,7 @@ if (!process.env.TEST_AUCTIONS_ENABLED) {
|
|||||||
test('skipping auction tests', () => {});
|
test('skipping auction tests', () => {});
|
||||||
} else {
|
} else {
|
||||||
/**
|
/**
|
||||||
Running these tests requires name auctions enabled. In chiba-clonk repo run:
|
Running these tests requires name auctions enabled. In laconicd repo run:
|
||||||
|
|
||||||
TEST_AUCTION_ENABLED=true ./init.sh
|
TEST_AUCTION_ENABLED=true ./init.sh
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -53,7 +53,7 @@ import {
|
|||||||
MessageMsgRevealBid
|
MessageMsgRevealBid
|
||||||
} from './messages/auction';
|
} from './messages/auction';
|
||||||
|
|
||||||
const DEFAULT_WRITE_ERROR = 'Unable to write to chiba-clonk.';
|
const DEFAULT_WRITE_ERROR = 'Unable to write to laconicd.';
|
||||||
|
|
||||||
// Parse Tx response from cosmos-sdk.
|
// Parse Tx response from cosmos-sdk.
|
||||||
export const parseTxResponse = (result: any, parseResponse?: (data: string) => any) => {
|
export const parseTxResponse = (result: any, parseResponse?: (data: string) => any) => {
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ const nameserviceExpiryTests = () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('Reserve authority and set bond', async () => {
|
test('Reserve authority and set bond', async () => {
|
||||||
authorityName = `chiba-clonk-${Date.now()}`;
|
authorityName = `laconic-${Date.now()}`;
|
||||||
await registry.reserveAuthority({ name: authorityName }, privateKey, fee);
|
await registry.reserveAuthority({ name: authorityName }, privateKey, fee);
|
||||||
await registry.setAuthorityBond({ name: authorityName, bondId }, privateKey, fee);
|
await registry.setAuthorityBond({ name: authorityName, bondId }, privateKey, fee);
|
||||||
const [authority] = await registry.lookupAuthorities([authorityName]);
|
const [authority] = await registry.lookupAuthorities([authorityName]);
|
||||||
@@ -102,7 +102,7 @@ if (!process.env.TEST_NAMESERVICE_EXPIRY) {
|
|||||||
test('skipping nameservice expiry tests', () => {});
|
test('skipping nameservice expiry tests', () => {});
|
||||||
} else {
|
} else {
|
||||||
/**
|
/**
|
||||||
Running these tests requires timers to be set. In chiba-clonk repo run:
|
Running these tests requires timers to be set. In laconicd repo run:
|
||||||
|
|
||||||
TEST_NAMESERVICE_EXPIRY=true ./init.sh
|
TEST_NAMESERVICE_EXPIRY=true ./init.sh
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -47,7 +47,7 @@ const namingTests = () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('Reserve authority.', async () => {
|
test('Reserve authority.', async () => {
|
||||||
authorityName = `chiba-clonk-${Date.now()}`;
|
authorityName = `laconic-${Date.now()}`;
|
||||||
await registry.reserveAuthority({ name: authorityName }, privateKey, fee);
|
await registry.reserveAuthority({ name: authorityName }, privateKey, fee);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -37,10 +37,10 @@ export const getConfig = () => {
|
|||||||
assert(process.env.PRIVATE_KEY);
|
assert(process.env.PRIVATE_KEY);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
chainId: process.env.COSMOS_CHAIN_ID || 'chibaclonk_9000-1',
|
chainId: process.env.COSMOS_CHAIN_ID || 'laconic_9000-1',
|
||||||
privateKey: process.env.PRIVATE_KEY,
|
privateKey: process.env.PRIVATE_KEY,
|
||||||
restEndpoint: process.env.CHIBA_CLONK_REST_ENDPOINT || 'http://localhost:1317',
|
restEndpoint: process.env.LACONICD_REST_ENDPOINT || 'http://localhost:1317',
|
||||||
gqlEndpoint: process.env.CHIBA_CLONK_GQL_ENDPOINT || 'http://localhost:9473/api',
|
gqlEndpoint: process.env.LACONICD_GQL_ENDPOINT || 'http://localhost:9473/api',
|
||||||
fee: {
|
fee: {
|
||||||
amount: '20',
|
amount: '20',
|
||||||
denom: 'aphoton',
|
denom: 'aphoton',
|
||||||
|
|||||||
Reference in New Issue
Block a user