diff --git a/seedemu/layers/ScionRouting.py b/seedemu/layers/ScionRouting.py index debf83618..8b83b62c8 100644 --- a/seedemu/layers/ScionRouting.py +++ b/seedemu/layers/ScionRouting.py @@ -3,7 +3,6 @@ import os.path from typing import Dict -import yaml from seedemu.core import Emulator, Node, ScionAutonomousSystem, ScionRouter from seedemu.layers import Routing, ScionBase, ScionIsd @@ -175,6 +174,8 @@ def __provision_router_config(router: ScionRouter): def _provision_cs_config(node: Node, as_: ScionAutonomousSystem): """Set control service configuration.""" + import yaml + # Start building the beaconing section beaconing = ["[beaconing]"] interval_keys = ["origination_interval", "propagation_interval", "registration_interval"] diff --git a/seedemu/services/EthereumService/EthUtil.py b/seedemu/services/EthereumService/EthUtil.py index 8eb00c3b3..7adffda00 100644 --- a/seedemu/services/EthereumService/EthUtil.py +++ b/seedemu/services/EthereumService/EthUtil.py @@ -5,7 +5,6 @@ from datetime import datetime, timezone from os import path from .EthTemplates import GenesisFileTemplates -from web3 import Web3 from sys import stderr from time import time @@ -13,7 +12,6 @@ class Genesis(): """! @brief Genesis manage class """ - __genesis:dict __consensusMechanism:ConsensusMechanism @@ -70,6 +68,7 @@ def addLocalAccount(self, address:str, balance:int) -> Genesis: @returns self, for chaining calls. """ + from web3 import Web3 assert balance >= 0, "Genesis::allocateBalance: balance cannot have a negative value. Requested Balance Value : {}".format(balance) checksum_address = Web3.toChecksumAddress(address) @@ -148,7 +147,6 @@ class EthAccount(): """ @brief Ethereum Local Account. """ - @staticmethod def importAccount(keyfilePath: str, balance:int, password = "admin"): """ @@ -181,6 +179,8 @@ def __encryptAccount(account, password:str): @staticmethod def createEmulatorAccountFromMnemonic(id:int, mnemonic:str, balance:int, index:int, password:str): from eth_account import Account + from web3 import Web3 + Account.enable_unaudited_hdwallet_features() EthAccount._log('creating node_{} emulator account {} from mnemonic...'.format(id, index)) diff --git a/seedemu/services/EthereumService/__init__.py b/seedemu/services/EthereumService/__init__.py index 8d1e7da3f..285e901d2 100644 --- a/seedemu/services/EthereumService/__init__.py +++ b/seedemu/services/EthereumService/__init__.py @@ -6,5 +6,5 @@ from .EthTemplates import * from .EthEnum import ConsensusMechanism, Syncmode, EthereumServerTypes from .EthUtil import Genesis, AccountStructure, SmartContract, EthAccount -from .EthereumServer import * -from .EthereumService import * \ No newline at end of file +from .EthereumServer import EthereumServer, PoAServer, PoWServer, PoSServer, BeaconSetupServer +from .EthereumService import Blockchain, EthereumService \ No newline at end of file