1.0.2 • Published 5 years ago
@metamultisig/contract v1.0.2
MetaMultisig
Unit tests
To run unit tests with Truffle:
truffle test
or npm test
should end up with something like the below:
Contract: MetaMultisig
✓ initial state is correct (130ms)
✓ fails when invalid constructor arguments used (314ms)
✓ sends simple eth transaction signed by multiple addresses (122ms)
✓ fails to send simple eth transaction, multiple signatures not in address order (126ms)
✓ sends simple eth transaction signed by one address with enough threshold (95ms)
✓ fails to send eth transaction when not enough eth balance (105ms)
✓ rejects already executed transaction, invalid nonce (139ms)
✓ rejects transaction with future nonce (94ms)
✓ rejects transactions with invalid signatures (112ms)
✓ rejects transactions when threshold not met (97ms)
✓ sends tokens from multisig (130ms)
✓ fails when trying to send more tokens than available (135ms)
✓ correctly updates the threshold (110ms)
✓ fails to update the threshold if invalid input (265ms)
✓ fails to update the threshold if called directly (51ms)
✓ fails to update the weights if called directly (56ms)
✓ correctly updates the weights (222ms)
✓ fails to update the weights when set below the threshold (243ms)
✓ submitting transaction directly by a keyholder counts as signing it (114ms)
✓ fails when both signed and submitted by the same keyholder (112ms)
20 passing (7s)
To generate coverage report with solidity-coverage:
npm run coverage
what should end up with something like this:
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Lines |
---|---|---|---|---|---|
contracts/ | 100 | 100 | 100 | 100 | |
MetaMultisig.sol | 100 | 100 | 100 | 100 | |
All files | 100 | 100 | 100 | 100 |