2017-11-16 01:51:16 +00:00
|
|
|
import pytest
|
2018-03-03 05:02:17 +00:00
|
|
|
|
|
|
|
from nkms_eth.blockchain import Blockchain
|
2018-02-05 03:42:29 +00:00
|
|
|
from nkms_eth.token import NuCypherKMSToken
|
2018-03-03 05:02:17 +00:00
|
|
|
from tests.utilities import TesterBlockchain, MockEscrow
|
2017-11-16 01:51:16 +00:00
|
|
|
|
|
|
|
|
2018-02-25 05:49:45 +00:00
|
|
|
@pytest.fixture(scope='function')
|
2018-02-05 03:42:29 +00:00
|
|
|
def testerchain():
|
2018-02-07 07:15:33 +00:00
|
|
|
chain = TesterBlockchain()
|
|
|
|
yield chain
|
2018-02-28 03:10:53 +00:00
|
|
|
del chain
|
2018-03-02 03:03:32 +00:00
|
|
|
TesterBlockchain._instance = None
|
2017-11-19 04:40:09 +00:00
|
|
|
|
2018-02-08 05:26:27 +00:00
|
|
|
|
2018-02-25 05:49:45 +00:00
|
|
|
@pytest.fixture(scope='function')
|
2018-02-05 03:42:29 +00:00
|
|
|
def token(testerchain):
|
2018-02-24 10:02:31 +00:00
|
|
|
token = NuCypherKMSToken(blockchain=testerchain)
|
2018-02-28 03:10:53 +00:00
|
|
|
token.arm()
|
|
|
|
token.deploy()
|
2018-02-24 23:56:06 +00:00
|
|
|
yield token
|
2018-02-05 03:42:29 +00:00
|
|
|
|
|
|
|
|
2018-02-25 05:49:45 +00:00
|
|
|
@pytest.fixture(scope='function')
|
2018-02-05 03:42:29 +00:00
|
|
|
def escrow(testerchain, token):
|
2018-03-03 05:02:17 +00:00
|
|
|
escrow = MockEscrow(blockchain=testerchain, token=token)
|
2018-02-28 03:10:53 +00:00
|
|
|
escrow.arm()
|
|
|
|
escrow.deploy()
|
|
|
|
yield escrow
|