Skip to content

Commit

Permalink
lint: fix isort
Browse files Browse the repository at this point in the history
  • Loading branch information
fubuloubu committed Mar 7, 2021
1 parent a8a6528 commit d3a71f4
Show file tree
Hide file tree
Showing 14 changed files with 39 additions and 53 deletions.
15 changes: 7 additions & 8 deletions ethervm.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
from flask import Flask
from flask_table import Table, Col # type: ignore

from evm_asm import disassemble, evm_opcodes, LATEST_VERSION
from evm_asm.typing import Bytecode

from flask_table import Col, Table # type: ignore
from web3.auto.infura.goerli import w3 as goerli_w3
from web3.auto.infura.kovan import w3 as kovan_w3
from web3.auto.infura.mainnet import w3 as mainnet_w3
from web3.auto.infura.ropsten import w3 as ropsten_w3
from web3.auto.infura.rinkeby import w3 as rinkeby_w3
from web3.auto.infura.kovan import w3 as kovan_w3
from web3.auto.infura.goerli import w3 as goerli_w3
from web3.auto.infura.ropsten import w3 as ropsten_w3

from evm_asm import LATEST_VERSION, disassemble, evm_opcodes
from evm_asm.typing import Bytecode

AVAILABLE_WEB3 = {
"mainnet": mainnet_w3,
Expand Down
14 changes: 2 additions & 12 deletions evm_asm/assembler.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
from typing import Dict, Optional, Tuple

from evm_asm.errors import (
InvalidOpcodeInput,
UnsupportedOpcode,
)
from evm_asm.typing import (
Assembly,
Bytecode,
Metadata,
Opcode,
OpcodeValue,
)
from evm_asm.errors import InvalidOpcodeInput, UnsupportedOpcode
from evm_asm.forks import Fork

from evm_asm.typing import Assembly, Bytecode, Metadata, Opcode, OpcodeValue

END_OPCODES = (
0x00, # STOP
Expand Down
11 changes: 5 additions & 6 deletions evm_asm/forks/__init__.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
from typing import Iterator

from .base import Fork

from .frontier import Frontier
from .homestead import Homestead
from .tangerine_whistle import TangerineWhistle
from .spurious_dragon import SpuriousDragon
from .byzantium import Byzantium
from .constantinople import Constantinople
from .petersburg import Petersburg
from .frontier import Frontier
from .homestead import Homestead
from .istanbul import Istanbul
from .muir_glacier import MuirGlacier
from .petersburg import Petersburg
from .spurious_dragon import SpuriousDragon
from .tangerine_whistle import TangerineWhistle


class EvmForks:
Expand Down
14 changes: 3 additions & 11 deletions evm_asm/forks/base.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
from typing import Dict, Iterator, Tuple

import re
from collections import OrderedDict
from typing import Dict, Iterator, Tuple

from evm_asm.errors import (
UnsupportedOpcode,
)
from evm_asm.typing import (
Mnemonic,
Opcode,
OpcodeLike,
OpcodeValue,
)
from evm_asm.errors import UnsupportedOpcode
from evm_asm.typing import Mnemonic, Opcode, OpcodeLike, OpcodeValue


class Fork:
Expand Down
3 changes: 2 additions & 1 deletion evm_asm/forks/byzantium.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from .spurious_dragon import SpuriousDragon
from evm_asm.typing import Opcode

from .spurious_dragon import SpuriousDragon


class Byzantium(SpuriousDragon):
REVERT = Opcode("REVERT", 0, 0xFD)
Expand Down
3 changes: 2 additions & 1 deletion evm_asm/forks/constantinople.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from .byzantium import Byzantium
from evm_asm.typing import Opcode

from .byzantium import Byzantium


class Constantinople(Byzantium):
SHL = Opcode("SHL", 3, 0x1B)
Expand Down
3 changes: 2 additions & 1 deletion evm_asm/forks/frontier.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from .base import Fork
from evm_asm.typing import Opcode

from .base import Fork


class Frontier(Fork):
STOP = Opcode("STOP", 0, 0x00)
Expand Down
3 changes: 2 additions & 1 deletion evm_asm/forks/homestead.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from .frontier import Frontier
from evm_asm.typing import Opcode

from .frontier import Frontier


class Homestead(Frontier):
DELEGATECALL = Opcode("DELEGATECALL", 40, 0xF4)
3 changes: 2 additions & 1 deletion evm_asm/forks/istanbul.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from .petersburg import Petersburg
from evm_asm.typing import Opcode

from .petersburg import Petersburg


class Istanbul(Petersburg):
BALANCE = Opcode("BALANCE", 700, 0x31)
Expand Down
3 changes: 2 additions & 1 deletion evm_asm/forks/petersburg.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from .byzantium import Byzantium
from evm_asm.typing import Opcode

from .byzantium import Byzantium


class Petersburg(Byzantium):
SHL = Opcode("SHL", 3, 0x1B)
Expand Down
3 changes: 2 additions & 1 deletion evm_asm/forks/tangerine_whistle.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from .homestead import Homestead
from evm_asm.typing import Opcode

from .homestead import Homestead


class TangerineWhistle(Homestead):
BALANCE = Opcode("BALANCE", 400, 0x31)
Expand Down
3 changes: 1 addition & 2 deletions evm_asm/typing.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from dataclasses import dataclass
from typing import Iterable, Optional, NewType, Union

from typing import Iterable, NewType, Optional, Union

# TODO https://ethervm.io/

Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest

from eth.vm import forks as pyevm_forks

from evm_asm import evm_opcodes


Expand Down
12 changes: 6 additions & 6 deletions tools/fork_gen.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import sys
import pathlib
import sys

path = str(pathlib.Path(__file__).absolute().parent.parent)
sys.path.insert(0, path)

from eth.vm.forks.frontier.opcodes import FRONTIER_OPCODES
from eth.vm.forks.homestead.opcodes import HOMESTEAD_OPCODES
from eth.vm.forks.tangerine_whistle.opcodes import TANGERINE_WHISTLE_OPCODES
from eth.vm.forks.spurious_dragon.opcodes import SPURIOUS_DRAGON_OPCODES
from eth.vm.forks.byzantium.opcodes import BYZANTIUM_OPCODES
from eth.vm.forks.constantinople.opcodes import CONSTANTINOPLE_OPCODES
from eth.vm.forks.petersburg.opcodes import PETERSBURG_OPCODES
from eth.vm.forks.frontier.opcodes import FRONTIER_OPCODES
from eth.vm.forks.homestead.opcodes import HOMESTEAD_OPCODES
from eth.vm.forks.istanbul.opcodes import ISTANBUL_OPCODES
from eth.vm.forks.muir_glacier.opcodes import MUIR_GLACIER_OPCODES
from eth.vm.forks.petersburg.opcodes import PETERSBURG_OPCODES
from eth.vm.forks.spurious_dragon.opcodes import SPURIOUS_DRAGON_OPCODES
from eth.vm.forks.tangerine_whistle.opcodes import TANGERINE_WHISTLE_OPCODES

PY_EVM_FORKS = {
"frontier": FRONTIER_OPCODES,
Expand Down

0 comments on commit d3a71f4

Please sign in to comment.