public void accept(Mint.Purse payment) { Ref ackVow = E.send(myPurse, "deposit", BigInteger.valueOf(10), payment); Ref.whenResolvedOnly( ackVow, new OneArgFunc() { public Object run(Object ack) { T.require(!Ref.isBroken(ack), "oops"); // ... react to being paid. return null; } }); }
void payBob() { Ref payment = E.send(myPurse, "makePurse"); E.sendOnly(payment, "deposit", BigInteger.valueOf(10), myPurse); E.sendOnly(myBob, "accept", payment); }