Skip to content

Commit

Permalink
historian: Rename the parser module to gossipd
Browse files Browse the repository at this point in the history
We were getting a couple of path/import conflicts, renaming just to be
safe.
  • Loading branch information
cdecker committed Jan 22, 2021
1 parent 6ec876e commit 70be79c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion historian/cli/common.py
Expand Up @@ -5,7 +5,7 @@
from common import Base
import io
from pyln.proto.primitives import varint_decode
from parser import parse
from gossipd import parse
import click
import bz2

Expand Down
2 changes: 1 addition & 1 deletion historian/cli/db.py
@@ -1,7 +1,7 @@
import click
from common import NodeAnnouncement, ChannelAnnouncement, ChannelUpdate
from tqdm import tqdm
from parser import parse
from gossipd import parse
from cli.common import db_session, default_db


Expand Down
8 changes: 4 additions & 4 deletions historian/common.py
Expand Up @@ -2,7 +2,7 @@
from datetime import datetime
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, BigInteger, SmallInteger, DateTime, LargeBinary
import parser
import gossipd
from contextlib import contextmanager
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
Expand All @@ -27,7 +27,7 @@ class ChannelUpdate(Base):
raw = Column(LargeBinary)

@classmethod
def from_gossip(cls, gcu: parser.ChannelUpdate,
def from_gossip(cls, gcu: gossipd.ChannelUpdate,
raw: bytes) -> 'ChannelUpdate':
assert(raw[:2] == b'\x01\x02')
self = ChannelUpdate()
Expand All @@ -53,7 +53,7 @@ class ChannelAnnouncement(Base):
raw = Column(LargeBinary)

@classmethod
def from_gossip(cls, gca: parser.ChannelAnnouncement,
def from_gossip(cls, gca: gossipd.ChannelAnnouncement,
raw: bytes) -> 'ChannelAnnouncement':
assert(raw[:2] == b'\x01\x00')
self = ChannelAnnouncement()
Expand All @@ -76,7 +76,7 @@ class NodeAnnouncement(Base):
raw = Column(LargeBinary)

@classmethod
def from_gossip(cls, gna: parser.NodeAnnouncement,
def from_gossip(cls, gna: gossipd.NodeAnnouncement,
raw: bytes) -> 'NodeAnnouncement':
assert(raw[:2] == b'\x01\x01')
self = NodeAnnouncement()
Expand Down
File renamed without changes.
5 changes: 2 additions & 3 deletions historian/historian.py
@@ -1,15 +1,14 @@
#!/usr/bin/env python3
from inotify import constants
from inotify.adapters import Inotify
from parser import parse
from pyln.client import Plugin
from sqlalchemy import create_engine
from sqlalchemy import desc
from sqlalchemy.orm import sessionmaker
from threading import Thread
from common import Base, ChannelAnnouncement, ChannelUpdate, NodeAnnouncement
import logging
import parser
import gossipd
import struct
import time

Expand Down Expand Up @@ -152,7 +151,7 @@ def run(self):

def store(self, raw: bytes) -> None:
try:
msg = parse(raw)
msg = gossipd.parse(raw)
cls = None
if isinstance(msg, parser.ChannelUpdate):
cls = ChannelUpdate
Expand Down

0 comments on commit 70be79c

Please sign in to comment.