PullPayment.js 727 B

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