Skip to content

Commit ce1a17a

Browse files
committed
feat: reference custom proto Msg builder in contract
1 parent 0908ca5 commit ce1a17a

File tree

4 files changed

+31
-2
lines changed

4 files changed

+31
-2
lines changed

.github/workflows/pr.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jobs:
1111
- uses: actions/setup-node@v4
1212
- run: corepack enable
1313
- run: yarn install
14+
- run: yarn build
1415
- run: yarn lint
1516
unit:
1617
runs-on: ubuntu-latest

contract/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@
8282
"@endo/far": "^1.1.4",
8383
"@endo/init": "^1.1.3",
8484
"@endo/marshal": "^1.5.2",
85-
"@endo/patterns": "^1.4.2"
85+
"@endo/patterns": "^1.4.2",
86+
"dapp-agoric-orca-proto": "workspace:*"
8687
},
8788
"ava": {
8889
"extensions": {

contract/test/custom-proto.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { test } from './prepare-test-env-ava.js';
2+
import { MsgCreateThought } from '../../protos/dist/cyber/dmn/v1beta1/tx.js';
3+
4+
test('custom proto', t => {
5+
const msg = MsgCreateThought.toProtoMsg({
6+
name: 'test',
7+
particle: 'test',
8+
program: 'test',
9+
trigger: {
10+
block: 1n,
11+
period: 1n,
12+
},
13+
load: {
14+
gasPrice: {
15+
denom: 'ubld',
16+
amount: '1',
17+
},
18+
input: 'test',
19+
},
20+
});
21+
22+
t.like(msg, {
23+
typeUrl: '/cyber.dmn.v1beta1.MsgCreateThought',
24+
});
25+
t.true(msg.value instanceof Uint8Array);
26+
});

yarn.lock

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13242,6 +13242,7 @@ __metadata:
1324213242
"@typescript-eslint/parser": "npm:^7.15.0"
1324313243
agoric: "npm:^0.22.0-u17.1"
1324413244
ava: "npm:^5.3.1"
13245+
dapp-agoric-orca-proto: "workspace:*"
1324513246
eslint: "npm:^8.57.0"
1324613247
eslint-config-airbnb-base: "npm:^15.0.0"
1324713248
eslint-config-jessie: "npm:^0.0.6"
@@ -13265,7 +13266,7 @@ __metadata:
1326513266
languageName: unknown
1326613267
linkType: soft
1326713268

13268-
"dapp-agoric-orca-proto@workspace:protos":
13269+
"dapp-agoric-orca-proto@workspace:*, dapp-agoric-orca-proto@workspace:protos":
1326913270
version: 0.0.0-use.local
1327013271
resolution: "dapp-agoric-orca-proto@workspace:protos"
1327113272
dependencies:

0 commit comments

Comments
 (0)