2022-11-16 13:13:53 +00:00
|
|
|
|
2020-09-04 17:10:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
import pytest
|
2020-09-07 20:00:26 +00:00
|
|
|
from eth_account.account import Account
|
2020-09-04 17:10:09 +00:00
|
|
|
|
2020-09-07 20:00:26 +00:00
|
|
|
from nucypher.blockchain.eth.signers import Signer
|
2020-09-04 17:10:09 +00:00
|
|
|
|
|
|
|
TRANSACTION_DICT = {
|
2020-09-07 20:00:26 +00:00
|
|
|
'chainId': 1,
|
|
|
|
'nonce': 2,
|
|
|
|
'gasPrice': 2000000000000,
|
|
|
|
'gas': 314159,
|
|
|
|
'to': '0xd3CdA913deB6f67967B99D67aCDFa1712C293601',
|
|
|
|
'value': 12345,
|
|
|
|
'data': b'in that metric, kman is above reproach', # thank you friends
|
2020-09-04 17:10:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture(scope='module')
|
2020-09-08 19:53:39 +00:00
|
|
|
def mock_account():
|
|
|
|
key = Account.create(extra_entropy='M*A*S*H* DIWOKNECNECENOE#@!')
|
2021-09-15 00:04:18 +00:00
|
|
|
account = Account.from_key(private_key=key.key)
|
2020-09-04 17:10:09 +00:00
|
|
|
return account
|
|
|
|
|
|
|
|
|
|
|
|
def test_blank_keystore_uri():
|
|
|
|
with pytest.raises(Signer.InvalidSignerURI, match='Blank signer URI - No keystore path provided') as error:
|
2020-09-23 04:19:24 +00:00
|
|
|
Signer.from_signer_uri(uri='keystore://', testnet=True) # it's blank!
|