WIP add transaction server

This commit is contained in:
nolash
2021-06-02 12:59:04 +02:00
parent ca4f7c9b8e
commit eca9dd95d6
9 changed files with 322 additions and 1 deletions

View File

@@ -0,0 +1,20 @@
# external imports
from chainlib.eth.tx import (
unpack,
)
from hexathon import add_0x
# local imports
class EthAdapter:
def __init__(self, backend):
self.backend = backend
def add(self, chain_spec, bytecode):
tx = unpack(bytecode, chain_spec)
session = self.backend.create_session()
self.backend.create(chain_spec, tx['nonce'], tx['from'], tx['hash'], add_0x(bytecode.hex()), session=session)
session.close()