Skip to content

Commit

Permalink
Restore a3p tests (#9557)
Browse files Browse the repository at this point in the history
closes: #9553

## Description
Restores tests deleted in #9481 and fixes a bug in localchain introduced since

### Security Considerations
None

### Scaling Considerations
None

### Documentation Considerations
None

### Testing Considerations
Restoring integration tests

### Upgrade Considerations
Needed for upgrade 16
  • Loading branch information
mergify[bot] authored and mhofman committed Jun 22, 2024
2 parents dd1a7db + 59f2de0 commit 478af2f
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions packages/vats/src/localchain.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { AmountShape, BrandShape, PaymentShape } from '@agoric/ertp';
import { Shape as NetworkShape } from '@agoric/network';

const { Fail } = assert;
const { Vow$ } = NetworkShape;

/**
* @import {TypedJson, ResponseTo, JsonSafe} from '@agoric/cosmic-proto';
Expand Down Expand Up @@ -45,15 +46,17 @@ const { Fail } = assert;
*/

export const LocalChainAccountI = M.interface('LocalChainAccount', {
getAddress: M.callWhen().returns(M.string()),
getBalance: M.callWhen(BrandShape).returns(AmountShape),
getAddress: M.callWhen().returns(Vow$(M.string())),
getBalance: M.callWhen(BrandShape).returns(Vow$(AmountShape)),
deposit: M.callWhen(PaymentShape)
.optional(M.pattern())
.returns(NetworkShape.Vow$(AmountShape)),
withdraw: M.callWhen(AmountShape).returns(PaymentShape),
executeTx: M.callWhen(M.arrayOf(M.record())).returns(M.arrayOf(M.record())),
.returns(Vow$(AmountShape)),
withdraw: M.callWhen(AmountShape).returns(Vow$(PaymentShape)),
executeTx: M.callWhen(M.arrayOf(M.record())).returns(
Vow$(M.arrayOf(M.record())),
),
monitorTransfers: M.callWhen(M.remotable('TransferTap')).returns(
M.remotable('TargetRegistration'),
Vow$(M.remotable('TargetRegistration')),
),
});

Expand Down Expand Up @@ -192,9 +195,11 @@ export const prepareLocalChainAccountKit = (zone, { watch }) =>
/** @typedef {LocalChainAccountKit['account']} LocalChainAccount */

export const LocalChainI = M.interface('LocalChain', {
makeAccount: M.callWhen().returns(M.remotable('LocalChainAccount')),
query: M.callWhen(M.record()).returns(M.record()),
queryMany: M.callWhen(M.arrayOf(M.record())).returns(M.arrayOf(M.record())),
makeAccount: M.callWhen().returns(Vow$(M.remotable('LocalChainAccount'))),
query: M.callWhen(M.record()).returns(Vow$(M.record())),
queryMany: M.callWhen(M.arrayOf(M.record())).returns(
Vow$(M.arrayOf(M.record())),
),
});

/**
Expand Down

0 comments on commit 478af2f

Please sign in to comment.