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 8, 2024
1 parent fe63b3b commit fbc8fd6
Show file tree
Hide file tree
Showing 8 changed files with 493 additions and 111 deletions.
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
Loading

0 comments on commit fbc8fd6

Please sign in to comment.