2021-09-30 14:06:59 -05:00
|
|
|
data PVResponse:
|
|
|
|
peer_id: string
|
|
|
|
timestamp: u64
|
|
|
|
eip_validation: bool
|
|
|
|
ts_validation: bool
|
|
|
|
|
|
|
|
data DBResponse:
|
|
|
|
snapshot_id: u64
|
|
|
|
|
|
|
|
service ProVoValidation("eip_validation"):
|
2021-09-30 18:33:10 -05:00
|
|
|
eip712_validation(eip_str: string, peer_id: string) -> PVResponse
|
2021-09-30 14:06:59 -05:00
|
|
|
|
|
|
|
service DataProvider(""):
|
2021-09-30 18:33:10 -05:00
|
|
|
get_records() -> []DBResponse
|
|
|
|
get_record(snapshot_id: u64) -> DBResponse
|
2021-09-30 14:06:59 -05:00
|
|
|
|
|
|
|
|
2021-09-30 18:33:10 -05:00
|
|
|
func validate(relay: string, peer:string, eip712_json: string) -> PVResponse:
|
2021-09-30 14:06:59 -05:00
|
|
|
on peer via relay:
|
2021-09-30 18:33:10 -05:00
|
|
|
result <- ProVoValidation.eip712_validation(eip712_json, peer)
|
2021-09-30 14:06:59 -05:00
|
|
|
<- result
|
|
|
|
|
|
|
|
|
|
|
|
func get_record(relay:string, peer:string, snapshot_id: u64) -> DBResponse:
|
|
|
|
on peer via relay:
|
|
|
|
result <- DataProvider.get_record(snapshot_id)
|
|
|
|
<- result
|
|
|
|
|
|
|
|
|
|
|
|
func get_records(relay:string, peer:string) -> []DBResponse:
|
|
|
|
on peer via relay:
|
|
|
|
result <- DataProvider.get_records()
|
|
|
|
<- result
|
|
|
|
|
|
|
|
|