Forward all gas on PullPayment withdrawal (#1976)

* Add withdrawWithGas

* Improve docs

* Add changelog entry

* Update contracts/payment/PullPayment.sol

Co-Authored-By: Francisco Giordano <frangio.1@gmail.com>

* Remove repeated comment

* Update changelog entry

* Fix inline docs

* Fix changelog formatting

(cherry picked from commit d6e10ab786)
This commit is contained in:
Nicolás Venturo
2019-10-28 20:06:02 -03:00
committed by Francisco Giordano
parent ab4d43ce14
commit 1c220e175d
4 changed files with 68 additions and 5 deletions

View File

@ -42,4 +42,16 @@ contract('PullPayment', function ([_, payer, payee1, payee2]) {
(await balanceTracker.delta()).should.be.bignumber.equal(amount);
(await this.contract.payments(payee1)).should.be.bignumber.equal('0');
});
it('can withdraw payment forwarding all gas', async function () {
const balanceTracker = await balance.tracker(payee1);
await this.contract.callTransfer(payee1, amount, { from: payer });
(await this.contract.payments(payee1)).should.be.bignumber.equal(amount);
await this.contract.withdrawPaymentsWithGas(payee1);
(await balanceTracker.delta()).should.be.bignumber.equal(amount);
(await this.contract.payments(payee1)).should.be.bignumber.equal('0');
});
});