Compare commits

..
Author SHA1 Message Date
prathamesh 84035ba91e Enable CI on test-ci branch 2024-01-17 18:14:23 +05:30
prathamesh bd128d090b More debug logs 2024-01-17 17:27:15 +05:30
prathamesh f791ce828d Add debug comments 2024-01-17 17:06:23 +05:30
prathamesh 972b878674 Update naming test timeout 2024-01-16 17:35:23 +05:30
prathamesh 603fe5916a Update naming test timeout 2024-01-16 16:19:49 +05:30
prathamesh b7223c1c43 Update container build script 2024-01-16 15:27:33 +05:30
prathamesh e5900b2e4a Add container build script and update workflow 2024-01-16 14:34:37 +05:30
roysc 913389ab9f dockerfile cleanup 2024-01-15 11:55:25 +05:30
roysc 7e18b5a8cf refactor tests to run independently 2024-01-15 11:53:54 +05:30
roysc 7eb37f894d formatting 2024-01-15 11:31:21 +05:30
65001568c8 Remove hard-coded record types (#52)
Refactors the `Record.Attributes` from Any into a byte string.
Companion to cerc-io/laconicd#132.

Resolves https://github.com/cerc-io/laconicd/issues/107

Co-authored-by: Roy Crihfield <roy@manteia.ltd>
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Reviewed-on: https://git.vdb.to/cerc-io/laconic-sdk/pulls/52
Reviewed-by: Thomas E Lackey <telackey@noreply.git.vdb.to>
Co-authored-by: Nabarun <nabarun@deepstacksoft.com>
Co-committed-by: Nabarun <nabarun@deepstacksoft.com>
2024-01-15 04:58:55 +00:00
telackey 990e427c3f Add ApplicationDeploymentRemovalRequests (#51)
```
message ApplicationDeploymentRemovalRequest {
  string type           = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
  string version        = 2 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
  string deployment     = 3 [(gogoproto.moretags) = "json:\"deployment\" yaml:\"deployment\""];
  string request        = 4 [(gogoproto.moretags) = "json:\"request\" yaml:\"request\""];
  string meta           = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
  repeated string tags  = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
}

message ApplicationDeploymentRemovalRecord {
  string type           = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
  string version        = 2 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
  string deployment     = 3 [(gogoproto.moretags) = "json:\"deployment\" yaml:\"deployment\""];
  string request        = 4 [(gogoproto.moretags) = "json:\"request\" yaml:\"request\""];
  string meta           = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
  repeated string tags  = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
}
```

Reviewed-on: cerc-io/laconic-sdk#51
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2023-12-21 21:19:49 +00:00
telackey 419dddc35a Make 'repository' a repeated value and add ApplicationArtifact type. (#50)
Reviewed-on: cerc-io/laconic-sdk#50
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2023-12-13 20:51:12 +00:00
telackey 99bc3f0ce5 Deployment, not crn (#49)
Reviewed-on: cerc-io/laconic-sdk#49
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2023-12-08 04:37:09 +00:00
telackey fc2987a5ca Add DnsRecord and ApplicationDeploymentRequest (#48)
```
message DnsRecord {
  string type           = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
  string name           = 2 [(gogoproto.moretags) = "json:\"name\" yaml:\"name\""];
  string version        = 3 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
  string resource_type  = 4 [(gogoproto.moretags) = "json:\"resourceType\" yaml:\"resourceType\""];
  string value          = 5 [(gogoproto.moretags) = "json:\"value\" yaml:\"value\""];
  string meta           = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
  repeated string tags  = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
}

message ApplicationDeploymentRequest {
  string type           = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
  string name           = 2 [(gogoproto.moretags) = "json:\"name\" yaml:\"name\""];
  string version        = 3 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
  string application    = 4 [(gogoproto.moretags) = "json:\"application\" yaml:\"application\""];
  string dns            = 5 [(gogoproto.moretags) = "json:\"dns\" yaml:\"dns\""];
  string config         = 6 [(gogoproto.moretags) = "json:\"config\" yaml:\"config\""];
  repeated string crn   = 7 [(gogoproto.moretags) = "json:\"crn\" yaml:\"crn\""];
  string meta           = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
  repeated string tags  = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
}
```

Also rename WebAppDeploymentRecord to ApplicationDeploymentRecord.

Reviewed-on: cerc-io/laconic-sdk#48
Reviewed-by: David Boreham <dboreham@noreply.git.vdb.to>
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2023-12-07 22:08:49 +00:00
telackey aba95a275c More publishing fixes
Reviewed-on: cerc-io/laconic-sdk#47
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2023-11-21 23:29:12 +00:00
telackey a3603e2738 Fix publishing (#46)
Reviewed-on: cerc-io/laconic-sdk#46
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2023-11-21 22:55:18 +00:00
telackey 27443c3cac v0.1.7 (#45)
Reviewed-on: cerc-io/laconic-sdk#45
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2023-11-21 22:31:06 +00:00
telackey b5fce86d48 Add new record types ApplicationRecord, WebAppDeploymentRecord, GeneralRecord (#44)
See also: cerc-io/laconicd#113

![image](/attachments/db05bbb6-86ca-4fbb-a8a4-fcd06501b1b1)

```
message ApplicationRecord {
  string type           = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
  string name           = 2 [(gogoproto.moretags) = "json:\"name\" yaml:\"name\""];
  string description    = 3 [(gogoproto.moretags) = "json:\"description\" yaml:\"description\""];
  string version        = 4 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
  string homepage       = 5 [(gogoproto.moretags) = "json:\"homepage\" yaml:\"homepage\""];
  string license        = 6 [(gogoproto.moretags) = "json:\"license\" yaml:\"license\""];
  string author         = 7 [(gogoproto.moretags) = "json:\"author\" yaml:\"author\""];
  string repository     = 8 [(gogoproto.moretags) = "json:\"repository\" yaml:\"repository\""];
  string repository_tag = 9 [(gogoproto.moretags) = "json:\"repositoryTag\" yaml:\"repositoryTag\""];
  string app_version    = 10 [(gogoproto.moretags) = "json:\"appVersion\" yaml:\"appVersion\""];
  string app_type       = 11 [(gogoproto.moretags) = "json:\"appType\" yaml:\"appType\""];
  string meta           = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
  repeated string tags  = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
}

message WebAppDeploymentRecord {
  string type           = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
  string name           = 2 [(gogoproto.moretags) = "json:\"name\" yaml:\"name\""];
  string description    = 3 [(gogoproto.moretags) = "json:\"description\" yaml:\"description\""];
  string version        = 4 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
  string application    = 5 [(gogoproto.moretags) = "json:\"application\" yaml:\"application\""];
  string url            = 6 [(gogoproto.moretags) = "json:\"\" yaml:\"name\""];
  string meta           = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
  repeated string tags  = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
}

message GeneralRecord {
  string type           = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
  string name           = 2 [(gogoproto.moretags) = "json:\"name\" yaml:\"name\""];
  string description    = 3 [(gogoproto.moretags) = "json:\"description\" yaml:\"description\""];
  string version        = 4 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
  string category       = 5 [(gogoproto.moretags) = "json:\"category\" yaml:\"category\""];
  string value          = 6 [(gogoproto.moretags) = "json:\"value\" yaml:\"value\""];
  string meta           = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
  repeated string tags  = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
```

```
❯ cat general.yml
record:
  type: GeneralRecord
  name: my-generic-record
  version: 0.0.1
  value: "anything-goes-here"
  category: filter-by-this
  tags:
    - a
    - b
    - c
  meta:
    foo: bar
    bar:
      baz: boz

❯ bin/laconic cns record publish --filename general.yml --bond-id ba774084e25af5b29be126dda0bb910d93dea3634713a438ac257da5bbdc631c
{
  "id": "bafyreigt3he52eia5g4i5pnst4dfcuwwgjdoul6xmcke2obz5os4xwoo3q"
}

❯ bin/laconic cns record get --id bafyreigt3he52eia5g4i5pnst4dfcuwwgjdoul6xmcke2obz5os4xwoo3q
[
  {
    "id": "bafyreigt3he52eia5g4i5pnst4dfcuwwgjdoul6xmcke2obz5os4xwoo3q",
    "names": null,
    "owners": [
      "9A66500A9AA574CAAB4EDB26F7333590BF452CE0"
    ],
    "bondId": "ba774084e25af5b29be126dda0bb910d93dea3634713a438ac257da5bbdc631c",
    "createTime": "2023-11-17T23:11:27Z",
    "expiryTime": "2024-11-16T23:11:27Z",
    "attributes": {
      "meta": "{\"foo\":\"bar\",\"bar\":{\"baz\":\"boz\"}}",
      "tags": [
        "a",
        "b",
        "c"
      ],
      "type": "GeneralRecord",
      "name": "my-generic-record",
      "version": "0.0.1",
      "category": "filter-by-this",
      "value": "anything-goes-here"
    }
  }
]
```

> Note: The repeated items are preserved as lists, but the object/map ends up encoded as a string.  It would be nice to avoid this.

Reviewed-on: cerc-io/laconic-sdk#44
Reviewed-by: David Boreham <dboreham@noreply.git.vdb.to>
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2023-11-20 22:01:19 +00:00
37 changed files with 471 additions and 405 deletions
+2
View File
@@ -0,0 +1,2 @@
Dockerfile
node_modules
+6 -2
View File
@@ -7,12 +7,16 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
node-version: [ 16.x ] node-version: [ 18.x ]
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Download yarn
run: |
curl -fsSL -o /usr/local/bin/yarn https://github.com/yarnpkg/yarn/releases/download/v1.22.21/yarn-1.22.21.js
chmod +x /usr/local/bin/yarn
- name: Use Node.js ${{ matrix.node-version }} - name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
@@ -26,7 +30,7 @@ jobs:
npm config set registry https://git.vdb.to/api/packages/cerc-io/npm/ npm config set registry https://git.vdb.to/api/packages/cerc-io/npm/
- name: Authenticate to git.vdb.to registry - name: Authenticate to git.vdb.to registry
run: | run: |
npm config set -- '//git.vdb.to/api/packages/cerc-io/npm/:_authToken' "${{ secrets.GITEA_PUBLISH_TOKEN }}" npm config set -- '//git.vdb.to/api/packages/cerc-io/npm/:_authToken' "${{ secrets.CICD_PUBLISH_TOKEN }}"
- name: npm publish - name: npm publish
run: | run: |
npm publish npm publish
+34 -47
View File
@@ -6,6 +6,7 @@ on:
push: push:
branches: branches:
- main - main
- test-ci
- release/** - release/**
env: env:
@@ -17,65 +18,51 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Checkout laconicd - name: Checkout laconicd
uses: actions/checkout@v3 # uses: actions/checkout@v3
with: # with:
path: "./laconicd/" # path: "./laconicd/"
repository: cerc-io/laconicd # repository: cerc-io/laconicd
fetch-depth: 0 # fetch-depth: 0
ref: main # ref: main
run: |
git clone https://git.vdb.to/deep-stack/laconicd.git
cd laconicd
git checkout pm-qol-improvements
- name: Environment - name: Environment
run: ls -tlh && env run: ls -tlh && env
- name: Start dockerd - name: Start dockerd
run: | run: |
dockerd -H $DOCKER_HOST --userland-proxy=false & dockerd -H $DOCKER_HOST --userland-proxy=false &
sleep 5 sleep 5
- name: build containers scripts
- name: Build laconicd container
working-directory: laconicd/tests/sdk_tests working-directory: laconicd/tests/sdk_tests
run: ./build-laconicd-container.sh run: ./build-laconicd-container.sh
- name: build test-container - name: Build laconic-sdk container
run: docker build -t cerc-io/laconic-sdk-tester:local-test -f laconicd/tests/sdk_tests/Dockerfile-sdk . run: ./scripts/build-sdk-test-container.sh
- name: start containers
- name: Start containers
working-directory: laconicd/tests/sdk_tests working-directory: laconicd/tests/sdk_tests
run: docker compose up -d run: docker compose up -d
- name: run basic tests - name: Run tests
working-directory: laconicd/tests/sdk_tests working-directory: laconicd/tests/sdk_tests
run: | run: ./run-tests.sh
laconicd_key=$( docker compose exec laconicd echo y | docker compose exec laconicd laconicd keys export mykey --unarmored-hex --unsafe )
cosmos_chain_id=laconic_9000-1 - name: Start containers (auctions enabled)
laconicd_rest_endpoint=http://laconicd:1317
laconicd_gql_endpoint=http://laconicd:9473/api
sleep 30s
docker compose exec sdk-test-runner sh -c "COSMOS_CHAIN_ID=${cosmos_chain_id} LACONICD_REST_ENDPOINT=${laconicd_rest_endpoint} LACONICD_GQL_ENDPOINT=${laconicd_gql_endpoint} PRIVATE_KEY=${laconicd_key} yarn test"
- name: stop containers
working-directory: laconicd/tests/sdk_tests working-directory: laconicd/tests/sdk_tests
run: docker compose down env:
- name: start auction containers TEST_AUCTION_ENABLED: true
run: docker compose up -d
- name: Run auction tests
working-directory: laconicd/tests/sdk_tests working-directory: laconicd/tests/sdk_tests
run: docker compose -f docker-compose-auctions.yml up -d run: ./run-tests.sh test:auctions
- name: run auction tests
- name: Start containers (expiry enabled)
working-directory: laconicd/tests/sdk_tests working-directory: laconicd/tests/sdk_tests
run: | env:
laconicd_key=$( docker compose exec laconicd echo y | docker compose exec laconicd laconicd keys export mykey --unarmored-hex --unsafe ) TEST_REGISTRY_EXPIRY: true
cosmos_chain_id=laconic_9000-1 run: docker compose up -d
laconicd_rest_endpoint=http://laconicd:1317 - name: Run nameservice expiry tests
laconicd_gql_endpoint=http://laconicd:9473/api
sleep 30s
docker compose exec sdk-test-runner sh -c "COSMOS_CHAIN_ID=${cosmos_chain_id} LACONICD_REST_ENDPOINT=${laconicd_rest_endpoint} LACONICD_GQL_ENDPOINT=${laconicd_gql_endpoint} PRIVATE_KEY=${laconicd_key} yarn test:auctions"
- name: start containers
working-directory: laconicd/tests/sdk_tests working-directory: laconicd/tests/sdk_tests
run: docker compose down run: ./run-tests.sh test:nameservice-expiry
- name: start containers
working-directory: laconicd/tests/sdk_tests
run: docker compose -f docker-compose-nameservice.yml up -d
- name: run nameservice expiry tests
working-directory: laconicd/tests/sdk_tests
run: |
laconicd_key=$( docker compose exec laconicd echo y | docker compose exec laconicd laconicd keys export mykey --unarmored-hex --unsafe )
cosmos_chain_id=laconic_9000-1
laconicd_rest_endpoint=http://laconicd:1317
laconicd_gql_endpoint=http://laconicd:9473/api
sleep 30s
docker compose exec sdk-test-runner sh -c "COSMOS_CHAIN_ID=${cosmos_chain_id} LACONICD_REST_ENDPOINT=${laconicd_rest_endpoint} LACONICD_GQL_ENDPOINT=${laconicd_gql_endpoint} PRIVATE_KEY=${laconicd_key} yarn test:nameservice-expiry"
- name: stop nameservice containers
working-directory: laconicd/tests/sdk_tests
run: docker compose down
+22 -41
View File
@@ -20,53 +20,34 @@ jobs:
ref: main ref: main
- name: Environment - name: Environment
run: ls -tlh && env run: ls -tlh && env
- name: build containers scripts
- name: Build laconicd container
working-directory: laconicd/tests/sdk_tests working-directory: laconicd/tests/sdk_tests
run: ./build-laconicd-container.sh run: ./build-laconicd-container.sh
- name: build test-container - name: Build laconic-sdk container
run: docker build -t cerc-io/laconic-sdk-tester:local-test -f laconicd/tests/sdk_tests/Dockerfile-sdk . run: ./scripts/build-sdk-test-container.sh
- name: start containers
- name: Start containers
working-directory: laconicd/tests/sdk_tests working-directory: laconicd/tests/sdk_tests
run: docker compose up -d run: docker compose up -d
- name: run basic tests - name: Run tests
working-directory: laconicd/tests/sdk_tests working-directory: laconicd/tests/sdk_tests
run: | run: ./run-tests.sh
laconicd_key=$( docker compose exec laconicd echo y | docker compose exec laconicd laconicd keys export mykey --unarmored-hex --unsafe )
cosmos_chain_id=laconic_9000-1 - name: Start containers (auctions enabled)
laconicd_rest_endpoint=http://laconicd:1317
laconicd_gql_endpoint=http://laconicd:9473/api
sleep 30s
docker compose exec sdk-test-runner sh -c "COSMOS_CHAIN_ID=${cosmos_chain_id} LACONICD_REST_ENDPOINT=${laconicd_rest_endpoint} LACONICD_GQL_ENDPOINT=${laconicd_gql_endpoint} PRIVATE_KEY=${laconicd_key} yarn test"
- name: stop containers
working-directory: laconicd/tests/sdk_tests working-directory: laconicd/tests/sdk_tests
run: docker compose down env:
- name: start auction containers TEST_AUCTION_ENABLED: true
run: docker compose up -d
- name: Run auction tests
working-directory: laconicd/tests/sdk_tests working-directory: laconicd/tests/sdk_tests
run: docker compose -f docker-compose-auctions.yml up -d run: ./run-tests.sh test:auctions
- name: run auction tests
- name: Start containers (expiry enabled)
working-directory: laconicd/tests/sdk_tests working-directory: laconicd/tests/sdk_tests
run: | env:
laconicd_key=$( docker compose exec laconicd echo y | docker compose exec laconicd laconicd keys export mykey --unarmored-hex --unsafe ) TEST_REGISTRY_EXPIRY: true
cosmos_chain_id=laconic_9000-1 run: docker compose up -d
laconicd_rest_endpoint=http://laconicd:1317 - name: Run nameservice expiry tests
laconicd_gql_endpoint=http://laconicd:9473/api
sleep 30s
docker compose exec sdk-test-runner sh -c "COSMOS_CHAIN_ID=${cosmos_chain_id} LACONICD_REST_ENDPOINT=${laconicd_rest_endpoint} LACONICD_GQL_ENDPOINT=${laconicd_gql_endpoint} PRIVATE_KEY=${laconicd_key} yarn test:auctions"
- name: start containers
working-directory: laconicd/tests/sdk_tests working-directory: laconicd/tests/sdk_tests
run: docker compose down run: ./run-tests.sh test:nameservice-expiry
- name: start containers
working-directory: laconicd/tests/sdk_tests
run: docker compose -f docker-compose-nameservice.yml up -d
- name: run nameservice expiry tests
working-directory: laconicd/tests/sdk_tests
run: |
laconicd_key=$( docker compose exec laconicd echo y | docker compose exec laconicd laconicd keys export mykey --unarmored-hex --unsafe )
cosmos_chain_id=laconic_9000-1
laconicd_rest_endpoint=http://laconicd:1317
laconicd_gql_endpoint=http://laconicd:9473/api
sleep 30s
docker compose exec sdk-test-runner sh -c "COSMOS_CHAIN_ID=${cosmos_chain_id} LACONICD_REST_ENDPOINT=${laconicd_rest_endpoint} LACONICD_GQL_ENDPOINT=${laconicd_gql_endpoint} PRIVATE_KEY=${laconicd_key} yarn test:nameservice-expiry"
- name: stop nameservice containers
working-directory: laconicd/tests/sdk_tests
run: docker compose down
+1 -9
View File
@@ -12,13 +12,5 @@ Run following scripts when [proto files](./proto/) are updated.
2. Generate typescript code for the proto files 2. Generate typescript code for the proto files
```bash ```bash
./scripts/create-proto-files.sh ./scripts/proto-gen.sh
``` ```
3. Remove GRPC code from generated code
```bash
./scripts/remove-grpc.sh
```
Reference: https://github.com/tharsis/evmosjs/tree/main/packages/proto#note
+5 -21
View File
@@ -21,34 +21,18 @@ RUN \
&& npm config -g set prefix ${NPM_GLOBAL} \ && npm config -g set prefix ${NPM_GLOBAL} \
&& su ${USERNAME} -c "npm config -g set prefix ${NPM_GLOBAL}" \ && su ${USERNAME} -c "npm config -g set prefix ${NPM_GLOBAL}" \
# Install eslint # Install eslint
&& su ${USERNAME} -c "umask 0002 && npm install -g eslint lerna jest" \ && su ${USERNAME} -c "umask 0002 && npm install -g eslint" \
&& npm cache clean --force > /dev/null 2>&1 && npm cache clean --force > /dev/null 2>&1
# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>
# [Optional] Uncomment if you want to install an additional version of node using nvm
# ARG EXTRA_NODE_VERSION=10
# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}"
# [Optional] Uncomment if you want to install more global node modules
# RUN su node -c "npm install -g <your-package-list-here>"
WORKDIR / WORKDIR /
RUN mkdir node_modules && mkdir proto && mkdir scripts && mkdir src
COPY node_modules ./node_modules/
COPY proto . ./proto/
COPY scripts ./scripts/
COPY src ./src/
COPY entrypoint.sh . COPY entrypoint.sh .
ENTRYPOINT ["/entrypoint.sh"] ENTRYPOINT ["/entrypoint.sh"]
# Placeholder CMD : generally this will be overridden at run time like :
# docker run -it -v /home/builder/cerc/laconic-sdk:/workspace cerc/builder-js sh -c 'cd /workspace && yarn && yarn build'
CMD node --version CMD node --version
# Temp hack, clone the laconic-sdk repo here WORKDIR /app/laconic-sdk
WORKDIR /app
COPY package*.json .
RUN yarn install RUN yarn install
COPY . .
WORKDIR /app/laconic-sdk WORKDIR /app/laconic-sdk
+12
View File
@@ -34,6 +34,12 @@ Follow these steps to run the tests:
- Run the tests with auctions enabled - Run the tests with auctions enabled
- Remove laconicd data from previous run
```bash
rm -rf ~/.laconicd
```
- In laconicd repo run: - In laconicd repo run:
```bash ```bash
@@ -54,6 +60,12 @@ Follow these steps to run the tests:
- Run the tests for record and authority expiry - Run the tests for record and authority expiry
- Remove laconicd data from previous run
```bash
rm -rf ~/.laconicd
```
- In laconicd repo run: - In laconicd repo run:
```bash ```bash
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "@cerc-io/laconic-sdk", "name": "@cerc-io/laconic-sdk",
"version": "0.1.6", "version": "0.1.14",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
"repository": "git@github.com:cerc-io/laconic-sdk.git", "repository": "git@github.com:cerc-io/laconic-sdk.git",
@@ -14,7 +14,7 @@
"dotenv": "^16.0.0", "dotenv": "^16.0.0",
"google-protobuf": "^3.21.0", "google-protobuf": "^3.21.0",
"jest": "29.0.0", "jest": "29.0.0",
"protoc-gen-ts": "^0.8.5", "protoc-gen-ts": "^0.8.7",
"ts-jest": "^29.0.2", "ts-jest": "^29.0.2",
"typescript": "^4.6.2" "typescript": "^4.6.2"
}, },
+2
View File
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
docker build -t cerc/laconic-sdk-tester:local -f Dockerfile .
+1
View File
@@ -23,6 +23,7 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
fi fi
echo "Removing gRPC references..." echo "Removing gRPC references..."
# https://github.com/tharsis/evmosjs/tree/main/packages/proto#note
for file in $(find $REPO_ROOT/src/proto -type f) for file in $(find $REPO_ROOT/src/proto -type f)
do do
+84 -68
View File
@@ -12,20 +12,10 @@ jest.setTimeout(90 * 1000);
const bondTests = () => { const bondTests = () => {
let registry: Registry; let registry: Registry;
let watcher: any;
let version1: string;
let version2: string;
let bondId1: string;
let bondId2: string;
let bondOwner: string;
const publishNewWatcherVersion = async (bondId: string) => { const publishNewWatcherVersion = async (bondId: string) => {
watcher = await ensureUpdatedConfig(WATCHER_YML_PATH); let watcher = await ensureUpdatedConfig(WATCHER_YML_PATH);
await registry.setRecord({ privateKey, record: watcher.record, bondId }, privateKey, fee); await registry.setRecord({ privateKey, record: watcher.record, bondId }, privateKey, fee);
return watcher.record.version; return watcher;
}; };
beforeAll(async () => { beforeAll(async () => {
@@ -33,93 +23,119 @@ const bondTests = () => {
}); });
test('Create bond.', async () => { test('Create bond.', async () => {
bondId1 = await registry.getNextBondId(privateKey); let bondId = await registry.getNextBondId(privateKey);
expect(bondId1).toBeDefined(); expect(bondId).toBeDefined();
await registry.createBond({ denom: 'aphoton', amount: '1000000000' }, privateKey, fee); await registry.createBond({ denom: 'aphoton', amount: '1000000000' }, privateKey, fee);
})
test('Get bond by ID.', async () => {
const [bond] = await registry.getBondsByIds([bondId1]);
expect(bond).toBeDefined();
expect(bond.id).toBe(bondId1);
expect(bond.balance).toHaveLength(1);
expect(bond.balance[0]).toEqual({ type: 'aphoton', quantity: '1000000000' });
bondOwner = bond.owner;
}); });
test('Query bonds.', async () => { describe('With bond created', () => {
const bonds = await registry.queryBonds(); let bond1: any
expect(bonds).toBeDefined();
const bond = bonds.filter((bond: any) => bond.id === bondId1);
expect(bond).toBeDefined();
});
test('Query bonds by owner.', async () => { beforeAll(async () => {
const bonds = await registry.queryBonds({ owner: bondOwner }); let bondId1 = await registry.getNextBondId(privateKey);
expect(bonds).toBeDefined(); expect(bondId1).toBeDefined();
const bond = bonds.filter((bond: any) => bond.id === bondId1); await registry.createBond({ denom: 'aphoton', amount: '1000000000' }, privateKey, fee);
expect(bond).toBeDefined();
});
test('Refill bond.', async () => { [bond1] = await registry.getBondsByIds([bondId1]);
await registry.refillBond({ id: bondId1, denom: 'aphoton', amount: '500' }, privateKey, fee); expect(bond1).toBeDefined();
expect(bond1.id).toEqual(bondId1);
});
const [bond] = await registry.getBondsByIds([bondId1]); test('Get bond by ID.', async () => {
expect(bond).toBeDefined(); const [bond] = await registry.getBondsByIds([bond1.id]);
expect(bond.id).toBe(bondId1); expect(bond).toBeDefined();
expect(bond.balance).toHaveLength(1); expect(bond.id).toBe(bond1.id);
expect(bond.balance[0]).toEqual({ type: 'aphoton', quantity: '1000000500' }); expect(bond.balance).toHaveLength(1);
}); expect(bond.balance[0]).toEqual({ type: 'aphoton', quantity: '1000000000' });
});
test('Withdraw bond.', async () => { test('Query bonds.', async () => {
await registry.withdrawBond({ id: bondId1, denom: 'aphoton', amount: '500' }, privateKey, fee); const bonds = await registry.queryBonds();
expect(bonds).toBeDefined();
const bond = bonds.filter((bond: any) => bond.id === bond1.id);
expect(bond).toBeDefined();
});
const [bond] = await registry.getBondsByIds([bondId1]); test('Query bonds by owner.', async () => {
expect(bond).toBeDefined(); const bonds = await registry.queryBonds({ owner: bond1.owner });
expect(bond.id).toBe(bondId1); expect(bonds).toBeDefined();
expect(bond.balance).toHaveLength(1); const bond = bonds.filter((bond: any) => bond.id === bond1.id);
expect(bond.balance[0]).toEqual({ type: 'aphoton', quantity: '1000000000' }); expect(bond).toBeDefined();
}); });
test('Cancel bond.', async () => { test('Refill bond.', async () => {
await registry.cancelBond({ id: bondId1 }, privateKey, fee); await registry.refillBond({ id: bond1.id, denom: 'aphoton', amount: '500' }, privateKey, fee);
const [bond] = await registry.getBondsByIds([bond1.id]);
expect(bond).toBeDefined();
expect(bond.id).toBe(bond1.id);
expect(bond.balance).toHaveLength(1);
expect(bond.balance[0]).toEqual({ type: 'aphoton', quantity: '1000000500' });
});
test('Withdraw bond.', async () => {
await registry.withdrawBond({ id: bond1.id, denom: 'aphoton', amount: '500' }, privateKey, fee);
const [bond] = await registry.getBondsByIds([bond1.id]);
expect(bond).toBeDefined();
expect(bond.id).toBe(bond1.id);
expect(bond.balance).toHaveLength(1);
expect(bond.balance[0]).toEqual({ type: 'aphoton', quantity: '1000000000' });
});
test('Cancel bond.', async () => {
await registry.cancelBond({ id: bond1.id }, privateKey, fee);
const [bond] = await registry.getBondsByIds([bond1.id]);
expect(bond.id).toBe("");
expect(bond.owner).toBe("");
expect(bond.balance).toHaveLength(0);
});
const [bond] = await registry.getBondsByIds([bondId1]);
expect(bond.id).toBe("");
expect(bond.owner).toBe("");
expect(bond.balance).toHaveLength(0);
}); });
test('Associate/Dissociate bond.', async () => { test('Associate/Dissociate bond.', async () => {
let bondId1: string;
bondId1 = await registry.getNextBondId(privateKey); bondId1 = await registry.getNextBondId(privateKey);
expect(bondId1).toBeDefined(); expect(bondId1).toBeDefined();
await registry.createBond({ denom: 'aphoton', amount: '1000000000' }, privateKey, fee); await registry.createBond({ denom: 'aphoton', amount: '1000000000' }, privateKey, fee);
// Create a new record. // Create a new record.
version1 = await publishNewWatcherVersion(bondId1); let watcher = await publishNewWatcherVersion(bondId1);
let [record1] = await registry.queryRecords({ type: watcher.record.type, name: watcher.record.name, version: version1 }, true); let query = { type: watcher.record.type, url: watcher.record.url, version: watcher.record.version };
let [record1] = await registry.queryRecords(query, true);
expect(record1.bondId).toBe(bondId1); expect(record1.bondId).toBe(bondId1);
// Dissociate record, query and confirm. // Dissociate record, query and confirm.
await registry.dissociateBond({ recordId: record1.id }, privateKey, fee); await registry.dissociateBond({ recordId: record1.id }, privateKey, fee);
[record1] = await registry.queryRecords({ type: watcher.record.type, name: watcher.record.name, version: version1 }, true); [record1] = await registry.queryRecords(query, true);
expect(record1.bondId).toBe(''); expect(record1.bondId).toBe('');
// Associate record with bond, query and confirm. // Associate record with bond, query and confirm.
await registry.associateBond({ recordId: record1.id, bondId: bondId1 }, privateKey, fee); await registry.associateBond({ recordId: record1.id, bondId: bondId1 }, privateKey, fee);
[record1] = await registry.queryRecords({ type: watcher.record.type, name: watcher.record.name, version: version1 }, true); [record1] = await registry.queryRecords(query, true);
expect(record1.bondId).toBe(bondId1); expect(record1.bondId).toBe(bondId1);
}); });
test('Reassociate/Dissociate records.', async () => { test('Reassociate/Dissociate records.', async () => {
let bondId1: string;
let bondId2: string;
bondId1 = await registry.getNextBondId(privateKey);
expect(bondId1).toBeDefined();
await registry.createBond({ denom: 'aphoton', amount: '1000000000' }, privateKey, fee);
// Create a new record version. // Create a new record version.
version2 = await publishNewWatcherVersion(bondId1); let watcher = await publishNewWatcherVersion(bondId1);
let queryv1 = { type: watcher.record.type, url: watcher.record.url, version: watcher.record.version };
let queryv2 = { type: watcher.record.type, url: watcher.record.url, version: watcher.record.version };
// Check version1, version2 as associated with bondId1. // Check version1, version2 as associated with bondId1.
let records; let records;
records = await registry.queryRecords({ type: watcher.record.type, name: watcher.record.name, version: version1 }, true); records = await registry.queryRecords(queryv1, true);
expect(records[0].bondId).toBe(bondId1); expect(records[0].bondId).toBe(bondId1);
records = await registry.queryRecords({ type: watcher.record.type, name: watcher.record.name, version: version2 }, true); records = await registry.queryRecords(queryv2, true);
expect(records[0].bondId).toBe(bondId1); expect(records[0].bondId).toBe(bondId1);
// Create another bond. // Create another bond.
@@ -131,16 +147,16 @@ const bondTests = () => {
// Reassociate records from bondId1 to bondId2, verify change. // Reassociate records from bondId1 to bondId2, verify change.
await registry.reassociateRecords({ oldBondId: bondId1, newBondId: bondId2 }, privateKey, fee); await registry.reassociateRecords({ oldBondId: bondId1, newBondId: bondId2 }, privateKey, fee);
records = await registry.queryRecords({ type: watcher.record.type, name: watcher.record.name, version: version1 }, true); records = await registry.queryRecords(queryv1, true);
expect(records[0].bondId).toBe(bondId2); expect(records[0].bondId).toBe(bondId2);
records = await registry.queryRecords({ type: watcher.record.type, name: watcher.record.name, version: version2 }, true); records = await registry.queryRecords(queryv2, true);
expect(records[0].bondId).toBe(bondId2); expect(records[0].bondId).toBe(bondId2);
// Dissociate all records from bond, verify change. // Dissociate all records from bond, verify change.
await registry.dissociateRecords({ bondId: bondId2 }, privateKey, fee); await registry.dissociateRecords({ bondId: bondId2 }, privateKey, fee);
records = await registry.queryRecords({ type: watcher.record.type, name: watcher.record.name, version: version1 }, true); records = await registry.queryRecords(queryv1, true);
expect(records[0].bondId).toBe(''); expect(records[0].bondId).toBe('');
records = await registry.queryRecords({ type: watcher.record.type, name: watcher.record.name, version: version2 }, true); records = await registry.queryRecords(queryv2, true);
expect(records[0].bondId).toBe(''); expect(records[0].bondId).toBe('');
}); });
}; };
+3 -3
View File
@@ -180,9 +180,9 @@ export class Registry {
} }
/** /**
* Publish record. * Publish record.
* @param transactionPrivateKey - private key in HEX to sign transaction. * @param transactionPrivateKey - private key in HEX to sign transaction.
*/ */
async setRecord( async setRecord(
params: { privateKey: string, record: any, bondId: string }, params: { privateKey: string, record: any, bondId: string },
transactionPrivateKey: string, transactionPrivateKey: string,
+245 -184
View File
@@ -7,7 +7,7 @@ import { ensureUpdatedConfig, getConfig } from './testing/helper';
const WATCHER_YML_PATH = path.join(__dirname, './testing/data/watcher.yml'); const WATCHER_YML_PATH = path.join(__dirname, './testing/data/watcher.yml');
jest.setTimeout(120 * 1000); jest.setTimeout(5 * 60 * 1000);
const { chainId, restEndpoint, gqlEndpoint, privateKey, fee } = getConfig(); const { chainId, restEndpoint, gqlEndpoint, privateKey, fee } = getConfig();
@@ -18,21 +18,21 @@ const namingTests = () => {
let watcher: any; let watcher: any;
let watcherId: string; let watcherId: string;
let authorityName: string;
let otherAuthorityName: string;
let otherPrivateKey: string;
let crn: string;
beforeAll(async () => { beforeAll(async () => {
console.log('running parent beforeAll')
registry = new Registry(gqlEndpoint, restEndpoint, chainId); registry = new Registry(gqlEndpoint, restEndpoint, chainId);
console.log('registry = new Registry')
// Create bond. // Create bond.
bondId = await registry.getNextBondId(privateKey); bondId = await registry.getNextBondId(privateKey);
console.log('bondId', bondId)
await registry.createBond({ denom: 'aphoton', amount: '2000000000' }, privateKey, fee); await registry.createBond({ denom: 'aphoton', amount: '2000000000' }, privateKey, fee);
console.log('done registry.createBond')
// Create watcher. // Create watcher.
watcher = await ensureUpdatedConfig(WATCHER_YML_PATH); watcher = await ensureUpdatedConfig(WATCHER_YML_PATH);
console.log('done await ensureUpdatedConfig')
const result = await registry.setRecord( const result = await registry.setRecord(
{ {
privateKey, privateKey,
@@ -44,223 +44,284 @@ const namingTests = () => {
) )
watcherId = result.data.id; watcherId = result.data.id;
console.log('watcherId', watcherId)
console.log('done running parent beforeAll')
}); });
test('Reserve authority.', async () => { describe('Authority tests', () => {
authorityName = `laconic-${Date.now()}`; test('Reserve authority.', async () => {
await registry.reserveAuthority({ name: authorityName }, privateKey, fee); const authorityName = `laconic-${Date.now()}`;
await registry.reserveAuthority({ name: authorityName }, privateKey, fee);
console.log('done Reserve authority')
});
describe('With authority reserved', () => {
let authorityName: string;
let crn: string;
beforeAll(async () => {
console.log('running beforeAll')
authorityName = `laconic-${Date.now()}`;
crn = `crn://${authorityName}/app/test`;
await registry.reserveAuthority({ name: authorityName }, privateKey, fee);
console.log('done running beforeAll')
})
test('Lookup authority.', async () => {
const [record] = await registry.lookupAuthorities([authorityName]);
expect(record).toBeDefined();
expect(record.ownerAddress).not.toBe('');
expect(record.ownerPublicKey).not.toBe('');
expect(Number(record.height)).toBeGreaterThan(0);
console.log('done Lookup authority')
});
test('Lookup non existing authority', async () => {
const [record] = await registry.lookupAuthorities(['does-not-exist']);
expect(record.ownerAddress).toBe('');
expect(record.ownerPublicKey).toBe('');
expect(Number(record.height)).toBe(0);
console.log('done Lookup non existing authority')
});
test('Reserve already reserved authority', async () => {
await expect(registry.reserveAuthority({ name: authorityName }, privateKey, fee)).
rejects.toThrow('Name already reserved.');
console.log('done Reserve already reserved authority')
});
test('Reserve sub-authority.', async () => {
const subAuthority = `echo.${authorityName}`;
await registry.reserveAuthority({ name: subAuthority }, privateKey, fee);
const [record] = await registry.lookupAuthorities([subAuthority]);
expect(record).toBeDefined();
expect(record.ownerAddress).not.toBe('');
expect(record.ownerPublicKey).not.toBe('');
expect(Number(record.height)).toBeGreaterThan(0);
console.log('done Reserve sub-authority')
});
test('Reserve sub-authority with different owner.', async () => {
// Create another account, send tx to set public key on the account.
const mnenonic1 = Account.generateMnemonic();
const otherAccount1 = await Account.generateFromMnemonic(mnenonic1);
await registry.sendCoins({ denom: 'aphoton', amount: '1000000000', destinationAddress: otherAccount1.formattedCosmosAddress }, privateKey, fee);
const mnenonic2 = Account.generateMnemonic();
const otherAccount2 = await Account.generateFromMnemonic(mnenonic2);
await registry.sendCoins({ denom: 'aphoton', amount: '10', destinationAddress: otherAccount2.formattedCosmosAddress }, otherAccount1.getPrivateKey(), fee);
const subAuthority = `halo.${authorityName}`;
await registry.reserveAuthority({ name: subAuthority, owner: otherAccount1.formattedCosmosAddress }, privateKey, fee);
const [record] = await registry.lookupAuthorities([subAuthority]);
expect(record).toBeDefined();
expect(record.ownerAddress).toBeDefined();
expect(record.ownerAddress).toBe(otherAccount1.getCosmosAddress());
expect(record.ownerPublicKey).toBeDefined();
expect(Number(record.height)).toBeGreaterThan(0);
});
test('Set name for unbonded authority', async () => {
assert(watcherId)
await expect(registry.setName({ crn, cid: watcherId }, privateKey, fee)).
rejects.toThrow('Authority bond not found.');
});
test('Set authority bond', async () => {
await registry.setAuthorityBond({ name: authorityName, bondId }, privateKey, fee);
});
});
}); });
test('Lookup authority.', async () => { describe('Naming tests', () => {
const [record] = await registry.lookupAuthorities([authorityName]); let authorityName: string;
let otherAuthorityName: string;
let otherPrivateKey: string;
let otherAccount: Account;
expect(record).toBeDefined(); beforeAll(async () => {
expect(record.ownerAddress).not.toBe(''); authorityName = `laconic-${Date.now()}`;
expect(record.ownerPublicKey).not.toBe('');
expect(Number(record.height)).toBeGreaterThan(0);
});
test('Lookup non existing authority', async () => { await registry.reserveAuthority({ name: authorityName }, privateKey, fee);
const [record] = await registry.lookupAuthorities(['does-not-exist']); await registry.setAuthorityBond({ name: authorityName, bondId }, privateKey, fee);
expect(record.ownerAddress).toBe(''); // Create another account.
expect(record.ownerPublicKey).toBe(''); const mnenonic = Account.generateMnemonic();
expect(Number(record.height)).toBe(0); otherAccount = await Account.generateFromMnemonic(mnenonic);
}); await registry.sendCoins({ denom: 'aphoton', amount: '1000000000', destinationAddress: otherAccount.formattedCosmosAddress }, privateKey, fee);
test('Reserve already reserved authority', async () => { otherAuthorityName = `other-${Date.now()}`;
await expect(registry.reserveAuthority({ name: authorityName }, privateKey, fee)).rejects.toThrow('Name already reserved.'); otherPrivateKey = otherAccount.privateKey.toString('hex');
}); });
test('Reserve sub-authority.', async () => { test('Set name', async () => {
const subAuthority = `echo.${authorityName}`; const crn = `crn://${authorityName}/app/test1`;
await registry.reserveAuthority({ name: subAuthority }, privateKey, fee);
const [record] = await registry.lookupAuthorities([subAuthority]); await registry.setName({ crn, cid: watcherId }, privateKey, fee);
expect(record).toBeDefined();
expect(record.ownerAddress).not.toBe('');
expect(record.ownerPublicKey).not.toBe('');
expect(Number(record.height)).toBeGreaterThan(0);
});
test('Reserve sub-authority with different owner.', async () => { // Query records should return it (some CRN points to it).
// Create another account, send tx to set public key on the account. const [record] = await registry.queryRecords({ type: 'WebsiteRegistrationRecord', version: watcher.record.version });
const mnenonic1 = Account.generateMnemonic(); expect(record).toBeDefined();
const otherAccount1 = await Account.generateFromMnemonic(mnenonic1); expect(record.names).toHaveLength(1);
await registry.sendCoins({ denom: 'aphoton', amount: '1000000000', destinationAddress: otherAccount1.formattedCosmosAddress }, privateKey, fee);
const mnenonic2 = Account.generateMnemonic(); await registry.deleteName({ crn }, privateKey, fee);
const otherAccount2 = await Account.generateFromMnemonic(mnenonic2); });
await registry.sendCoins({ denom: 'aphoton', amount: '10', destinationAddress: otherAccount2.formattedCosmosAddress }, otherAccount1.getPrivateKey(), fee);
const subAuthority = `halo.${authorityName}`; describe('With name set', () => {
await registry.reserveAuthority({ name: subAuthority, owner: otherAccount1.formattedCosmosAddress }, privateKey, fee); let crn: string;
const [record] = await registry.lookupAuthorities([subAuthority]); beforeAll(async () => {
expect(record).toBeDefined(); crn = `crn://${authorityName}/app/test2`;
expect(record.ownerAddress).toBeDefined(); await registry.setName({ crn, cid: watcherId }, privateKey, fee);
expect(record.ownerAddress).toBe(otherAccount1.getCosmosAddress()); });
expect(record.ownerPublicKey).toBeDefined();
expect(Number(record.height)).toBeGreaterThan(0);
});
test('Set name for unbonded authority', async () => { afterAll(async () => {
crn = `crn://${authorityName}/app/test`; await registry.deleteName({ crn }, privateKey, fee);
assert(watcherId) });
await expect(registry.setName({ crn, cid: watcherId }, privateKey, fee)).rejects.toThrow('Authority bond not found.');
});
test('Set authority bond', async () => { test('Lookup name', async () => {
await registry.setAuthorityBond({ name: authorityName, bondId }, privateKey, fee); const records = await registry.lookupNames([crn]);
}); expect(records).toBeDefined();
expect(records).toHaveLength(1);
test('Set name', async () => { const [{ latest, history }] = records;
crn = `crn://${authorityName}/app/test`; expect(latest).toBeDefined();
await registry.setName({ crn, cid: watcherId }, privateKey, fee); expect(latest.id).toBeDefined();
expect(latest.id).toBe(watcherId);
expect(latest.height).toBeDefined();
expect(history).toBeUndefined();
});
// Query records should return it (some CRN points to it). test('Resolve name', async () => {
const records = await registry.queryRecords({ type: 'WebsiteRegistrationRecord', version: watcher.record.version }); const records = await registry.resolveNames([crn]);
expect(records).toBeDefined(); expect(records).toBeDefined();
expect(records).toHaveLength(1); expect(records).toHaveLength(1);
});
test('Lookup name', async () => { const [{ attributes }] = records;
const records = await registry.lookupNames([crn]); expect(attributes).toEqual(watcher.record);
expect(records).toBeDefined(); });
expect(records).toHaveLength(1);
const [{ latest, history }] = records; test('Lookup name with history', async () => {
expect(latest).toBeDefined(); const updatedWatcher = await ensureUpdatedConfig(WATCHER_YML_PATH);
expect(latest.id).toBeDefined(); const result = await registry.setRecord(
expect(latest.id).toBe(watcherId); {
expect(latest.height).toBeDefined(); privateKey,
expect(history).toBeUndefined(); bondId,
}); record: updatedWatcher.record
},
privateKey,
fee
)
test('Resolve name', async () => { const updatedWatcherId = result.data.id;
const records = await registry.resolveNames([crn]); await registry.setName({ crn, cid: updatedWatcherId }, privateKey, fee);
expect(records).toBeDefined();
expect(records).toHaveLength(1);
const [{ attributes }] = records; const records = await registry.lookupNames([crn], true);
expect(attributes).toEqual(watcher.record); expect(records).toHaveLength(1);
});
test('Lookup name with history', async () => { const [{ latest, history }] = records;
const updatedWatcher = await ensureUpdatedConfig(WATCHER_YML_PATH); expect(latest).toBeDefined();
const result = await registry.setRecord( expect(latest.id).toBeDefined();
{ expect(latest.id).toBe(updatedWatcherId);
privateKey, expect(latest.height).toBeDefined();
bondId, expect(history).toBeDefined();
record: updatedWatcher.record expect(history).toHaveLength(1);
},
privateKey,
fee
)
const updatedWatcherId = result.data.id; const [oldRecord] = history;
await registry.setName({ crn, cid: updatedWatcherId }, privateKey, fee); expect(oldRecord).toBeDefined();
expect(oldRecord.id).toBeDefined();
expect(oldRecord.id).toBe(watcherId);
expect(oldRecord.height).toBeDefined();
});
const records = await registry.lookupNames([crn], true); test('Delete name', async () => {
expect(records).toHaveLength(1); await registry.deleteName({ crn }, privateKey, fee);
const [{ latest, history }] = records; let records = await registry.lookupNames([crn], true);
expect(latest).toBeDefined(); expect(records).toBeDefined();
expect(latest.id).toBeDefined(); expect(records).toHaveLength(1);
expect(latest.id).toBe(updatedWatcherId);
expect(latest.height).toBeDefined();
expect(history).toBeDefined();
expect(history).toHaveLength(1);
const [oldRecord] = history; const [{ latest }] = records;
expect(oldRecord).toBeDefined(); expect(latest).toBeDefined();
expect(oldRecord.id).toBeDefined(); expect(latest.id).toBeDefined();
expect(oldRecord.id).toBe(watcherId); expect(latest.id).toBe('');
expect(oldRecord.height).toBeDefined(); expect(latest.height).toBeDefined();
});
test('Set name without reserving authority', async () => { // Query records should NOT return it (no CRN points to it).
await expect(registry.setName({ crn: 'crn://not-reserved/app/test', cid: watcherId }, privateKey, fee)) records = await registry.queryRecords({ type: 'WebsiteRegistrationRecord', version: watcher.record.version });
.rejects.toThrow('Name authority not found.'); expect(records).toBeDefined();
}); expect(records).toHaveLength(0);
test('Set name for non-owned authority', async () => { // Query all records should return it (all: true).
// Create another account. records = await registry.queryRecords({ type: 'WebsiteRegistrationRecord', version: watcher.record.version }, true);
const mnenonic = Account.generateMnemonic(); expect(records).toBeDefined();
const otherAccount = await Account.generateFromMnemonic(mnenonic); expect(records).toHaveLength(1);
await registry.sendCoins({ denom: 'aphoton', amount: '1000000000', destinationAddress: otherAccount.formattedCosmosAddress }, privateKey, fee); });
// Other account reserves an authority. test('Delete already deleted name', async () => {
otherAuthorityName = `other-${Date.now()}`; await registry.deleteName({ crn }, privateKey, fee);
otherPrivateKey = otherAccount.privateKey.toString('hex'); await registry.deleteName({ crn }, privateKey, fee);
await registry.reserveAuthority({ name: otherAuthorityName }, otherPrivateKey, fee);
// Try setting name under other authority. const records = await registry.lookupNames([crn], true);
await expect(registry.setName({ crn: `crn://${otherAuthorityName}/app/test`, cid: watcherId }, privateKey, fee)).rejects.toThrow('Access denied.'); expect(records).toBeDefined();
}); expect(records).toHaveLength(1);
test('Lookup non existing name', async () => { const [{ latest }] = records;
const records = await registry.lookupNames(['crn://not-reserved/app/test']); expect(latest).toBeDefined();
expect(records).toBeDefined(); expect(latest.id).toBeDefined();
expect(records).toHaveLength(1); expect(latest.id).toBe('');
const [record] = records; expect(latest.height).toBeDefined();
expect(record).toBeNull(); });
}); });
test('Resolve non existing name', async () => { test('Set name without reserving authority', async () => {
const records = await registry.resolveNames(['crn://not-reserved/app/test']); await expect(registry.setName({ crn: 'crn://not-reserved/app/test', cid: watcherId }, privateKey, fee))
expect(records).toBeDefined(); .rejects.toThrow('Name authority not found.');
expect(records).toHaveLength(1); });
const [record] = records;
expect(record).toBeNull();
});
test('Delete name', async () => { test('Set name for non-owned authority', async () => {
await registry.deleteName({ crn }, privateKey, fee); await registry.sendCoins({ denom: 'aphoton', amount: '1000000000', destinationAddress: otherAccount.formattedCosmosAddress }, privateKey, fee);
let records = await registry.lookupNames([crn], true); // Other account reserves an authority.
expect(records).toBeDefined(); await registry.reserveAuthority({ name: otherAuthorityName }, otherPrivateKey, fee);
expect(records).toHaveLength(1);
const [{ latest }] = records; // Try setting name under other authority.
expect(latest).toBeDefined(); await expect(registry.setName({ crn: `crn://${otherAuthorityName}/app/test`, cid: watcherId }, privateKey, fee)).rejects.toThrow('Access denied.');
expect(latest.id).toBeDefined(); });
expect(latest.id).toBe('');
expect(latest.height).toBeDefined();
// Query records should NOT return it (no CRN points to it). test('Delete name for non-owned authority.', async () => {
records = await registry.queryRecords({ type: 'WebsiteRegistrationRecord', version: watcher.record.version }); const otherBondId = await registry.getNextBondId(otherPrivateKey);
expect(records).toBeDefined(); await registry.createBond({ denom: 'aphoton', amount: '10000' }, otherPrivateKey, fee);
expect(records).toHaveLength(0); await registry.setAuthorityBond({ name: otherAuthorityName, bondId: otherBondId }, otherPrivateKey, fee);
await registry.setName({ crn: `crn://${otherAuthorityName}/app/test`, cid: watcherId }, otherPrivateKey, fee);
// Query all records should return it (all: true). // Try deleting name under other authority.
records = await registry.queryRecords({ type: 'WebsiteRegistrationRecord', version: watcher.record.version }, true); await expect(registry.deleteName({ crn: `crn://${otherAuthorityName}/app/test` }, privateKey, fee)).rejects.toThrow('Access denied.');
expect(records).toBeDefined(); });
expect(records).toHaveLength(1);
});
test('Delete already deleted name', async () => { test('Lookup non existing name', async () => {
await registry.deleteName({ crn }, privateKey, fee); const records = await registry.lookupNames(['crn://not-reserved/app/test']);
expect(records).toBeDefined();
expect(records).toHaveLength(1);
const [record] = records;
expect(record).toBeNull();
});
const records = await registry.lookupNames([crn], true); test('Resolve non existing name', async () => {
expect(records).toBeDefined(); const records = await registry.resolveNames(['crn://not-reserved/app/test']);
expect(records).toHaveLength(1); expect(records).toBeDefined();
expect(records).toHaveLength(1);
const [{ latest }] = records; const [record] = records;
expect(latest).toBeDefined(); expect(record).toBeNull();
expect(latest.id).toBeDefined(); });
expect(latest.id).toBe('');
expect(latest.height).toBeDefined();
});
test('Delete name for non-owned authority.', async () => {
const otherBondId = await registry.getNextBondId(otherPrivateKey);
await registry.createBond({ denom: 'aphoton', amount: '10000' }, otherPrivateKey, fee);
await registry.setAuthorityBond({ name: otherAuthorityName, bondId: otherBondId }, otherPrivateKey, fee);
await registry.setName({ crn: `crn://${otherAuthorityName}/app/test`, cid: watcherId }, otherPrivateKey, fee);
// Try deleting name under other authority.
await expect(registry.deleteName({ crn: `crn://${otherAuthorityName}/app/test` }, privateKey, fee)).rejects.toThrow('Access denied.');
}); });
}; };
@@ -2,7 +2,7 @@
/* eslint-disable */ /* eslint-disable */
/** /**
* Generated by the protoc-gen-ts. DO NOT EDIT! * Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 4.24.4 * compiler version: 4.25.1
* source: cosmos/base/query/v1beta1/pagination.proto * source: cosmos/base/query/v1beta1/pagination.proto
* git: https://github.com/thesayyn/protoc-gen-ts */ * git: https://github.com/thesayyn/protoc-gen-ts */
import * as pb_1 from "google-protobuf"; import * as pb_1 from "google-protobuf";
+1 -1
View File
@@ -2,7 +2,7 @@
/* eslint-disable */ /* eslint-disable */
/** /**
* Generated by the protoc-gen-ts. DO NOT EDIT! * Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 4.24.4 * compiler version: 4.25.1
* source: cosmos/base/v1beta1/coin.proto * source: cosmos/base/v1beta1/coin.proto
* git: https://github.com/thesayyn/protoc-gen-ts */ * git: https://github.com/thesayyn/protoc-gen-ts */
import * as dependency_1 from "./../../../gogoproto/gogo"; import * as dependency_1 from "./../../../gogoproto/gogo";
+1 -1
View File
@@ -2,7 +2,7 @@
/* eslint-disable */ /* eslint-disable */
/** /**
* Generated by the protoc-gen-ts. DO NOT EDIT! * Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 4.24.4 * compiler version: 4.25.1
* source: gogoproto/gogo.proto * source: gogoproto/gogo.proto
* git: https://github.com/thesayyn/protoc-gen-ts */ * git: https://github.com/thesayyn/protoc-gen-ts */
import * as dependency_1 from "./../google/protobuf/descriptor"; import * as dependency_1 from "./../google/protobuf/descriptor";
+1 -1
View File
@@ -2,7 +2,7 @@
/* eslint-disable */ /* eslint-disable */
/** /**
* Generated by the protoc-gen-ts. DO NOT EDIT! * Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 4.24.4 * compiler version: 4.25.1
* source: google/api/annotations.proto * source: google/api/annotations.proto
* git: https://github.com/thesayyn/protoc-gen-ts */ * git: https://github.com/thesayyn/protoc-gen-ts */
import * as dependency_1 from "./http"; import * as dependency_1 from "./http";
+1 -1
View File
@@ -2,7 +2,7 @@
/* eslint-disable */ /* eslint-disable */
/** /**
* Generated by the protoc-gen-ts. DO NOT EDIT! * Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 4.24.4 * compiler version: 4.25.1
* source: google/api/http.proto * source: google/api/http.proto
* git: https://github.com/thesayyn/protoc-gen-ts */ * git: https://github.com/thesayyn/protoc-gen-ts */
import * as pb_1 from "google-protobuf"; import * as pb_1 from "google-protobuf";
+1 -1
View File
@@ -2,7 +2,7 @@
/* eslint-disable */ /* eslint-disable */
/** /**
* Generated by the protoc-gen-ts. DO NOT EDIT! * Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 4.24.4 * compiler version: 4.25.1
* source: google/protobuf/descriptor.proto * source: google/protobuf/descriptor.proto
* git: https://github.com/thesayyn/protoc-gen-ts */ * git: https://github.com/thesayyn/protoc-gen-ts */
import * as pb_1 from "google-protobuf"; import * as pb_1 from "google-protobuf";
+1 -1
View File
@@ -2,7 +2,7 @@
/* eslint-disable */ /* eslint-disable */
/** /**
* Generated by the protoc-gen-ts. DO NOT EDIT! * Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 4.24.4 * compiler version: 4.25.1
* source: google/protobuf/duration.proto * source: google/protobuf/duration.proto
* git: https://github.com/thesayyn/protoc-gen-ts */ * git: https://github.com/thesayyn/protoc-gen-ts */
import * as pb_1 from "google-protobuf"; import * as pb_1 from "google-protobuf";
+1 -1
View File
@@ -2,7 +2,7 @@
/* eslint-disable */ /* eslint-disable */
/** /**
* Generated by the protoc-gen-ts. DO NOT EDIT! * Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 4.24.4 * compiler version: 4.25.1
* source: google/protobuf/timestamp.proto * source: google/protobuf/timestamp.proto
* git: https://github.com/thesayyn/protoc-gen-ts */ * git: https://github.com/thesayyn/protoc-gen-ts */
import * as pb_1 from "google-protobuf"; import * as pb_1 from "google-protobuf";
@@ -2,7 +2,7 @@
/* eslint-disable */ /* eslint-disable */
/** /**
* Generated by the protoc-gen-ts. DO NOT EDIT! * Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 4.24.4 * compiler version: 4.25.1
* source: vulcanize/auction/v1beta1/genesis.proto * source: vulcanize/auction/v1beta1/genesis.proto
* git: https://github.com/thesayyn/protoc-gen-ts */ * git: https://github.com/thesayyn/protoc-gen-ts */
import * as dependency_1 from "./../../../gogoproto/gogo"; import * as dependency_1 from "./../../../gogoproto/gogo";
+1 -1
View File
@@ -2,7 +2,7 @@
/* eslint-disable */ /* eslint-disable */
/** /**
* Generated by the protoc-gen-ts. DO NOT EDIT! * Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 4.24.4 * compiler version: 4.25.1
* source: vulcanize/auction/v1beta1/query.proto * source: vulcanize/auction/v1beta1/query.proto
* git: https://github.com/thesayyn/protoc-gen-ts */ * git: https://github.com/thesayyn/protoc-gen-ts */
import * as dependency_1 from "./../../../gogoproto/gogo"; import * as dependency_1 from "./../../../gogoproto/gogo";
+1 -1
View File
@@ -2,7 +2,7 @@
/* eslint-disable */ /* eslint-disable */
/** /**
* Generated by the protoc-gen-ts. DO NOT EDIT! * Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 4.24.4 * compiler version: 4.25.1
* source: vulcanize/auction/v1beta1/tx.proto * source: vulcanize/auction/v1beta1/tx.proto
* git: https://github.com/thesayyn/protoc-gen-ts */ * git: https://github.com/thesayyn/protoc-gen-ts */
import * as dependency_1 from "./../../../gogoproto/gogo"; import * as dependency_1 from "./../../../gogoproto/gogo";
+1 -1
View File
@@ -2,7 +2,7 @@
/* eslint-disable */ /* eslint-disable */
/** /**
* Generated by the protoc-gen-ts. DO NOT EDIT! * Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 4.24.4 * compiler version: 4.25.1
* source: vulcanize/auction/v1beta1/types.proto * source: vulcanize/auction/v1beta1/types.proto
* git: https://github.com/thesayyn/protoc-gen-ts */ * git: https://github.com/thesayyn/protoc-gen-ts */
import * as dependency_1 from "./../../../gogoproto/gogo"; import * as dependency_1 from "./../../../gogoproto/gogo";
+1 -1
View File
@@ -2,7 +2,7 @@
/* eslint-disable */ /* eslint-disable */
/** /**
* Generated by the protoc-gen-ts. DO NOT EDIT! * Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 4.24.4 * compiler version: 4.25.1
* source: vulcanize/bond/v1beta1/bond.proto * source: vulcanize/bond/v1beta1/bond.proto
* git: https://github.com/thesayyn/protoc-gen-ts */ * git: https://github.com/thesayyn/protoc-gen-ts */
import * as dependency_1 from "./../../../gogoproto/gogo"; import * as dependency_1 from "./../../../gogoproto/gogo";
+1 -1
View File
@@ -2,7 +2,7 @@
/* eslint-disable */ /* eslint-disable */
/** /**
* Generated by the protoc-gen-ts. DO NOT EDIT! * Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 4.24.4 * compiler version: 4.25.1
* source: vulcanize/bond/v1beta1/genesis.proto * source: vulcanize/bond/v1beta1/genesis.proto
* git: https://github.com/thesayyn/protoc-gen-ts */ * git: https://github.com/thesayyn/protoc-gen-ts */
import * as dependency_1 from "./../../../gogoproto/gogo"; import * as dependency_1 from "./../../../gogoproto/gogo";
+1 -1
View File
@@ -2,7 +2,7 @@
/* eslint-disable */ /* eslint-disable */
/** /**
* Generated by the protoc-gen-ts. DO NOT EDIT! * Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 4.24.4 * compiler version: 4.25.1
* source: vulcanize/bond/v1beta1/query.proto * source: vulcanize/bond/v1beta1/query.proto
* git: https://github.com/thesayyn/protoc-gen-ts */ * git: https://github.com/thesayyn/protoc-gen-ts */
import * as dependency_1 from "./../../../gogoproto/gogo"; import * as dependency_1 from "./../../../gogoproto/gogo";
+1 -1
View File
@@ -2,7 +2,7 @@
/* eslint-disable */ /* eslint-disable */
/** /**
* Generated by the protoc-gen-ts. DO NOT EDIT! * Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 4.24.4 * compiler version: 4.25.1
* source: vulcanize/bond/v1beta1/tx.proto * source: vulcanize/bond/v1beta1/tx.proto
* git: https://github.com/thesayyn/protoc-gen-ts */ * git: https://github.com/thesayyn/protoc-gen-ts */
import * as dependency_1 from "./../../../gogoproto/gogo"; import * as dependency_1 from "./../../../gogoproto/gogo";
@@ -2,7 +2,7 @@
/* eslint-disable */ /* eslint-disable */
/** /**
* Generated by the protoc-gen-ts. DO NOT EDIT! * Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 4.24.4 * compiler version: 4.25.1
* source: vulcanize/registry/v1beta1/genesis.proto * source: vulcanize/registry/v1beta1/genesis.proto
* git: https://github.com/thesayyn/protoc-gen-ts */ * git: https://github.com/thesayyn/protoc-gen-ts */
import * as dependency_1 from "./../../../gogoproto/gogo"; import * as dependency_1 from "./../../../gogoproto/gogo";
@@ -2,7 +2,7 @@
/* eslint-disable */ /* eslint-disable */
/** /**
* Generated by the protoc-gen-ts. DO NOT EDIT! * Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 4.24.4 * compiler version: 4.25.1
* source: vulcanize/registry/v1beta1/query.proto * source: vulcanize/registry/v1beta1/query.proto
* git: https://github.com/thesayyn/protoc-gen-ts */ * git: https://github.com/thesayyn/protoc-gen-ts */
import * as dependency_1 from "./registry"; import * as dependency_1 from "./registry";
@@ -2,7 +2,7 @@
/* eslint-disable */ /* eslint-disable */
/** /**
* Generated by the protoc-gen-ts. DO NOT EDIT! * Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 4.24.4 * compiler version: 4.25.1
* source: vulcanize/registry/v1beta1/registry.proto * source: vulcanize/registry/v1beta1/registry.proto
* git: https://github.com/thesayyn/protoc-gen-ts */ * git: https://github.com/thesayyn/protoc-gen-ts */
import * as dependency_1 from "./../../../google/protobuf/duration"; import * as dependency_1 from "./../../../google/protobuf/duration";
+1 -1
View File
@@ -2,7 +2,7 @@
/* eslint-disable */ /* eslint-disable */
/** /**
* Generated by the protoc-gen-ts. DO NOT EDIT! * Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 4.24.4 * compiler version: 4.25.1
* source: vulcanize/registry/v1beta1/tx.proto * source: vulcanize/registry/v1beta1/tx.proto
* git: https://github.com/thesayyn/protoc-gen-ts */ * git: https://github.com/thesayyn/protoc-gen-ts */
import * as dependency_1 from "./../../../gogoproto/gogo"; import * as dependency_1 from "./../../../gogoproto/gogo";
+10 -1
View File
@@ -16,7 +16,16 @@ const attributeField = `
... on StringValue { string: value } ... on StringValue { string: value }
... on BytesValue { bytes: value } ... on BytesValue { bytes: value }
... on LinkValue { link: value } ... on LinkValue { link: value }
... on ArrayValue { array: value { __typename } } ... on ArrayValue {
array: value {
... on BooleanValue { bool: value }
... on IntValue { int: value }
... on FloatValue { float: value }
... on StringValue { string: value }
... on BytesValue { bytes: value }
... on LinkValue { link: value }
}
}
... on MapValue { map: value { key mapping: value { __typename } } } ... on MapValue { map: value { key mapping: value { __typename } } }
} }
} }
+1 -1
View File
@@ -55,7 +55,7 @@ describe('Querying', () => {
test('Query records by attributes.', async () => { test('Query records by attributes.', async () => {
const { version, url } = watcher.record; const { version, url } = watcher.record;
const records = await registry.queryRecords({ version, url }, true); const records = await registry.queryRecords({ version, url, type: undefined }, true);
expect(records.length).toBe(1); expect(records.length).toBe(1);
[ watcher ] = records; [ watcher ] = records;
+16 -1
View File
@@ -35,7 +35,11 @@ export class Util {
static toGQLAttributes(obj: any) { static toGQLAttributes(obj: any) {
const vars: any[] = []; const vars: any[] = [];
Object.keys(obj).forEach(key => { Object.keys(obj).forEach(key => {
vars.push({ key, value: this.toGQLValue(obj[key]) }); const value = this.toGQLValue(obj[key]);
if (value !== undefined) {
vars.push({ key, value });
}
}); });
return vars; return vars;
} }
@@ -61,6 +65,8 @@ export class Util {
return { 'array': obj }; return { 'array': obj };
} }
return { 'map': obj }; return { 'map': obj };
case 'undefined':
return undefined;
default: default:
throw new Error(`Unknown object type '${type}': ${obj}`); throw new Error(`Unknown object type '${type}': ${obj}`);
} }
@@ -80,10 +86,19 @@ export class Util {
} }
static fromGQLValue(obj: any) { static fromGQLValue(obj: any) {
// Get first non-null key
const present = Object.keys(obj).find(k => obj[k] !== null); const present = Object.keys(obj).find(k => obj[k] !== null);
if (present === undefined) { if (present === undefined) {
throw new Error('Object has no non-null values'); throw new Error('Object has no non-null values');
} }
// Create an array if array type attribute
if (present === 'array') {
return obj[present].map((e: any) => {
return this.fromGQLValue(e);
});
}
return obj[present]; return obj[present];
} }
+4 -4
View File
@@ -3093,10 +3093,10 @@ protobufjs@~6.11.2:
"@types/node" ">=13.7.0" "@types/node" ">=13.7.0"
long "^4.0.0" long "^4.0.0"
protoc-gen-ts@^0.8.5: protoc-gen-ts@^0.8.7:
version "0.8.6" version "0.8.7"
resolved "https://registry.yarnpkg.com/protoc-gen-ts/-/protoc-gen-ts-0.8.6.tgz#e789a6fc3fbe09bdc119acecc349b9554ec5940e" resolved "https://registry.yarnpkg.com/protoc-gen-ts/-/protoc-gen-ts-0.8.7.tgz#63e4d9af2ad30b753acf6f739323d01fc9f80b52"
integrity sha512-66oeorGy4QBvYjQGd/gaeOYyFqKyRmRgTpofmnw8buMG0P7A0jQjoKSvKJz5h5tNUaVkIzvGBUTRVGakrhhwpA== integrity sha512-jr4VJey2J9LVYCV7EVyVe53g1VMw28cCmYJhBe5e3YX5wiyiDwgxWxeDf9oTqAe4P1bN/YGAkW2jhlH8LohwiQ==
pure-rand@^6.0.0: pure-rand@^6.0.0:
version "6.0.3" version "6.0.3"