PullPaymentCapable.js 664 B

1234567891011121314151617181920212223242526
  1. contract('PullPaymentCapable', function(accounts) {
  2. it("can't call asyncSend externally", function(done) {
  3. var ppc = PullPaymentCapable.new();
  4. assert.isUndefined(ppc.asyncSend);
  5. done();
  6. });
  7. it("can record an async payment correctly", function(done) {
  8. var ppce;
  9. var AMOUNT = 1000;
  10. return PullPaymentCapableExample.new()
  11. .then(function(_ppce) {
  12. ppce = _ppce;
  13. ppce.callSend(accounts[0], AMOUNT)
  14. })
  15. .then(function() {
  16. return ppce.payments(accounts[0]);
  17. })
  18. .then(function(paymentsToAccount0) {
  19. assert.equal(paymentsToAccount0, AMOUNT);
  20. })
  21. .then(done);
  22. });
  23. });