null.py (616B)
1 # standard imports 2 import os 3 import logging 4 import json 5 6 logg = logging.getLogger(__name__) 7 8 9 class NullStore: 10 11 def put_tx(self, tx, include_data=False): 12 pass 13 14 15 def put_block(self, block, include_data=False): 16 pass 17 18 19 def get_block_number(self, v): 20 raise FileNotFoundError(v) 21 22 23 def get_block(self, v): 24 raise FileNotFoundError(v) 25 26 27 def get_tx(self, v): 28 raise FileNotFoundError(v) 29 30 31 def get_rcpt(self, v): 32 raise FileNotFoundError(v) 33 34 35 def __init__(self): 36 self.chain_dir = '/dev/null' 37 38 39 def __str__(self): 40 return "Nullstore"