eip712-validation-node/aqua/demo_validation.aqua

53 lines
1.4 KiB
Plaintext
Raw Normal View History

2021-10-24 12:32:30 -05:00
data DBRecord:
snapshot_id: u64
event_address: string
event_signature: string
eip712_doc: string
2021-10-11 01:36:53 -05:00
peer_id: string
timestamp: u64
eip_validation: bool
ts_validation: bool
2021-10-24 12:32:30 -05:00
signed_response: string
2021-10-11 01:36:53 -05:00
2021-10-24 12:32:30 -05:00
data DBResult:
stderr: string
stdout: []DBRecord
2021-10-11 01:36:53 -05:00
2021-10-24 12:32:30 -05:00
service EIPValidator("EIPValidator"):
2021-10-11 01:36:53 -05:00
eip712_validation_string(eip_str: string, peer_id: string) -> string
eip712_validation_url(eip_str: string, peer_id: string) -> string
service DataProvider("DataProvider"):
2021-10-24 12:32:30 -05:00
get_records() -> DBResult
get_record(snapshot_id: u64) -> DBResult
get_record_count() -> u64
clear_table(password: string) -> DBResult
2021-10-11 01:36:53 -05:00
func validate(eip712_url: string, node: string, relay:string) -> string:
on node via relay:
2021-10-24 12:32:30 -05:00
res <- EIPValidator.eip712_validation_url(eip712_url, node)
2021-10-11 01:36:53 -05:00
<- res
2021-10-24 12:32:30 -05:00
func get_records(node: string, relay:string) -> DBResult:
2021-10-11 01:36:53 -05:00
on node via relay:
res <- DataProvider.get_records()
<- res
2021-10-24 12:32:30 -05:00
func get_record(snapshot_id: u64, node: string, relay:string) -> DBResult:
2021-10-11 01:36:53 -05:00
on node via relay:
res <- DataProvider.get_record(snapshot_id)
2021-10-24 12:32:30 -05:00
<- res
func get_record_count(node: string, relay:string) -> u64:
on node via relay:
res <- DataProvider.get_record_count()
<- res
func delete_rows(password: string, node: string, relay:string) -> DBResult:
on node via relay:
result <- DataProvider.clear_table(password)
<- result