Merge pull request #80 from bugout-dev/xdai-support

xdai support
pull/83/head v0.2.4
Sergei Sumarokov 2022-05-25 17:17:09 +03:00 zatwierdzone przez GitHub
commit f42717c826
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
3 zmienionych plików z 12 dodań i 2 usunięć

Wyświetl plik

@ -9,6 +9,7 @@ from moonstreamdb.models import (
EthereumTransaction,
PolygonLabel,
PolygonTransaction,
XDaiTransaction,
)
from sqlalchemy.orm import Session
from sqlalchemy.sql.base import NO_ARG
@ -77,7 +78,7 @@ class MoonstreamEthereumStateProvider(EthereumStateProvider):
@staticmethod
def _transform_to_w3_tx(
tx_raw: Union[EthereumTransaction, PolygonTransaction],
tx_raw: Union[EthereumTransaction, PolygonTransaction, XDaiTransaction],
) -> Dict[str, Any]:
tx = {
"blockNumber": tx_raw.block_number,

Wyświetl plik

@ -9,12 +9,16 @@ from moonstreamdb.models import (
PolygonBlock,
PolygonLabel,
PolygonTransaction,
XDaiBlock,
XDaiLabel,
XDaiTransaction,
)
class Network(Enum):
ethereum = "ethereum"
polygon = "polygon"
xdai = "xdai"
MODELS: Dict[Network, Dict[str, Base]] = {
@ -28,4 +32,9 @@ MODELS: Dict[Network, Dict[str, Base]] = {
"labels": PolygonLabel,
"transactions": PolygonTransaction,
},
Network.xdai: {
"blocks": XDaiBlock,
"labels": XDaiLabel,
"transactions": XDaiTransaction,
},
}

Wyświetl plik

@ -1 +1 @@
MOONWORM_VERSION = "0.2.3"
MOONWORM_VERSION = "0.2.4"