Skip to content

Commit

Permalink
Merge pull request #131 from eric-volz/node/issues
Browse files Browse the repository at this point in the history
Change Evm class typing and add EVM, DVM constants
  • Loading branch information
eric-volz authored Nov 5, 2023
2 parents 882f280 + ce11e25 commit 3f07aba
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions defichain/node/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Just to be present: Node
from defichain.node.modules.accounts import Accounts
from defichain.node.modules.accounts import Accounts, DVM, EVM
from defichain.node.modules.blockchain import Blockchain
from defichain.node.modules.control import Control
from defichain.node.modules.evm import EVM
from defichain.node.modules.evm import Evm
from defichain.node.modules.generating import Generating
from defichain.node.modules.loan import Loan
from defichain.node.modules.masternodes import Masternodes
Expand Down
2 changes: 2 additions & 0 deletions defichain/node/modules/accounts.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from ..util import BuildJson

DVM: int = 2
EVM: int = 3

class Accounts:
def __init__(self, node):
Expand Down
2 changes: 1 addition & 1 deletion defichain/node/modules/evm.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class EVM:
class Evm:
def __init__(self, node):
self._node = node

Expand Down
4 changes: 2 additions & 2 deletions defichain/node/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from .modules.accounts import Accounts
from .modules.blockchain import Blockchain
from .modules.control import Control
from .modules.evm import EVM
from .modules.evm import Evm
from .modules.generating import Generating
from .modules.loan import Loan
from .modules.masternodes import Masternodes
Expand Down Expand Up @@ -94,7 +94,7 @@ def __init__(self, user: str, password: str, url: str = "127.0.0.1", port: int =
self.accounts = Accounts(self)
self.blockchain = Blockchain(self)
self.control = Control(self)
self.evm = EVM(self)
self.evm = Evm(self)
self.generating = Generating(self)
self.icxorderbook = None
self.loan = Loan(self)
Expand Down
6 changes: 3 additions & 3 deletions defichain/node/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,11 @@ class BuildTransferDomainData:
:example:
>>> from defichain.node import BuildTransferDomainData
>>> from defichain.node import BuildTransferDomainData, DVM, EVM
>>>
>>> transferdomain_data = BuildTransferDomainData()
>>> transferdomain_data.add_transfer("dvm_address", "evm_address", "1@DFI", 2, 3)
>>> transferdomain_data.add_transfer("evm_address", "dvm_address", "1@DFI", 3, 2)
>>> transferdomain_data.add_transfer("dvm_address", "evm_address", "1@DFI", DVM, EVM)
>>> transferdomain_data.add_transfer("evm_address", "dvm_address", "1@DFI", EVM, DVM)
>>> transferdomain_data.build()
"""

Expand Down

0 comments on commit 3f07aba

Please sign in to comment.