mirror of
https://github.com/fluencelabs/eip712-validation-node
synced 2025-06-24 04:01:49 +00:00
update services
This commit is contained in:
32
aqua/demo_validation.aqua
Normal file
32
aqua/demo_validation.aqua
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
data PVResponse:
|
||||||
|
peer_id: string
|
||||||
|
timestamp: u64
|
||||||
|
eip_validation: bool
|
||||||
|
ts_validation: bool
|
||||||
|
|
||||||
|
data DBResponse:
|
||||||
|
snapshot_id: u64
|
||||||
|
|
||||||
|
service ProVoValidation("EIPValidator"):
|
||||||
|
eip712_validation_string(eip_str: string, peer_id: string) -> string
|
||||||
|
eip712_validation_url(eip_str: string, peer_id: string) -> string
|
||||||
|
|
||||||
|
service DataProvider("DataProvider"):
|
||||||
|
get_records() -> []DBResponse
|
||||||
|
get_record(snapshot_id: u64) -> DBResponse
|
||||||
|
|
||||||
|
|
||||||
|
func validate(eip712_url: string, node: string, relay:string) -> string:
|
||||||
|
on node via relay:
|
||||||
|
res <- ProVoValidation.eip712_validation_url(eip712_url, node)
|
||||||
|
<- res
|
||||||
|
|
||||||
|
func get_all_validations(node: string, relay:string) -> []DBResponse:
|
||||||
|
on node via relay:
|
||||||
|
res <- DataProvider.get_records()
|
||||||
|
<- res
|
||||||
|
|
||||||
|
func get_validation(snapshot_id: u64, node: string, relay:string) -> DBResponse:
|
||||||
|
on node via relay:
|
||||||
|
res <- DataProvider.get_record(snapshot_id)
|
||||||
|
<- res
|
@ -71,12 +71,12 @@ class EIPValidator implements ProVoValidationDef {
|
|||||||
class DataProvider implements DataProviderDef {
|
class DataProvider implements DataProviderDef {
|
||||||
|
|
||||||
get_record(snapshot_id: number) {
|
get_record(snapshot_id: number) {
|
||||||
// todo: add pagination
|
|
||||||
return select_event(snapshot_id);
|
return select_event(snapshot_id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get_records() {
|
get_records() {
|
||||||
|
// todo: add pagination
|
||||||
return select_events();
|
return select_events();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -108,8 +108,8 @@ async function main() {
|
|||||||
// console.log(peer);
|
// console.log(peer);
|
||||||
// console.log(Fluence.KeyPair);
|
// console.log(Fluence.KeyPair);
|
||||||
|
|
||||||
registerProVoValidation(new EIPValidator());
|
registerProVoValidation("EIPValidator", new EIPValidator());
|
||||||
registerDataProvider(new DataProvider);
|
registerDataProvider("DataProvider", new DataProvider);
|
||||||
|
|
||||||
// const eip_doc: any = await got('https://ipfs.fleek.co/ipfs/QmWGzSQFm57ohEq2ATw4UNHWmYU2HkMjtedcNLodYywpmS').json();
|
// const eip_doc: any = await got('https://ipfs.fleek.co/ipfs/QmWGzSQFm57ohEq2ATw4UNHWmYU2HkMjtedcNLodYywpmS').json();
|
||||||
// console.log("eip json obj: ", eip_doc);
|
// console.log("eip json obj: ", eip_doc);
|
||||||
|
Reference in New Issue
Block a user