Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT MERGE] Testing validator_service.py #1

Open
wants to merge 20 commits into
base: dev_env
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@ docs/_build
# IDE crud
.idea
*.iml
.vscode
25 changes: 10 additions & 15 deletions pyethapp/eth_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,21 +166,16 @@ def __init__(self, app):
super(ChainService, self).__init__(app)
log.info('initializing chain')
coinbase = app.services.accounts.coinbase
# env = Env(self.db, sce['block'])

# genesis_data = sce.get('genesis_data', {})
# if not genesis_data:
# genesis_data = mk_genesis_data(env)
# self.chain = Chain(
# env=env, genesis=genesis_data, coinbase=coinbase,
# new_head_cb=self._on_new_head)
ALLOC = {}
# TODO: Remove this dumb default alloc
ALLOC[decode_hex('7d577a597b2742b498cb5cf0c26cdcd726d39e6e')] = {'balance': 50000*10**19}
ALLOC[decode_hex('b96611e02f9eff3c8afc6226d4ebfa81a821547c')] = {'balance': 50000*10**19}
ALLOC[decode_hex('b42e5cafe87d951c5cf0022bfdab06fe56ba2ad2')] = {'balance': 5 * 10**9 * 10**19}
genesis_data = casper_utils.make_casper_genesis(ALLOC, 10, 100, 0.02, 0.002)
self.chain = Chain(genesis=genesis_data, reset_genesis=True, coinbase=coinbase, new_head_cb=self._on_new_head)
env = Env(self.db, sce['block'])

genesis_data = sce.get('genesis_data', {})
if not genesis_data:
genesis_data = casper_utils.make_casper_genesis(env)
self.chain = Chain(
genesis=genesis_data,
reset_genesis=True,
coinbase=coinbase,
new_head_cb=self._on_new_head)
header = self.chain.state.prev_headers[0]
log.info('chain at', number=header.number)
if 'genesis_hash' in sce:
Expand Down
Loading