Esempio n. 1
0
 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;
         }
       });
 }
Esempio n. 2
0
 void payBob() {
   Ref payment = E.send(myPurse, "makePurse");
   E.sendOnly(payment, "deposit", BigInteger.valueOf(10), myPurse);
   E.sendOnly(myBob, "accept", payment);
 }