-
Notifications
You must be signed in to change notification settings - Fork 666
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use private genesis cofig for private network
Allow trinity to use a custom genesis configuration to allow for private networks to be specified. The changes specify that a genesis flag be supplied with a valid filepath to the genesis config. It will also require that a datadir flag is provided. If using the custom genesis config if it does not contain the required parameters trinity will not continue to try and create a new network. Testing is still yet to be implemented.
- Loading branch information
1 parent
2aa9d2e
commit c5be5cc
Showing
46 changed files
with
1,534 additions
and
533 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,5 @@ include requirements.txt | |
|
||
recursive-exclude * __pycache__ | ||
recursive-exclude * *.py[co] | ||
|
||
include trinity/assets/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,5 +14,5 @@ | |
ByzantiumVM, | ||
) | ||
from .constantinople import ( # noqa: F401 | ||
ConstantinopleVM | ||
ConstantinopleVM, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import pytest | ||
|
||
from eth_keys import keys | ||
|
||
from eth.chains.base import MiningChain | ||
from eth.chains.mainnet import MAINNET_VMS | ||
from eth.tools.builder.chain import api | ||
|
||
|
||
@pytest.fixture(params=MAINNET_VMS) | ||
def chain(request): | ||
return api.build( | ||
MiningChain, | ||
api.fork_at(request.param, 0), | ||
api.disable_pow_check(), | ||
api.genesis(), | ||
) | ||
|
||
|
||
@pytest.fixture | ||
def sender(): | ||
return keys.PrivateKey(b'unicornsrainbows' * 2) | ||
|
||
|
||
TO_ADDRESS = b'\0' * 20 | ||
|
||
|
||
@pytest.fixture | ||
def basic_transaction(chain, sender): | ||
unsigned_txn = chain.create_unsigned_transaction( | ||
nonce=0, | ||
gas_price=1234, | ||
gas=21001, # non-default for testing purposes | ||
to=TO_ADDRESS, | ||
value=4321, | ||
data=b'test', | ||
) | ||
return unsigned_txn.as_signed_transaction(sender) | ||
|
||
|
||
def test_basic_create_transaction(chain, basic_transaction): | ||
transaction = chain.create_transaction( | ||
nonce=basic_transaction.nonce, | ||
gas_price=basic_transaction.gas_price, | ||
gas=basic_transaction.gas, | ||
to=basic_transaction.to, | ||
value=basic_transaction.value, | ||
data=basic_transaction.data, | ||
v=basic_transaction.v, | ||
r=basic_transaction.r, | ||
s=basic_transaction.s, | ||
) | ||
assert transaction == basic_transaction | ||
|
||
|
||
def test_basic_create_unsigned_transaction(chain): | ||
transaction = chain.create_unsigned_transaction( | ||
nonce=0, | ||
gas_price=1234, | ||
gas=21001, | ||
to=TO_ADDRESS, | ||
value=4321, | ||
data=b'test', | ||
) | ||
assert transaction.nonce == 0 | ||
assert transaction.gas_price == 1234 | ||
assert transaction.gas == 21001 | ||
assert transaction.to == TO_ADDRESS | ||
assert transaction.value == 4321 | ||
assert transaction.data == b'test' |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.