44 lines
1.1 KiB
Python
44 lines
1.1 KiB
Python
# standard imports
|
|
import unittest
|
|
import logging
|
|
import random
|
|
|
|
# external imports
|
|
from chainlib.chain import ChainSpec
|
|
from chainlib.eth.unittest.ethtester import EthTesterCase
|
|
from hexathon import (
|
|
add_0x,
|
|
strip_0x,
|
|
)
|
|
from funga.eth.keystore.dict import DictKeystore
|
|
|
|
# local imports
|
|
from cic.ext.eth import CICEth
|
|
|
|
logg = logging.getLogger(__name__)
|
|
|
|
|
|
class TestCICEthBase(EthTesterCase):
|
|
|
|
def setUp(self):
|
|
super(TestCICEthBase, self).setUp()
|
|
random.seed(42)
|
|
self.token_address = add_0x(random.randbytes(20).hex())
|
|
self.token_index_address = add_0x(random.randbytes(20).hex())
|
|
addresses = self.keystore.list()
|
|
self.resources = {
|
|
'token': {
|
|
'reference': self.token_address,
|
|
'key_address': addresses[0],
|
|
},
|
|
'token_index': {
|
|
'reference': self.token_index_address,
|
|
'key_address': addresses[1],
|
|
},
|
|
}
|
|
self.proofs = []
|
|
for i in range(3):
|
|
self.proofs.append(random.randbytes(32).hex())
|
|
|
|
|