Skip to content

Commit

Permalink
test(a3p): stake-bld
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Mar 15, 2024
1 parent 792d0b5 commit 50e8da4
Show file tree
Hide file tree
Showing 6 changed files with 2,325 additions and 0 deletions.
1 change: 1 addition & 0 deletions a3p-integration/proposals/c:stake-bld/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
5 changes: 5 additions & 0 deletions a3p-integration/proposals/c:stake-bld/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CoreEvalProposal to install stakeBld contract

The `submission` for the proposal is automatically generated during `yarn build`
in `a3p-integration` using the code in agoric-sdk through
`script/generate-a3p-submissions.sh`. and `script/generate-a3p-submission.sh`
19 changes: 19 additions & 0 deletions a3p-integration/proposals/c:stake-bld/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"agoricProposal": {
"type": "/agoric.swingset.CoreEvalProposal",
"source": "subdir",
"sdk-generate": [
"orchestration/init-stakeBld.js"
]
},
"type": "module",
"license": "Apache-2.0",
"dependencies": {
"@agoric/synthetic-chain": "^0.0.7",
"ava": "^5.3.1"
},
"ava": {
"concurrency": 1
},
"packageManager": "yarn@4.1.0"
}
27 changes: 27 additions & 0 deletions a3p-integration/proposals/c:stake-bld/stakeBld.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import test from 'ava';

import { agd, waitForBlock } from '@agoric/synthetic-chain';

const readPublished = async path => {
const { value } = await agd.query(
'vstorage',
'data',
'--output',
'json',
`published.${path}`,
);
if (value === '') {
return undefined;
}
const obj = JSON.parse(value);
return obj.values[0];
};

test(`vstorage`, async t => {
const nodePath = 'stakeBld';
const nodeValue = JSON.stringify({ success: true });

await waitForBlock(2); // enough time for core eval to execute ?

t.is(await readPublished(nodePath), nodeValue);
});
4 changes: 4 additions & 0 deletions a3p-integration/proposals/c:stake-bld/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
source /usr/src/upgrade-test-scripts/env_setup.sh

yarn ava
Loading

0 comments on commit 50e8da4

Please sign in to comment.