Skip to content

Commit

Permalink
WIP(game contract): atomicRearrange -> zcf.reallocate() for compat
Browse files Browse the repository at this point in the history
  • Loading branch information
dckc committed Aug 14, 2023
1 parent ed39470 commit ae13f1a
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions packages/smart-wallet/test/gameAssetContract.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,17 @@ export const start = async zcf => {

totalPlaces(want.Places) <= 3n || Fail`only 3 places allowed when joining`;

atomicRearrange(
zcf,
harden([
[playerSeat, gameSeat, give],
[mint.mintGains(want), playerSeat, want],
]),
);
playerSeat.decrementBy(gameSeat.incrementBy(give));
const tmp = mint.mintGains(want);
playerSeat.incrementBy(tmp.decrementBy(want));
zcf.reallocate(playerSeat, tmp, gameSeat);
// atomicRearrange(
// zcf,
// harden([
// [playerSeat, gameSeat, give],
// [mint.mintGains(want), playerSeat, want],
// ]),
// );
playerSeat.exit(true);
return 'welcome to the game';
};
Expand Down

0 comments on commit ae13f1a

Please sign in to comment.