-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bug in LockedGold.relock wrapper (#1915)
- Loading branch information
1 parent
85ad78e
commit ab316cb
Showing
2 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { newKitFromWeb3 } from '@celo/contractkit' | ||
import { testWithGanache } from '@celo/dev-utils/lib/ganache-test' | ||
import Web3 from 'web3' | ||
import Register from '../account/register' | ||
import Lock from './lock' | ||
import Unlock from './unlock' | ||
|
||
process.env.NO_SYNCCHECK = 'true' | ||
|
||
testWithGanache('lockedgold:lock cmd', (web3: Web3) => { | ||
test('can lock with pending withdrawals', async () => { | ||
const accounts = await web3.eth.getAccounts() | ||
const account = accounts[0] | ||
const kit = newKitFromWeb3(web3) | ||
const lockedGold = await kit.contracts.getLockedGold() | ||
await Register.run(['--from', account]) | ||
await Lock.run(['--from', account, '--value', '100']) | ||
await Unlock.run(['--from', account, '--value', '50']) | ||
await Lock.run(['--from', account, '--value', '75']) | ||
const pendingWithdrawalsTotalValue = await lockedGold.getPendingWithdrawalsTotalValue(account) | ||
expect(pendingWithdrawalsTotalValue.toFixed()).toBe('0') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters