git-consensus / contracts

Converts the informal ownership structure of an open-source git project to a formal DAO, with token distribution mechanisms for contributors.
GNU General Public License v3.0
13 stars 0 forks source link

Create maxMintablePerHash Integration Test #15

Closed DmitriyShepelev closed 2 years ago

DmitriyShepelev commented 2 years ago

Description

Unit Tests

Running 10 tests for contracts/test/Utils.t.sol:UtilsTest
[PASS] testOK_parseAddrGeneralCase() (gas: 23336)
[PASS] testOk_indexOfAddrNonexistentAddrNonemptyMsg() (gas: 6515)
[PASS] testOk_indexOfAddressGeneralCase() (gas: 10574)
[PASS] testOk_indexOfAddressNonexistentAddrEmptyMsg() (gas: 345)
[PASS] testOk_indexOfAddressTrivialCase() (gas: 10303)
[PASS] testOk_substringEmptyString() (gas: 1146)
[PASS] testOk_substringEntireString() (gas: 11940)
[PASS] testOk_substringGeneralCase() (gas: 25086)
[PASS] testOk_substringOutOfBoundsNoOverflow() (gas: 7320)
[PASS] testOk_substringOutOfBoundsOverflow() (gas: 6263)
Test result: ok. 10 passed; 0 failed; finished in 1.03ms

Running 2 tests for contracts/test/TokenFactory.t.sol:GasBenchmark
[PASS] testGas_createTokenRandom() (gas: 448540)
[PASS] testGas_createTokenStatic() (gas: 591135)
Test result: ok. 2 passed; 0 failed; finished in 1.56ms

Running 1 test for contracts/test/GovernorFactory.t.sol:GasBenchmark
[PASS] testGas_createGovernor() (gas: 300691)
Test result: ok. 1 passed; 0 failed; finished in 936.01µs

Running 2 tests for contracts/test/GitConsensus.t.sol:GasBenchmark
[PASS] testGas_commit() (gas: 434115)
[PASS] testGas_release() (gas: 444780)
Test result: ok. 2 passed; 0 failed; finished in 3.95ms

Running 2 tests for contracts/test/GovernorFactory.t.sol:WhenCreatingNewGovernor
[PASS] testOk_createGovernor(address,address,string,uint256,uint256,uint256,uint256,bytes32) (runs: 256, μ: 339260, ~: 346156)
[PASS] testOk_predictGovernorAddress(bytes32) (runs: 256, μ: 5731, ~: 5731)
Test result: ok. 2 passed; 0 failed; finished in 75.00ms

Running 6 tests for contracts/test/TokenFactory.t.sol:WhenCreatingNewToken
[PASS] testOk_createTokenDeterministicRandomDistribution(address,address,address,string,string,uint256,uint256,uint256,bytes32,bytes32) (runs: 256, μ: 591579, ~: 518661)
[PASS] testOk_createTokenDeterministicStaticDistribution(address,address,address,string,string,uint256,uint256,uint256,bytes32) (runs: 256, μ: 5203185, ~: 2745929)
[PASS] testOk_createTokenEmptyDistribution(address,address,address,string,string,uint256,bytes32) (runs: 256, μ: 326025, ~: 319320)
[PASS] testOk_createTokenRandomDistribution(address,address,address,string,string,uint256,uint256,uint256,bytes32,bytes32) (runs: 256, μ: 599787, ~: 520528)
[PASS] testOk_createTokenStaticDistribution(address,address,address,string,string,uint256,uint256,uint256,bytes32) (runs: 256, μ: 5675686, ~: 3108410)
[PASS] testOk_predictTokenAddress(bytes32) (runs: 256, μ: 5738, ~: 5738)
Test result: ok. 6 passed; 0 failed; finished in 4.22s

Running 20 tests for contracts/test/GitConsensus.t.sol:WhenCallingGitConsensus
[PASS] testOk_commitEmptyFailed(address) (runs: 256, μ: 61523, ~: 61523)
[PASS] testOk_commitEmptyMsgAddr(address) (runs: 256, μ: 349345, ~: 346165)
[PASS] testOk_commitEmptyMsgAddrMalformed(address) (runs: 256, μ: 93836, ~: 93836)
[PASS] testOk_commitFilledFailed(address) (runs: 256, μ: 952625, ~: 952625)
[PASS] testOk_commitFilledMsgAddr(address) (runs: 256, μ: 2137138, ~: 2133900)
[PASS] testOk_commitPartialFailed(address) (runs: 256, μ: 51926, ~: 51926)
[PASS] testOk_commitPartialMsgAddr(address) (runs: 256, μ: 336227, ~: 332918)
[PASS] testOk_commitTwoHashDiffMsgAddrNotMatch(address,address) (runs: 256, μ: 655309, ~: 647635)
[PASS] testOk_commitTwoHashDiffMsgAddrNotMatchWSender(address,address) (runs: 256, μ: 656687, ~: 648981)
[PASS] testOk_commitTwoHashDiffMsgStrNotMatch(address) (runs: 256, μ: 654120, ~: 646716)
[PASS] testOk_releaseDistributionSizeDiffFails(bytes32,bytes32,bytes20) (runs: 256, μ: 1055476, ~: 1055476)
[PASS] testOk_releaseEmptyFailed(bytes32,bytes32) (runs: 256, μ: 1012299, ~: 1012299)
[PASS] testOk_releaseEmptyMsgAddr(bytes32,bytes32) (runs: 256, μ: 1296284, ~: 1296245)
[PASS] testOk_releaseFilledFailed(bytes32,bytes32) (runs: 256, μ: 1838268, ~: 1838268)
[PASS] testOk_releaseFilledMsgAddr(bytes32,bytes32) (runs: 256, μ: 2890758, ~: 2890763)
[PASS] testOk_releasePartialFailed(bytes32,bytes32) (runs: 256, μ: 1002216, ~: 1002216)
[PASS] testOk_releasePartialMsgAddr(bytes32,bytes32) (runs: 256, μ: 1282786, ~: 1282695)
[PASS] testOk_releaseRandomDistribution(bytes32,bytes32,uint256,uint256,bytes32) (runs: 256, μ: 1469020, ~: 1365710)
[PASS] testOk_releaseStaticDistribution(bytes32,bytes32,uint256,uint256) (runs: 256, μ: 19500138, ~: 8434796)
[PASS] testOk_releaseTwoHashDiffMsgStrNotMatch(bytes32,bytes32) (runs: 256, μ: 1598651, ~: 1598484)
Test result: ok. 20 passed; 0 failed; finished in 6.92s

Integration Tests

Git Consensus integration tests
    commits
      ✓ should succeed single commit that have address
      ✓ should succeed single commit that have address no space
      - should fail all commit that have partial address
      ✓ [loop] should succeed all example commit that have address
      ✓ [loop] should fail all example commit that have no address
    releases
      ✓ should fail release with different size hash and value arrays
      ✓ [loop] should fail all example tag that have no address
      ✓ should fail invalid release from non-governor
      ✓ should succeed valid release, commits from last tag to current
      ✓ should succeed valid release, commits from any
      ✓ should fail to mint tokens above maxMintablePerHash
    clones
      ✓ should create clones using arguments