kopia lustrzana https://github.com/bugout-dev/moonworm
black formating.
rodzic
cc6032fad0
commit
6ca373ce36
|
@ -183,7 +183,6 @@ def handle_watch(args: argparse.Namespace) -> None:
|
|||
state_provider.clear_db_session()
|
||||
|
||||
else:
|
||||
|
||||
watch_contract(
|
||||
web3=web3,
|
||||
state_provider=Web3StateProvider(web3),
|
||||
|
|
|
@ -43,7 +43,6 @@ if __name__ == "__main__":
|
|||
]
|
||||
|
||||
def run():
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
print("Usage: eventscanner.py http://your-node-url")
|
||||
sys.exit(1)
|
||||
|
|
|
@ -303,7 +303,6 @@ class EventScanner:
|
|||
all_processed = []
|
||||
|
||||
for event_type in self.events:
|
||||
|
||||
# Callable that takes care of the underlying web3 call
|
||||
def _fetch_events(_start_block, _end_block):
|
||||
return _fetch_events_chunk(
|
||||
|
@ -385,7 +384,6 @@ class EventScanner:
|
|||
all_processed = []
|
||||
|
||||
while current_block <= end_block:
|
||||
|
||||
self.state.start_chunk(current_block, chunk_size)
|
||||
|
||||
# Print some diagnostics to logs to try to fiddle with real world JSON-RPC API performance
|
||||
|
|
|
@ -12,6 +12,7 @@ from .networks import MODELS, Network, tx_raw_types
|
|||
logging.basicConfig(level=logging.INFO)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
# TODO(yhtiyar) When getting block from db, filter it by `to` address, it will be faster
|
||||
# also get blocks in bunch
|
||||
class MoonstreamEthereumStateProvider(EthereumStateProvider):
|
||||
|
|
|
@ -341,7 +341,6 @@ def generate_contract_constructor_function(
|
|||
|
||||
|
||||
def generate_contract_function(func_object: Dict[str, Any]) -> cst.FunctionDef:
|
||||
|
||||
default_param_name = "arg"
|
||||
default_counter = 1
|
||||
func_params = []
|
||||
|
|
|
@ -235,7 +235,6 @@ def generate_brownie_contract_function(
|
|||
f"return self.contract.{func_raw_name}({','.join(param_names)})"
|
||||
)
|
||||
else:
|
||||
|
||||
func_params.append(
|
||||
cst.Param(
|
||||
name=cst.Name(value="block_number"),
|
||||
|
|
|
@ -52,7 +52,6 @@ class MoonwormEthTesterTestCase(unittest.TestCase):
|
|||
send_value,
|
||||
tx_receipt,
|
||||
):
|
||||
|
||||
assert receiver_current_balance == receiver_previous_balance + send_value
|
||||
assert (
|
||||
sender_current_balance
|
||||
|
@ -60,7 +59,6 @@ class MoonwormEthTesterTestCase(unittest.TestCase):
|
|||
)
|
||||
|
||||
def test_submit_transaction(self) -> None:
|
||||
|
||||
sender = Web3.toChecksumAddress(PK_ADDRESS)
|
||||
self.web3.eth.send_transaction
|
||||
receiver = Web3.toChecksumAddress(self.web3.eth.accounts[1])
|
||||
|
@ -95,7 +93,6 @@ class MoonwormEthTesterTestCase(unittest.TestCase):
|
|||
)
|
||||
|
||||
def test_submit_signed_transaction(self) -> None:
|
||||
|
||||
sender = Web3.toChecksumAddress(PK_ADDRESS)
|
||||
self.web3.eth.send_transaction
|
||||
receiver = Web3.toChecksumAddress(self.web3.eth.accounts[1])
|
||||
|
|
|
@ -53,7 +53,6 @@ def get_nonce(web3: Web3, address: ChecksumAddress) -> Nonce:
|
|||
def submit_transaction(
|
||||
web3: Web3, transaction: Union[TxParams, Any], signer_private_key: str
|
||||
) -> HexBytes:
|
||||
|
||||
"""
|
||||
Signs and submits json transaction to blockchain from the name of signer
|
||||
"""
|
||||
|
|
Ładowanie…
Reference in New Issue