fix broken aave classifier spec
This commit is contained in:
parent
790fbee002
commit
72569a576a
1
cache/12498502-new.json
vendored
Normal file
1
cache/12498502-new.json
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -13,16 +13,19 @@ ABI_DIRECTORY_PATH = THIS_FILE_DIRECTORY / "abis"
|
|||||||
|
|
||||||
|
|
||||||
def get_abi(abi_name: str, protocol: Optional[Protocol]) -> Optional[ABI]:
|
def get_abi(abi_name: str, protocol: Optional[Protocol]) -> Optional[ABI]:
|
||||||
|
|
||||||
abi_filename = f"{abi_name}.json"
|
abi_filename = f"{abi_name}.json"
|
||||||
abi_path = (
|
abi_path = (
|
||||||
ABI_DIRECTORY_PATH / abi_filename
|
ABI_DIRECTORY_PATH / abi_filename
|
||||||
if protocol is None
|
if protocol is None
|
||||||
else ABI_DIRECTORY_PATH / protocol.value / abi_filename
|
else ABI_DIRECTORY_PATH / protocol.value / abi_filename
|
||||||
)
|
)
|
||||||
|
#import pdb; pdb.set_trace()
|
||||||
if abi_path.is_file():
|
if abi_path.is_file():
|
||||||
with abi_path.open() as abi_file:
|
with abi_path.open() as abi_file:
|
||||||
abi_json = json.load(abi_file)
|
abi_json = json.load(abi_file)
|
||||||
return parse_obj_as(ABI, abi_json)
|
return parse_obj_as(ABI, abi_json)
|
||||||
|
|
||||||
|
import pdb; pdb.set_trace()
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
@ -101,7 +101,7 @@ ERC20_SPEC = ClassifierSpec(
|
|||||||
|
|
||||||
AAVE_SPEC = ClassifierSpec(
|
AAVE_SPEC = ClassifierSpec(
|
||||||
abi_name="AaveLendingPool",
|
abi_name="AaveLendingPool",
|
||||||
protocol= Protocol.aave
|
protocol= Protocol.aave,
|
||||||
classifications={
|
classifications={
|
||||||
"liquidationCall(address,address,address,uint256,bool)": Classification.liquidate,
|
"liquidationCall(address,address,address,uint256,bool)": Classification.liquidate,
|
||||||
},
|
},
|
||||||
|
@ -11,6 +11,7 @@ class Classification(Enum):
|
|||||||
swap = "swap"
|
swap = "swap"
|
||||||
burn = "burn"
|
burn = "burn"
|
||||||
transfer = "transfer"
|
transfer = "transfer"
|
||||||
|
liquidate = "liquidate"
|
||||||
|
|
||||||
|
|
||||||
class Protocol(Enum):
|
class Protocol(Enum):
|
||||||
|
@ -17,9 +17,11 @@ class TraceClassifier:
|
|||||||
self._decoders_by_abi_name: Dict[str, ABIDecoder] = {}
|
self._decoders_by_abi_name: Dict[str, ABIDecoder] = {}
|
||||||
|
|
||||||
for spec in self._classifier_specs:
|
for spec in self._classifier_specs:
|
||||||
|
#import pdb; pdb.set_trace()
|
||||||
abi = get_abi(spec.abi_name, spec.protocol)
|
abi = get_abi(spec.abi_name, spec.protocol)
|
||||||
|
|
||||||
if abi is None:
|
if abi is None:
|
||||||
|
import pdb; pdb.set_trace()
|
||||||
raise ValueError(f"No ABI found for {spec.abi_name}")
|
raise ValueError(f"No ABI found for {spec.abi_name}")
|
||||||
|
|
||||||
decoder = ABIDecoder(abi)
|
decoder = ABIDecoder(abi)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user