Skip to content

Commit

Permalink
feat(guard): tighten roundsManager
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg authored and anilhelvaci committed Feb 16, 2024
1 parent b80938f commit ef42d20
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions packages/inter-protocol/src/price/roundsManager.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Fail, q } from '@agoric/assert';
import { AmountMath } from '@agoric/ertp';
import { makeTracer } from '@agoric/internal';
import { TimeMath } from '@agoric/time';
import { TimeMath, TimestampShape } from '@agoric/time';
import { M, makeScalarBigMapStore, prepareExoClassKit } from '@agoric/vat-data';
import {
calculateMedian,
Expand Down Expand Up @@ -98,21 +98,25 @@ export const prepareRoundsManagerKit = baggage =>
'RoundsManager',
{
helper: UnguardedHelperI,
contract: M.interface(
'contract',
{
authenticateQuote: M.call().rest(M.any()).returns(M.any()),
makeCreateQuote: M.call().rest(M.any()).returns(M.any()),
eligibleForSpecificRound: M.call().rest(M.any()).returns(M.boolean()),
getRoundData: M.call().rest(M.any()).returns(M.promise()),
getRoundStatus: M.call().rest(M.any()).returns(M.record()),
oracleRoundStateSuggestRound: M.call()
.rest(M.any())
.returns(M.record()),
},
// TODO(6571) stop sloppy
{ sloppy: true },
),
contract: M.interface('contract', {
authenticateQuote: M.call([M.record()]).returns(M.any()),
makeCreateQuote: M.call()
.optional({
overrideValueOut: M.number(),
timestamp: TimestampShape,
})
.returns(M.any()),
eligibleForSpecificRound: M.call(
M.any(),
M.bigint(),
TimestampShape,
).returns(M.boolean()),
getRoundData: M.call(M.any()).returns(M.promise()),
getRoundStatus: M.call(M.bigint()).returns(M.record()),
oracleRoundStateSuggestRound: M.call(M.any(), TimestampShape).returns(
M.record(),
),
}),
oracle: M.interface('oracle', {
handlePush: M.call(M.record(), M.record()).returns(M.promise()),
}),
Expand Down

0 comments on commit ef42d20

Please sign in to comment.