Skip to content

Commit

Permalink
chore(acceptance): support long living bids, improve robustness again…
Browse files Browse the repository at this point in the history
…st time related complexities
  • Loading branch information
anilhelvaci committed Oct 5, 2024
1 parent a2f0229 commit b29d36e
Show file tree
Hide file tree
Showing 10 changed files with 487 additions and 127 deletions.
2 changes: 1 addition & 1 deletion a3p-integration/proposals/n:upgrade-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"type": "module",
"license": "Apache-2.0",
"dependencies": {
"@agoric/synthetic-chain": "^0.1.0",
"@agoric/synthetic-chain": "^0.2.1",
"ava": "^5.3.1"
},
"ava": {
Expand Down
40 changes: 40 additions & 0 deletions a3p-integration/proposals/n:upgrade-next/performAction.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env node

import {
GOV1ADDR,
CHAINID,
agd,
agopsInter,
addUser,
waitForBlock,
provisionSmartWallet,
ATOM_DENOM,
} from '@agoric/synthetic-chain';

export const bankSend = (from, addr, wanted) => {
const chain = ['--chain-id', CHAINID];
const fromArg = ['--from', from];
const testKeyring = ['--keyring-backend', 'test'];
const noise = [...fromArg, ...chain, ...testKeyring, '--yes'];

return agd.tx('bank', 'send', from, addr, wanted, ...noise);
};

const bidder = await addUser('long-living-bidder');
console.log('BIDDDER', bidder);
await bankSend(GOV1ADDR, bidder, `80000000uist`);
console.log('IST sent');
await provisionSmartWallet(bidder, `20000000ubld,100000000${ATOM_DENOM}`);
console.log('Provision sent');
await waitForBlock(3);
console.log('Wait For Block done. Sending bid offer');
agopsInter(
'bid',
'by-price',
`--price 49.0`,
`--give 80IST`,
'--from',
bidder,
'--keyring-backend test',
`--offer-id long-living-bid-for-acceptance`,
);
3 changes: 2 additions & 1 deletion a3p-integration/proposals/n:upgrade-next/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"allowJs": true,
"checkJs": true,
"strict": false,
Expand Down
8 changes: 8 additions & 0 deletions a3p-integration/proposals/n:upgrade-next/use.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

# Exit when any command fails
set -e

source /usr/src/upgrade-test-scripts/env_setup.sh

./performAction.js
38 changes: 23 additions & 15 deletions a3p-integration/proposals/n:upgrade-next/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,25 @@ __metadata:
version: 8
cacheKey: 10c0

"@agoric/synthetic-chain@npm:^0.1.0":
version: 0.1.0
resolution: "@agoric/synthetic-chain@npm:0.1.0"
"@agoric/synthetic-chain@npm:^0.2.1":
version: 0.2.1
resolution: "@agoric/synthetic-chain@npm:0.2.1"
dependencies:
"@endo/zip": "npm:^1.0.1"
better-sqlite3: "npm:^9.4.0"
"@endo/zip": "npm:^1.0.6"
better-sqlite3: "npm:^9.6.0"
chalk: "npm:^5.3.0"
cosmjs-types: "npm:^0.9.0"
execa: "npm:^8.0.1"
bin:
synthetic-chain: dist/cli/cli.js
checksum: 10c0/8305293d085cde9cbf94670134216e06337c5624c45faf5dfebb86762042abe7b4340cf3205e671dfce54e888bd4e9b3428400756833fa06f2bbb21b44668c44
checksum: 10c0/ca3bfe968d0f157b4fdad3cc7e234c0d38f2eb8cc55ce4cb0a82f02a5371ef49d534fec05be6ef769cb166d0da278fb3e900b5882d08410008c2bb5e7e719de3
languageName: node
linkType: hard

"@endo/zip@npm:^1.0.1":
version: 1.0.1
resolution: "@endo/zip@npm:1.0.1"
checksum: 10c0/1074bdc10287f4c94b3423e130da88f9c6ba09c999483c1164b3eed061350a060d2dbe377cfa3b8d4a86b3f1c3aed5cbf0cdd78ee2bf2cb9b837caa2ebbf712f
"@endo/zip@npm:^1.0.6":
version: 1.0.7
resolution: "@endo/zip@npm:1.0.7"
checksum: 10c0/a1c0d155448ce877012b34c8fe8cd3a58de9eb807514c81cddeebb802ee8e552b27d8a9a40fab3f3e4c49e0cb7fea6902fa1dd12a23ff6f30b56161fc3edc1f8
languageName: node
linkType: hard

Expand Down Expand Up @@ -290,14 +291,14 @@ __metadata:
languageName: node
linkType: hard

"better-sqlite3@npm:^9.4.0":
version: 9.4.0
resolution: "better-sqlite3@npm:9.4.0"
"better-sqlite3@npm:^9.6.0":
version: 9.6.0
resolution: "better-sqlite3@npm:9.6.0"
dependencies:
bindings: "npm:^1.5.0"
node-gyp: "npm:latest"
prebuild-install: "npm:^7.1.1"
checksum: 10c0/42b2edfa46d62763514b87122245a3513a5ff20f05fef4fb49fec33f3de0a51a29025596178f57c634b8013f16bbdf8169a308fb3e3b8d126d715788d72d1e74
checksum: 10c0/8db9b38f414e26a56d4c40fc16e94a253118491dae0e2c054338a9e470f1a883c7eb4cb330f2f5737db30f704d4f2e697c59071ca04e03364ee9fe04375aa9c8
languageName: node
linkType: hard

Expand Down Expand Up @@ -559,6 +560,13 @@ __metadata:
languageName: node
linkType: hard

"cosmjs-types@npm:^0.9.0":
version: 0.9.0
resolution: "cosmjs-types@npm:0.9.0"
checksum: 10c0/bc20f4293fb34629d7c5f96bafe533987f753df957ff68eb078d0128ae5a418320cb945024441769a07bb9bc5dde9d22b972fd40d485933e5706ea191c43727b
languageName: node
linkType: hard

"cross-spawn@npm:^7.0.0, cross-spawn@npm:^7.0.3":
version: 7.0.3
resolution: "cross-spawn@npm:7.0.3"
Expand Down Expand Up @@ -1820,7 +1828,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "root-workspace-0b6124@workspace:."
dependencies:
"@agoric/synthetic-chain": "npm:^0.1.0"
"@agoric/synthetic-chain": "npm:^0.2.1"
ava: "npm:^5.3.1"
languageName: unknown
linkType: soft
Expand Down
Loading

0 comments on commit b29d36e

Please sign in to comment.