|
6 | 6 |
|
7 | 7 | def test_initial_report_and_participation_fee_collection(localFixture, universe, market, categoricalMarket, scalarMarket, cash, reputationToken):
|
8 | 8 | feeWindow = localFixture.applySignature('FeeWindow', market.getFeeWindow())
|
| 9 | + constants = localFixture.contracts["Constants"] |
9 | 10 |
|
10 | 11 | # We cannot purchase participation tokens yet since the window isn't active
|
11 | 12 | with raises(TransactionFailed):
|
@@ -68,14 +69,15 @@ def test_initial_report_and_participation_fee_collection(localFixture, universe,
|
68 | 69 |
|
69 | 70 | marketStake = marketInitialReport.getStake()
|
70 | 71 | expectedFees = reporterFees * marketStake / totalStake
|
| 72 | + expectedGasBond = 2 * constants.GAS_TO_REPORT() * constants.DEFAULT_REPORTING_GAS_PRICE() |
71 | 73 | with TokenDelta(reputationToken, marketStake, tester.a0, "Redeeming didn't refund REP"):
|
72 |
| - with EtherDelta(expectedFees, tester.a0, localFixture.chain, "Redeeming didn't increase ETH correctly"): |
| 74 | + with EtherDelta(expectedFees + expectedGasBond, tester.a0, localFixture.chain, "Redeeming didn't increase ETH correctly"): |
73 | 75 | assert marketInitialReport.redeem(tester.a0)
|
74 | 76 |
|
75 | 77 | categoricalMarketStake = categoricalInitialReport.getStake()
|
76 | 78 | expectedFees = reporterFees * categoricalMarketStake / totalStake
|
77 | 79 | with TokenDelta(reputationToken, categoricalMarketStake, tester.a0, "Redeeming didn't refund REP"):
|
78 |
| - with EtherDelta(expectedFees, tester.a0, localFixture.chain, "Redeeming didn't increase ETH correctly"): |
| 80 | + with EtherDelta(expectedFees + expectedGasBond, tester.a0, localFixture.chain, "Redeeming didn't increase ETH correctly"): |
79 | 81 | assert categoricalInitialReport.redeem(tester.a0)
|
80 | 82 |
|
81 | 83 | def test_failed_crowdsourcer_fees(localFixture, universe, market, cash, reputationToken):
|
@@ -121,6 +123,7 @@ def test_failed_crowdsourcer_fees(localFixture, universe, market, cash, reputati
|
121 | 123 |
|
122 | 124 | def test_one_round_crowdsourcer_fees(localFixture, universe, market, cash, reputationToken):
|
123 | 125 | feeWindow = localFixture.applySignature('FeeWindow', market.getFeeWindow())
|
| 126 | + constants = localFixture.contracts["Constants"] |
124 | 127 |
|
125 | 128 | # We'll make the window active
|
126 | 129 | localFixture.contracts["Time"].setTimestamp(feeWindow.getStartTime() + 1)
|
@@ -159,11 +162,14 @@ def test_one_round_crowdsourcer_fees(localFixture, universe, market, cash, reput
|
159 | 162 |
|
160 | 163 | # The initial reporter gets fees even though they were not correct. They do not get their REP back though
|
161 | 164 | expectedFees = cash.balanceOf(feeWindow.address) + cash.balanceOf(universe.getOrCreateFeeWindowBefore(feeWindow.address))
|
| 165 | + expectedGasBond = 2 * constants.GAS_TO_REPORT() * constants.DEFAULT_REPORTING_GAS_PRICE() |
162 | 166 | with TokenDelta(reputationToken, 0, tester.a0, "Redeeming didn't refund REP"):
|
163 |
| - with EtherDelta(expectedFees, tester.a0, localFixture.chain, "Redeeming didn't increase ETH correctly"): |
| 167 | + with EtherDelta(expectedFees + expectedGasBond, tester.a0, localFixture.chain, "Redeeming didn't increase ETH correctly"): |
164 | 168 | assert initialReporter.redeem(tester.a0)
|
165 | 169 |
|
166 | 170 | def test_multiple_round_crowdsourcer_fees(localFixture, universe, market, cash, reputationToken):
|
| 171 | + constants = localFixture.contracts["Constants"] |
| 172 | + |
167 | 173 | # Initial Report disputed
|
168 | 174 | proceedToNextRound(localFixture, market, tester.k1, True)
|
169 | 175 | # Initial Report winning
|
@@ -197,8 +203,9 @@ def test_multiple_round_crowdsourcer_fees(localFixture, universe, market, cash,
|
197 | 203 | # The initial reporter locked in REP for 5 rounds.
|
198 | 204 | expectedInitialReporterFees = getExpectedFees(localFixture, cash, initialReporter, 5)
|
199 | 205 | expectedRep = long(initialReporter.getStake() + initialReporter.getStake() / 2)
|
| 206 | + expectedGasBond = 2 * constants.GAS_TO_REPORT() * constants.DEFAULT_REPORTING_GAS_PRICE() |
200 | 207 | with TokenDelta(reputationToken, expectedRep, tester.a0, "Redeeming didn't refund REP"):
|
201 |
| - with EtherDelta(expectedInitialReporterFees, tester.a0, localFixture.chain, "Redeeming didn't increase ETH correctly"): |
| 208 | + with EtherDelta(expectedInitialReporterFees + expectedGasBond, tester.a0, localFixture.chain, "Redeeming didn't increase ETH correctly"): |
202 | 209 | assert initialReporter.redeem(tester.a0)
|
203 | 210 |
|
204 | 211 | # The first winning dispute crowdsourcer will get fees for 4 rounds
|
|
0 commit comments