Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Jan 11, 2023
1 parent fc9ae6a commit 8b681f3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
17 changes: 13 additions & 4 deletions packages/inter-protocol/src/price/priceAggregatorChainlink.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,19 @@ export const start = async (zcf, privateArgs, baggage) => {
const invitationMakers = Far('invitation makers', {
/** @param {import('./roundsManager.js').PriceRound} result */
PushPrice(result) {
return zcf.makeInvitation(cSeat => {
cSeat.exit();
admin.pushPrice(result);
}, 'PushPrice');
return zcf.makeInvitation(
// TODO is there a more concise way to do this?
/** @param {ZCFSeat} cSeat */
cSeat => {
try {
admin.pushPrice(result);
cSeat.exit();
} catch (err) {
cSeat.fail(err);
}
},
'PushPrice',
);
},
});
seat.exit();
Expand Down
2 changes: 2 additions & 0 deletions packages/inter-protocol/src/price/priceOracleAdmin.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export const makeOracleAdmin = defineDurableFarClass(
async pushPrice({ roundId: roundIdRaw = undefined, unitPrice: valueRaw }) {
const { state } = this;
const { roundPowers } = state;
console.log('DEBUG calling handlePush');
const result = await roundPowers.handlePush(
{
oracleId: state.oracleId,
Expand All @@ -77,6 +78,7 @@ export const makeOracleAdmin = defineDurableFarClass(
unitPrice: valueRaw,
},
);
console.log('DEBUG handlePush called');

state.lastReportedRound = result.lastReportedRound;
state.lastStartedRound = result.lastStartedRound;
Expand Down

0 comments on commit 8b681f3

Please sign in to comment.