From 7f144511414aec4d3c8efa247baea88cb7059e5c Mon Sep 17 00:00:00 2001
From: Bo QIU <35757521+boqiu@users.noreply.github.com>
Date: Fri, 13 Sep 2024 07:40:43 +0800
Subject: [PATCH] Add zgs rpc to check file finality (#196)
* Add tx seq or root enum
* Add zgs rpc to check file finality
* trailing whitespace
---
Cargo.lock | 1 +
node/rpc/src/zgs/api.rs | 5 ++-
node/rpc/src/zgs/impl.rs | 27 +++++++++++-
node/shared_types/Cargo.toml | 3 ++
node/shared_types/src/lib.rs | 85 ++++++++++++++++++++++++++++++++++++
5 files changed, 119 insertions(+), 2 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
index 470227a..9dca6e3 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -7017,6 +7017,7 @@ dependencies = [
"merkle_light",
"merkle_tree",
"serde",
+ "serde_json",
"tiny-keccak",
"tracing",
"typenum",
diff --git a/node/rpc/src/zgs/api.rs b/node/rpc/src/zgs/api.rs
index 2ed6fa3..7a55db2 100644
--- a/node/rpc/src/zgs/api.rs
+++ b/node/rpc/src/zgs/api.rs
@@ -1,7 +1,7 @@
use crate::types::{FileInfo, Segment, SegmentWithProof, Status};
use jsonrpsee::core::RpcResult;
use jsonrpsee::proc_macros::rpc;
-use shared_types::{DataRoot, FlowProof};
+use shared_types::{DataRoot, FlowProof, TxSeqOrRoot};
use storage::config::ShardConfig;
#[rpc(server, client, namespace = "zgs")]
@@ -30,6 +30,9 @@ pub trait Rpc {
index: usize,
) -> RpcResult