@reality.eth/contracts 3.2.22 → 3.2.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/chains/deployments/1/ETH/RealityETH-3.0.json +1 -0
- package/chains/deployments/10/OETH/RealityETH-3.0.json +3 -1
- package/chains/deployments/100/XDAI/RealityETH-3.0.json +3 -1
- package/chains/deployments/11155111/ETH/RealityETH-3.0.json +2 -1
- package/chains/deployments/130/ETH/RealityETH-3.0.json +1 -1
- package/chains/deployments/42161/ARETH/RealityETH-3.0.json +3 -1
- package/chains/deployments/421614/ETH/RealityETH-3.0.json +2 -1
- package/chains/deployments/8453/ETH/RealityETH-3.0.json +2 -1
- package/chains/supported.json +62 -14
- package/generated/chains.json +23 -0
- package/generated/contract_token_lookup.json +476 -0
- package/generated/contracts.json +17 -7
- package/generated/tokens.json +45 -23
- package/generated/website-data.js +1 -0
- package/package.json +7 -3
- package/scripts/generate_chains_json.js +8 -0
- package/scripts/generate_contract_token_lookup.js +40 -0
- package/scripts/generate_indexer_config.js +111 -0
- package/scripts/generate_ponder_config.js +222 -0
- package/scripts/generate_website_data.js +68 -0
- package/scripts/update_token_prices.js +144 -0
- package/tests/python/requirements.txt +0 -4
- package/tests/python/test.py +37 -34
- package/tests/python/test_erc20.py +27 -25
- package/tokens/ARETH.json +3 -2
- package/tokens/AVAX.json +2 -1
- package/tokens/BNB.json +2 -1
- package/tokens/BOND.json +2 -1
- package/tokens/CELO.json +3 -2
- package/tokens/CTH.json +2 -1
- package/tokens/DAOOS.json +2 -1
- package/tokens/DEXE.json +2 -1
- package/tokens/ETH.json +3 -2
- package/tokens/FOX.json +2 -1
- package/tokens/GNO.json +4 -3
- package/tokens/MATIC.json +2 -1
- package/tokens/MONAD.json +3 -2
- package/tokens/OETH.json +3 -2
- package/tokens/POLK.json +2 -1
- package/tokens/SUKU.json +2 -1
- package/tokens/SWISE.json +2 -1
- package/tokens/TLOS.json +3 -2
- package/tokens/TRST.json +2 -1
- package/tokens/UBQ.json +2 -1
- package/tokens/XDAI.json +3 -2
- package/tokens/ZBS.json +2 -1
package/tests/python/test.py
CHANGED
|
@@ -1,27 +1,30 @@
|
|
|
1
1
|
import unittest
|
|
2
2
|
from unittest import TestCase, main
|
|
3
|
-
from ethereum.utils import decode_hex, encode_hex
|
|
4
|
-
from ethereum.tools import tester as t
|
|
5
|
-
#from ethereum.tools.tester import TransactionFailed, ABIContract
|
|
6
3
|
|
|
7
4
|
from eth_tester.exceptions import TransactionFailed
|
|
8
5
|
|
|
9
|
-
|
|
10
|
-
from ethereum.tools import keys
|
|
11
|
-
from ethereum.abi import ContractTranslator
|
|
12
|
-
import time
|
|
13
|
-
from sha3 import keccak_256
|
|
14
6
|
from hashlib import sha256
|
|
15
7
|
|
|
16
8
|
from web3.providers.eth_tester import EthereumTesterProvider
|
|
17
9
|
from web3 import Web3
|
|
18
10
|
|
|
19
11
|
import json
|
|
20
|
-
import bitcoin
|
|
21
12
|
import os
|
|
22
13
|
|
|
23
14
|
import time
|
|
24
15
|
|
|
16
|
+
def decode_hex(hex_str):
|
|
17
|
+
if isinstance(hex_str, (bytes, bytearray)):
|
|
18
|
+
return hex_str
|
|
19
|
+
if hex_str.startswith('0x') or hex_str.startswith('0X'):
|
|
20
|
+
hex_str = hex_str[2:]
|
|
21
|
+
return bytes.fromhex(hex_str)
|
|
22
|
+
|
|
23
|
+
def encode_hex(b):
|
|
24
|
+
if isinstance(b, (bytes, bytearray)):
|
|
25
|
+
return b.hex()
|
|
26
|
+
return hex(b)[2:]
|
|
27
|
+
|
|
25
28
|
from eth_tester import EthereumTester, PyEVMBackend
|
|
26
29
|
|
|
27
30
|
# Command-line flag to skip tests we're not working on
|
|
@@ -205,7 +208,7 @@ class TestRealitio(TestCase):
|
|
|
205
208
|
def _contractFromBuildJSON(self, con_name, sender=None, startgas=DEPLOY_GAS):
|
|
206
209
|
|
|
207
210
|
if sender is None:
|
|
208
|
-
sender =
|
|
211
|
+
sender = self.web3.eth.accounts[0]
|
|
209
212
|
|
|
210
213
|
bytecode_file = '../../bytecode/' + con_name + '.bin'
|
|
211
214
|
bcode = None
|
|
@@ -397,7 +400,7 @@ class TestRealitio(TestCase):
|
|
|
397
400
|
self.rc0.functions.getFinalAnswerIfMatches(
|
|
398
401
|
self.question_id,
|
|
399
402
|
decode_hex(expect_ch[2:]),
|
|
400
|
-
|
|
403
|
+
self.web3.eth.accounts[2],
|
|
401
404
|
0,
|
|
402
405
|
25
|
|
403
406
|
).call()
|
|
@@ -492,11 +495,11 @@ class TestRealitio(TestCase):
|
|
|
492
495
|
# The arbitrator cannot submit an answer that has not been requested.
|
|
493
496
|
# (If they really want to do this, they can always pay themselves for arbitration.)
|
|
494
497
|
with self.assertRaises(TransactionFailed):
|
|
495
|
-
self.arb0.functions.submitAnswerByArbitrator(self.question_id, to_answer_for_contract(123456),
|
|
498
|
+
self.arb0.functions.submitAnswerByArbitrator(self.question_id, to_answer_for_contract(123456), self.web3.eth.accounts[0]).transact()
|
|
496
499
|
|
|
497
500
|
# You cannot notify realitio of arbitration unless you are the arbitrator
|
|
498
501
|
with self.assertRaises(TransactionFailed):
|
|
499
|
-
self.rc0.functions.notifyOfArbitrationRequest(self.question_id,
|
|
502
|
+
self.rc0.functions.notifyOfArbitrationRequest(self.question_id, self.web3.eth.accounts[0], 0).transact()
|
|
500
503
|
|
|
501
504
|
self.assertFalse(self.rc0.functions.isFinalized(self.question_id).call())
|
|
502
505
|
|
|
@@ -504,7 +507,7 @@ class TestRealitio(TestCase):
|
|
|
504
507
|
self.assertTrue(self.arb0.functions.requestArbitration(self.question_id, 0).transact(self._txargs(val=fee)), "Requested arbitration")
|
|
505
508
|
question = self.rc0.functions.questions(self.question_id).call()
|
|
506
509
|
self.assertTrue(question[QINDEX_IS_PENDING_ARBITRATION], "When arbitration is pending for an answered question, we set the is_pending_arbitration flag to True")
|
|
507
|
-
self.arb0.functions.submitAnswerByArbitrator(self.question_id, to_answer_for_contract(123456),
|
|
510
|
+
self.arb0.functions.submitAnswerByArbitrator(self.question_id, to_answer_for_contract(123456), self.web3.eth.accounts[0]).transact()
|
|
508
511
|
|
|
509
512
|
self.assertTrue(self.rc0.functions.isFinalized(self.question_id).call())
|
|
510
513
|
self.assertEqual(from_answer_for_contract(self.rc0.functions.getFinalAnswer(self.question_id).call()), 123456, "Arbitrator submitting final answer calls finalize")
|
|
@@ -540,7 +543,7 @@ class TestRealitio(TestCase):
|
|
|
540
543
|
self.assertTrue(self.arb0.functions.requestArbitration(self.question_id, 0).transact(self._txargs(val=fee)), "Requested arbitration")
|
|
541
544
|
|
|
542
545
|
arb_answer = to_answer_for_contract(1001)
|
|
543
|
-
arb_payer =
|
|
546
|
+
arb_payer = self.web3.eth.accounts[2]
|
|
544
547
|
|
|
545
548
|
hist_hash = self.rc0.functions.questions(self.question_id).call()[QINDEX_HISTORY_HASH]
|
|
546
549
|
|
|
@@ -594,7 +597,7 @@ class TestRealitio(TestCase):
|
|
|
594
597
|
self.assertTrue(self.arb0.functions.requestArbitration(self.question_id, 0).transact(self._txargs(val=fee)), "Requested arbitration")
|
|
595
598
|
|
|
596
599
|
arb_answer = to_answer_for_contract(1001)
|
|
597
|
-
arb_payer =
|
|
600
|
+
arb_payer = self.web3.eth.accounts[2]
|
|
598
601
|
|
|
599
602
|
hist_hash = self.rc0.functions.questions(self.question_id).call()[QINDEX_HISTORY_HASH]
|
|
600
603
|
|
|
@@ -643,7 +646,7 @@ class TestRealitio(TestCase):
|
|
|
643
646
|
self.assertTrue(self.arb0.functions.requestArbitration(self.question_id, 0).transact(self._txargs(val=fee)), "Requested arbitration")
|
|
644
647
|
|
|
645
648
|
arb_answer = to_answer_for_contract(98765)
|
|
646
|
-
arb_payer =
|
|
649
|
+
arb_payer = self.web3.eth.accounts[2]
|
|
647
650
|
|
|
648
651
|
hist_hash = self.rc0.functions.questions(self.question_id).call()[QINDEX_HISTORY_HASH]
|
|
649
652
|
|
|
@@ -687,7 +690,7 @@ class TestRealitio(TestCase):
|
|
|
687
690
|
self.assertTrue(self.arb0.functions.requestArbitration(self.question_id, 0).transact(self._txargs(val=fee)), "Requested arbitration")
|
|
688
691
|
|
|
689
692
|
arb_answer = to_answer_for_contract(123456)
|
|
690
|
-
arb_payer =
|
|
693
|
+
arb_payer = self.web3.eth.accounts[2]
|
|
691
694
|
|
|
692
695
|
hist_hash = self.rc0.functions.questions(self.question_id).call()[QINDEX_HISTORY_HASH]
|
|
693
696
|
|
|
@@ -735,7 +738,7 @@ class TestRealitio(TestCase):
|
|
|
735
738
|
self.assertTrue(self.arb0.functions.requestArbitration(self.question_id, 0).transact(self._txargs(val=fee)), "Requested arbitration")
|
|
736
739
|
|
|
737
740
|
arb_answer = to_answer_for_contract(0)
|
|
738
|
-
arb_payer =
|
|
741
|
+
arb_payer = self.web3.eth.accounts[2]
|
|
739
742
|
|
|
740
743
|
##self.rc0.functions.claimWinnings(self.question_id, st['hash'], st['addr'], st['bond'], st['answer']).transact()
|
|
741
744
|
self.assertEqual(st['answer'][-1], to_answer_for_contract(1001))
|
|
@@ -762,11 +765,11 @@ class TestRealitio(TestCase):
|
|
|
762
765
|
# The arbitrator cannot submit an answer that has not been requested.
|
|
763
766
|
# (If they really want to do this, they can always pay themselves for arbitration.)
|
|
764
767
|
with self.assertRaises(TransactionFailed):
|
|
765
|
-
self.arb0.functions.assignWinnerAndSubmitAnswerByArbitrator(self.question_id, to_answer_for_contract(123456),
|
|
768
|
+
self.arb0.functions.assignWinnerAndSubmitAnswerByArbitrator(self.question_id, to_answer_for_contract(123456), self.web3.eth.accounts[0]).transact()
|
|
766
769
|
|
|
767
770
|
# You cannot notify realitio of arbitration unless you are the arbitrator
|
|
768
771
|
with self.assertRaises(TransactionFailed):
|
|
769
|
-
self.rc0.functions.notifyOfArbitrationRequest(self.question_id,
|
|
772
|
+
self.rc0.functions.notifyOfArbitrationRequest(self.question_id, self.web3.eth.accounts[0], 0).transact()
|
|
770
773
|
|
|
771
774
|
self.assertFalse(self.rc0.functions.isFinalized(self.question_id).call())
|
|
772
775
|
|
|
@@ -775,7 +778,7 @@ class TestRealitio(TestCase):
|
|
|
775
778
|
question = self.rc0.functions.questions(self.question_id).call()
|
|
776
779
|
#self.assertEqual(question[QINDEX_FINALIZATION_TS], 1, "When arbitration is pending for an answered question, we set the finalization_ts to 1")
|
|
777
780
|
self.assertTrue(question[QINDEX_IS_PENDING_ARBITRATION], "When arbitration is pending for an answered question, we set the is_pending_arbitration flag to True")
|
|
778
|
-
self.arb0.functions.submitAnswerByArbitrator(self.question_id, to_answer_for_contract(123456),
|
|
781
|
+
self.arb0.functions.submitAnswerByArbitrator(self.question_id, to_answer_for_contract(123456), self.web3.eth.accounts[0]).transact()
|
|
779
782
|
|
|
780
783
|
self.assertTrue(self.rc0.functions.isFinalized(self.question_id).call())
|
|
781
784
|
self.assertEqual(from_answer_for_contract(self.rc0.functions.getFinalAnswer(self.question_id).call()), 123456, "Arbitrator submitting final answer calls finalize")
|
|
@@ -835,7 +838,7 @@ class TestRealitio(TestCase):
|
|
|
835
838
|
# The arbitrator cannot submit an answer that has not been requested.
|
|
836
839
|
# (If they really want to do this, they can always pay themselves for arbitration.)
|
|
837
840
|
with self.assertRaises(TransactionFailed):
|
|
838
|
-
self.arb0.functions.submitAnswerByArbitrator(self.question_id, to_answer_for_contract(123456),
|
|
841
|
+
self.arb0.functions.submitAnswerByArbitrator(self.question_id, to_answer_for_contract(123456), self.web3.eth.accounts[0]).transact()
|
|
839
842
|
|
|
840
843
|
# The arbitrator cannot cancel arbitration that has not been requested
|
|
841
844
|
with self.assertRaises(TransactionFailed):
|
|
@@ -1079,7 +1082,7 @@ class TestRealitio(TestCase):
|
|
|
1079
1082
|
st = None
|
|
1080
1083
|
st = self.submitAnswerReturnUpdatedState( st, self.question_id, 1001, 0, 2, k4)
|
|
1081
1084
|
st = self.submitAnswerReturnUpdatedState( st, self.question_id, 1002, 2, 4, k3)
|
|
1082
|
-
fee = self.arb0.functions.getDisputeFee(
|
|
1085
|
+
fee = self.arb0.functions.getDisputeFee(decode_hex("0x00")).call()
|
|
1083
1086
|
with self.assertRaises(TransactionFailed):
|
|
1084
1087
|
txid = self.arb0.functions.requestArbitration(self.question_id, 2).transact(self._txargs(val=fee))
|
|
1085
1088
|
self.raiseOnZeroStatus(txid)
|
|
@@ -1088,7 +1091,7 @@ class TestRealitio(TestCase):
|
|
|
1088
1091
|
|
|
1089
1092
|
@unittest.skipIf(WORKING_ONLY, "Not under construction")
|
|
1090
1093
|
def test_bond_claim_arbitration_existing_none(self):
|
|
1091
|
-
fee = self.arb0.functions.getDisputeFee(
|
|
1094
|
+
fee = self.arb0.functions.getDisputeFee(decode_hex("0x00")).call()
|
|
1092
1095
|
with self.assertRaises(TransactionFailed):
|
|
1093
1096
|
txid = self.arb0.functions.requestArbitration(self.question_id, 0).transact(self._txargs(val=fee))
|
|
1094
1097
|
self.raiseOnZeroStatus(txid)
|
|
@@ -1096,7 +1099,7 @@ class TestRealitio(TestCase):
|
|
|
1096
1099
|
|
|
1097
1100
|
@unittest.skipIf(WORKING_ONLY, "Not under construction")
|
|
1098
1101
|
def test_bond_claim_arbitration_existing_final(self):
|
|
1099
|
-
fee = self.arb0.functions.getDisputeFee(
|
|
1102
|
+
fee = self.arb0.functions.getDisputeFee(decode_hex("0x00")).call()
|
|
1100
1103
|
k3 = self.web3.eth.accounts[3]
|
|
1101
1104
|
k4 = self.web3.eth.accounts[4]
|
|
1102
1105
|
|
|
@@ -1405,7 +1408,7 @@ class TestRealitio(TestCase):
|
|
|
1405
1408
|
if ERC20:
|
|
1406
1409
|
self._issueTokens(k3, 1000, 1000)
|
|
1407
1410
|
|
|
1408
|
-
fee = self.arb0.functions.getDisputeFee(
|
|
1411
|
+
fee = self.arb0.functions.getDisputeFee(decode_hex("0x00")).call()
|
|
1409
1412
|
|
|
1410
1413
|
st = None
|
|
1411
1414
|
st = self.submitAnswerReturnUpdatedState( st, self.question_id, 1002, 0, 1, k3, True)
|
|
@@ -1517,7 +1520,7 @@ class TestRealitio(TestCase):
|
|
|
1517
1520
|
self._issueTokens(k3, 1000000, 1000000)
|
|
1518
1521
|
self._issueTokens(k4, 1000000, 1000000)
|
|
1519
1522
|
|
|
1520
|
-
fee = self.arb0.functions.getDisputeFee(
|
|
1523
|
+
fee = self.arb0.functions.getDisputeFee(decode_hex("0x00")).call()
|
|
1521
1524
|
|
|
1522
1525
|
st = None
|
|
1523
1526
|
st = self.submitAnswerReturnUpdatedState( st, self.question_id, 1001, 0, 2, k4)
|
|
@@ -2346,27 +2349,27 @@ class TestRealitio(TestCase):
|
|
|
2346
2349
|
self.raiseOnZeroStatus(txid)
|
|
2347
2350
|
|
|
2348
2351
|
with self.assertRaises(TransactionFailed):
|
|
2349
|
-
txid = self.arb0.functions.updateRegisteredWallet(
|
|
2352
|
+
txid = self.arb0.functions.updateRegisteredWallet(self.web3.eth.accounts[8]).transact(self._txargs(sender=k2))
|
|
2350
2353
|
self.raiseOnZeroStatus(txid)
|
|
2351
2354
|
|
|
2352
|
-
self.arb0.functions.updateRegisteredWallet(
|
|
2355
|
+
self.arb0.functions.updateRegisteredWallet(self.web3.eth.accounts[8]).transact()
|
|
2353
2356
|
|
|
2354
2357
|
if ERC20:
|
|
2355
2358
|
# Skip this for now as we're not actually using the RegisteredWallet
|
|
2356
2359
|
return
|
|
2357
2360
|
|
|
2358
2361
|
if ERC20:
|
|
2359
|
-
start_arb_bal = self.token0.functions.balanceOf(
|
|
2362
|
+
start_arb_bal = self.token0.functions.balanceOf(self.web3.eth.accounts[8]).call()
|
|
2360
2363
|
else:
|
|
2361
|
-
start_arb_bal = self.web3.eth.get_balance(
|
|
2364
|
+
start_arb_bal = self.web3.eth.get_balance(self.web3.eth.accounts[8])
|
|
2362
2365
|
|
|
2363
2366
|
self.arb0.functions.callWithdraw().transact(self._txargs(sender=k7))
|
|
2364
2367
|
self.arb0.functions.withdrawToRegisteredWallet().transact(self._txargs(sender=k4))
|
|
2365
2368
|
|
|
2366
2369
|
if ERC20:
|
|
2367
|
-
end_arb_bal = self.token0.functions.balanceOf(
|
|
2370
|
+
end_arb_bal = self.token0.functions.balanceOf(self.web3.eth.accounts[8]).call()
|
|
2368
2371
|
else:
|
|
2369
|
-
end_arb_bal = self.web3.eth.get_balance(
|
|
2372
|
+
end_arb_bal = self.web3.eth.get_balance(self.web3.eth.accounts[8])
|
|
2370
2373
|
|
|
2371
2374
|
self.assertEqual(end_arb_bal - start_arb_bal, (100+321+321))
|
|
2372
2375
|
self.assertEqual(self.rc0.functions.balanceOf(self.arb0.address).call(), 0)
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import unittest
|
|
2
2
|
from unittest import TestCase, main
|
|
3
|
-
from ethereum.utils import decode_hex, encode_hex
|
|
4
|
-
from ethereum.tools import tester as t
|
|
5
|
-
#from ethereum.tools.tester import TransactionFailed, ABIContract
|
|
6
3
|
|
|
7
4
|
from eth_tester.exceptions import TransactionFailed
|
|
8
5
|
|
|
9
|
-
|
|
10
|
-
from ethereum.tools import keys
|
|
11
|
-
from ethereum.abi import ContractTranslator
|
|
12
|
-
import time
|
|
13
|
-
from sha3 import keccak_256
|
|
14
6
|
from hashlib import sha256
|
|
15
7
|
|
|
16
|
-
|
|
8
|
+
def decode_hex(hex_str):
|
|
9
|
+
if isinstance(hex_str, (bytes, bytearray)):
|
|
10
|
+
return hex_str
|
|
11
|
+
if hex_str.startswith('0x') or hex_str.startswith('0X'):
|
|
12
|
+
hex_str = hex_str[2:]
|
|
13
|
+
return bytes.fromhex(hex_str)
|
|
14
|
+
|
|
15
|
+
def encode_hex(b):
|
|
16
|
+
if isinstance(b, (bytes, bytearray)):
|
|
17
|
+
return b.hex()
|
|
18
|
+
return hex(b)[2:]
|
|
17
19
|
|
|
18
20
|
from web3.providers.eth_tester import EthereumTesterProvider
|
|
19
21
|
from web3 import Web3
|
|
@@ -173,7 +175,7 @@ class TestRealitio(TestCase):
|
|
|
173
175
|
|
|
174
176
|
def _contractFromBuildJSON(self, con_name, sender=None, startgas=DEPLOY_GAS):
|
|
175
177
|
if sender is None:
|
|
176
|
-
sender =
|
|
178
|
+
sender = self.web3.eth.accounts[0]
|
|
177
179
|
|
|
178
180
|
bytecode_file = '../../bytecode/' + con_name + '.bin'
|
|
179
181
|
abi_file = '../../abi/solc-0.4.25/' + con_name + '.abi.json'
|
|
@@ -346,7 +348,7 @@ class TestRealitio(TestCase):
|
|
|
346
348
|
self.rc0.functions.getFinalAnswerIfMatches(
|
|
347
349
|
self.question_id,
|
|
348
350
|
decode_hex(expect_ch[2:]),
|
|
349
|
-
|
|
351
|
+
self.web3.eth.accounts[2],
|
|
350
352
|
0,
|
|
351
353
|
25
|
|
352
354
|
).call()
|
|
@@ -447,9 +449,9 @@ class TestRealitio(TestCase):
|
|
|
447
449
|
|
|
448
450
|
# You cannot notify realitio of arbitration unless you are the arbitrator
|
|
449
451
|
with self.assertRaises(TransactionFailed):
|
|
450
|
-
self.rc0.functions.notifyOfArbitrationRequest(self.question_id,
|
|
452
|
+
self.rc0.functions.notifyOfArbitrationRequest(self.question_id, self.web3.eth.accounts[0], 0).transact()
|
|
451
453
|
|
|
452
|
-
self.arb0.functions.submitAnswerByArbitrator(self.question_id, to_answer_for_contract(123456),
|
|
454
|
+
self.arb0.functions.submitAnswerByArbitrator(self.question_id, to_answer_for_contract(123456), self.web3.eth.accounts[0]).transact()
|
|
453
455
|
|
|
454
456
|
self.assertTrue(self.rc0.functions.isFinalized(self.question_id).call())
|
|
455
457
|
self.assertEqual(from_answer_for_contract(self.rc0.functions.getFinalAnswer(self.question_id).call()), 123456, "Arbitrator submitting final answer calls finalize")
|
|
@@ -611,7 +613,7 @@ class TestRealitio(TestCase):
|
|
|
611
613
|
st = None
|
|
612
614
|
st = self.submitAnswerReturnUpdatedState( st, self.question_id, 1001, 0, 2, k4)
|
|
613
615
|
st = self.submitAnswerReturnUpdatedState( st, self.question_id, 1002, 2, 4, k3)
|
|
614
|
-
fee = self.arb0.functions.getDisputeFee(
|
|
616
|
+
fee = self.arb0.functions.getDisputeFee(decode_hex("0x00")).call()
|
|
615
617
|
with self.assertRaises(TransactionFailed):
|
|
616
618
|
txid = self.arb0.functions.requestArbitration(self.question_id, 2).transact(self._txargs(val=fee))
|
|
617
619
|
self.raiseOnZeroStatus(txid)
|
|
@@ -620,7 +622,7 @@ class TestRealitio(TestCase):
|
|
|
620
622
|
|
|
621
623
|
@unittest.skipIf(WORKING_ONLY, "Not under construction")
|
|
622
624
|
def test_bond_claim_arbitration_existing_none(self):
|
|
623
|
-
fee = self.arb0.functions.getDisputeFee(
|
|
625
|
+
fee = self.arb0.functions.getDisputeFee(decode_hex("0x00")).call()
|
|
624
626
|
with self.assertRaises(TransactionFailed):
|
|
625
627
|
txid = self.arb0.functions.requestArbitration(self.question_id, 0).transact(self._txargs(val=fee))
|
|
626
628
|
self.raiseOnZeroStatus(txid)
|
|
@@ -628,7 +630,7 @@ class TestRealitio(TestCase):
|
|
|
628
630
|
|
|
629
631
|
@unittest.skipIf(WORKING_ONLY, "Not under construction")
|
|
630
632
|
def test_bond_claim_arbitration_existing_final(self):
|
|
631
|
-
fee = self.arb0.functions.getDisputeFee(
|
|
633
|
+
fee = self.arb0.functions.getDisputeFee(decode_hex("0x00")).call()
|
|
632
634
|
k3 = self.web3.eth.accounts[3]
|
|
633
635
|
k4 = self.web3.eth.accounts[4]
|
|
634
636
|
|
|
@@ -864,7 +866,7 @@ class TestRealitio(TestCase):
|
|
|
864
866
|
|
|
865
867
|
k3 = self.web3.eth.accounts[3]
|
|
866
868
|
self._issueTokens(k3, 1000, 1000)
|
|
867
|
-
fee = self.arb0.functions.getDisputeFee(
|
|
869
|
+
fee = self.arb0.functions.getDisputeFee(decode_hex("0x00")).call()
|
|
868
870
|
|
|
869
871
|
st = None
|
|
870
872
|
st = self.submitAnswerReturnUpdatedState( st, self.question_id, 1002, 0, 1, k3, True)
|
|
@@ -886,7 +888,7 @@ class TestRealitio(TestCase):
|
|
|
886
888
|
self._issueTokens(k3, 1000000, 1000000)
|
|
887
889
|
self._issueTokens(k4, 1000000, 1000000)
|
|
888
890
|
|
|
889
|
-
fee = self.arb0.functions.getDisputeFee(
|
|
891
|
+
fee = self.arb0.functions.getDisputeFee(decode_hex("0x00")).call()
|
|
890
892
|
|
|
891
893
|
st = None
|
|
892
894
|
st = self.submitAnswerReturnUpdatedState( st, self.question_id, 1001, 0, 2, k4)
|
|
@@ -1437,7 +1439,7 @@ class TestRealitio(TestCase):
|
|
|
1437
1439
|
end_bal = self.rc0.functions.balanceOf(self.arb0.address).call()
|
|
1438
1440
|
self.assertEqual(end_bal - start_bal, (321*2))
|
|
1439
1441
|
|
|
1440
|
-
start_arb_bal = self.token0.functions.balanceOf(
|
|
1442
|
+
start_arb_bal = self.token0.functions.balanceOf(self.web3.eth.accounts[8]).call()
|
|
1441
1443
|
|
|
1442
1444
|
# Some tokens should be piled up in the arbitrator's account in the RealitioERC20 contract
|
|
1443
1445
|
self.assertEqual(self.rc0.functions.balanceOf(self.arb0.address).call(), 100+321+321)
|
|
@@ -1451,12 +1453,12 @@ class TestRealitio(TestCase):
|
|
|
1451
1453
|
# Now the owner can call withdrawERC20 to their own account, but only the owner
|
|
1452
1454
|
with self.assertRaises(TransactionFailed):
|
|
1453
1455
|
# Not the owner
|
|
1454
|
-
txid = self.arb0.functions.withdrawERC20(self.token0.address,
|
|
1456
|
+
txid = self.arb0.functions.withdrawERC20(self.token0.address, self.web3.eth.accounts[8]).transact(self._txargs(sender=k4))
|
|
1455
1457
|
self.raiseOnZeroStatus(txid)
|
|
1456
1458
|
|
|
1457
|
-
self.arb0.functions.withdrawERC20(self.token0.address,
|
|
1459
|
+
self.arb0.functions.withdrawERC20(self.token0.address, self.web3.eth.accounts[8]).transact()
|
|
1458
1460
|
|
|
1459
|
-
end_arb_bal = self.token0.functions.balanceOf(
|
|
1461
|
+
end_arb_bal = self.token0.functions.balanceOf(self.web3.eth.accounts[8]).call()
|
|
1460
1462
|
|
|
1461
1463
|
self.assertEqual(end_arb_bal - start_arb_bal, (100+321+321))
|
|
1462
1464
|
self.assertEqual(self.rc0.functions.balanceOf(self.arb0.address).call(), 0)
|
|
@@ -1507,12 +1509,12 @@ class TestRealitio(TestCase):
|
|
|
1507
1509
|
self.raiseOnZeroStatus(txid)
|
|
1508
1510
|
|
|
1509
1511
|
with self.assertRaises(TransactionFailed):
|
|
1510
|
-
txid = self.arb0.functions.updateRegisteredWallet(
|
|
1512
|
+
txid = self.arb0.functions.updateRegisteredWallet(self.web3.eth.accounts[8]).transact(self._txargs(sender=k2))
|
|
1511
1513
|
self.raiseOnZeroStatus(txid)
|
|
1512
1514
|
|
|
1513
|
-
self.arb0.functions.updateRegisteredWallet(
|
|
1515
|
+
self.arb0.functions.updateRegisteredWallet(self.web3.eth.accounts[8]).transact()
|
|
1514
1516
|
|
|
1515
|
-
start_reg_wal_bal = self.token0.functions.balanceOf(
|
|
1517
|
+
start_reg_wal_bal = self.token0.functions.balanceOf(self.web3.eth.accounts[8]).call()
|
|
1516
1518
|
|
|
1517
1519
|
# Some tokens should be piled up in the arbitrator's account in the RealitioERC20 contract
|
|
1518
1520
|
self.assertEqual(self.rc0.functions.balanceOf(self.arb0.address).call(), 100+321+321)
|
package/tokens/ARETH.json
CHANGED
package/tokens/AVAX.json
CHANGED
package/tokens/BNB.json
CHANGED
package/tokens/BOND.json
CHANGED
package/tokens/CELO.json
CHANGED
package/tokens/CTH.json
CHANGED
package/tokens/DAOOS.json
CHANGED
package/tokens/DEXE.json
CHANGED
package/tokens/ETH.json
CHANGED
package/tokens/FOX.json
CHANGED
package/tokens/GNO.json
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
"decimals": 18,
|
|
3
3
|
"small_number": 10000000,
|
|
4
4
|
"erc20_chains": {
|
|
5
|
-
"1": "0x6810e776880c02933d47db1b9fc05908e5386b96"
|
|
6
|
-
|
|
7
|
-
}
|
|
5
|
+
"1": "0x6810e776880c02933d47db1b9fc05908e5386b96",
|
|
6
|
+
"100": "0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb"
|
|
7
|
+
},
|
|
8
|
+
"approx_1_usd": 0.00967399
|
|
8
9
|
}
|
package/tokens/MATIC.json
CHANGED
package/tokens/MONAD.json
CHANGED
package/tokens/OETH.json
CHANGED
package/tokens/POLK.json
CHANGED
package/tokens/SUKU.json
CHANGED
package/tokens/SWISE.json
CHANGED
package/tokens/TLOS.json
CHANGED
package/tokens/TRST.json
CHANGED
package/tokens/UBQ.json
CHANGED
package/tokens/XDAI.json
CHANGED