Skip to content

Commit

Permalink
We don't have ethers on ppolygon --> clarifying claim function naming
Browse files Browse the repository at this point in the history
  • Loading branch information
chompomonim committed Mar 29, 2022
1 parent 15dcd5e commit 50fa182
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion contracts/FundsRecovery.sol
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ contract FundsRecovery is Ownable, ReentrancyGuard {
/**
* Possibility to recover funds in case they were sent to this address before smart contract deployment
*/
function claimEthers() public nonReentrant {
function claimNativeCoin() public nonReentrant {
require(fundsDestination != address(0));
fundsDestination.transfer(address(this).balance);
}
Expand Down
8 changes: 4 additions & 4 deletions test/fundsRecovery.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ contract('General tests for funds recovery', ([txMaker, owner, fundsDestination,
it('anyone should successfully claim ethers', async () => {
const initialBalance = await web3.eth.getBalance(fundsDestination)

await contract.claimEthers().should.be.fulfilled
await contract.claimNativeCoin().should.be.fulfilled

const expectedBalance = Number(initialBalance) + topupAmount
expect(await web3.eth.getBalance(fundsDestination)).to.be.equal(expectedBalance.toString())
Expand Down Expand Up @@ -112,7 +112,7 @@ contract('Registry funds recovery', ([_, txMaker, identity, account, fundsDestin
it('should recover ethers sent to registry before its deployment', async () => {
const initialBalance = new BN(await web3.eth.getBalance(fundsDestination))
const amount = new BN(topupAmount.toString())
await registry.claimEthers().should.be.fulfilled
await registry.claimNativeCoin().should.be.fulfilled
const expectedBalance = initialBalance.add(amount)
expect(await web3.eth.getBalance(fundsDestination)).to.be.equal(expectedBalance.toString())
})
Expand Down Expand Up @@ -161,7 +161,7 @@ contract('Channel implementation funds recovery', ([_, txMaker, identity, identi
it('should recover ethers sent to identity implementation before its deployment', async () => {
const initialBalance = new BN(await web3.eth.getBalance(fundsDestination))
const amount = new BN(topupAmount.toString())
await channelImplementation.claimEthers().should.be.fulfilled
await channelImplementation.claimNativeCoin().should.be.fulfilled

const expectedBalance = initialBalance.add(amount)
expect(await web3.eth.getBalance(fundsDestination)).to.be.equal(expectedBalance.toString())
Expand Down Expand Up @@ -214,7 +214,7 @@ contract('Hermes funds recovery', ([_, txMaker, account, fundsDestination, ...ot
const initialBalance = new BN(await web3.eth.getBalance(fundsDestination))

topupAmount = new BN(topupAmount.toString())
await hermesImplementation.claimEthers().should.be.fulfilled
await hermesImplementation.claimNativeCoin().should.be.fulfilled

const expectedBalance = topupAmount.add(new BN(initialBalance))
expect(await web3.eth.getBalance(fundsDestination)).to.be.equal(expectedBalance.toString())
Expand Down
4 changes: 2 additions & 2 deletions test/fundsRecoveryByCheque.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ contract('Full path (in channel using cheque) test for funds recovery', ([txMake

it('should fail recovering funds when destination is not set', async () => {
channel = await ChannelImplementation.at(expectedAddress)
await channel.claimEthers().should.be.rejected
await channel.claimNativeCoin().should.be.rejected
expect(await channel.getFundsDestination()).to.be.equal(ZeroAddress)
})

Expand All @@ -107,7 +107,7 @@ contract('Full path (in channel using cheque) test for funds recovery', ([txMake
it('should recover ethers', async () => {
const initialBalance = await web3.eth.getBalance(fundsDestination)

await channel.claimEthers({ from: otherAccounts[1] }).should.be.fulfilled
await channel.claimNativeCoin({ from: otherAccounts[1] }).should.be.fulfilled

const expectedBalance = Number(initialBalance) + topupAmount
expect(await web3.eth.getBalance(fundsDestination)).to.be.equal(expectedBalance.toString())
Expand Down

0 comments on commit 50fa182

Please sign in to comment.