From ab95d6181be16fb22c3523e80aae862b97d2ad6f Mon Sep 17 00:00:00 2001 From: Bogdan Mircea Date: Thu, 4 May 2023 11:02:47 +0300 Subject: [PATCH] Trimmed down ledger traits Signed-off-by: Bogdan Mircea --- aries_vcx_core/src/ledger/ledger.rs | 54 ++--------------------------- 1 file changed, 2 insertions(+), 52 deletions(-) diff --git a/aries_vcx_core/src/ledger/ledger.rs b/aries_vcx_core/src/ledger/ledger.rs index 727d35ed94..74a51cd920 100644 --- a/aries_vcx_core/src/ledger/ledger.rs +++ b/aries_vcx_core/src/ledger/ledger.rs @@ -16,22 +16,6 @@ pub trait LedgerRead { type Request; type ReqResult; - // returns request result as JSON - async fn submit_request(&self, request_json: Self::Request) -> VcxCoreResult; - - // adds endorser to request and signs with submitter_did, returns the transaction ready for endorser to take - async fn set_endorser( - &self, - submitter_did: &str, - request: Self::Request, - endorser: &str, - ) -> VcxCoreResult; - - async fn get_txn_author_agreement(&self) -> VcxCoreResult; - - // returns request result as JSON - async fn get_nym(&self, did: &str) -> VcxCoreResult; - // Schema json. // { // id: identifier of schema @@ -48,9 +32,6 @@ pub trait LedgerRead { // TO CONSIDER - do we need to return the cred def ID in a tuple? is it ever different to the input? async fn get_cred_def(&self, cred_def_id: &str, submitter_did: Option<&str>) -> VcxCoreResult; - // returns request result as JSON - async fn get_attr(&self, target_did: &str, attr_name: &str) -> VcxCoreResult; - // # Returns // Revocation Registry Definition Id and Revocation Registry Definition json. // { @@ -97,43 +78,10 @@ pub trait LedgerRead { // "ver": string - version revocation registry json // } async fn get_rev_reg(&self, rev_reg_id: &str, timestamp: u64) -> VcxCoreResult<(String, Self::RevReg, u64)>; - - // returns request result as JSON - async fn get_ledger_txn(&self, seq_no: i32, submitter_did: Option<&str>) -> VcxCoreResult; } #[async_trait] pub trait LedgerWrite: LedgerRead { - // returns request result as JSON - async fn sign_and_submit_request( - &self, - submitter_did: &str, - request_json: Self::Schema, - ) -> VcxCoreResult; - - // endorsers/multi signs a request, submits to ledger, and verifies successful result - async fn endorse_transaction(&self, endorser_did: &str, request_json: Self::Request) -> VcxCoreResult<()>; - - // returns request result as JSON - async fn add_attr(&self, target_did: &str, attrib_json: &str) -> VcxCoreResult; - - // returns request result as JSON - async fn publish_nym( - &self, - submitter_did: &str, - target_did: &str, - verkey: Option<&str>, - data: Option<&str>, - role: Option<&str>, - ) -> VcxCoreResult; - - // returns request as JSON - async fn build_schema_request( - &self, - submitter_did: &str, - schema_json: Self::Schema, - ) -> VcxCoreResult; - async fn publish_schema( &self, schema_json: Self::Schema, @@ -151,4 +99,6 @@ pub trait LedgerWrite: LedgerRead { rev_reg_entry_json: &str, submitter_did: &str, ) -> VcxCoreResult<()>; + + async fn publish_rev_reg(&self, rev_reg_id: &str, rev_reg: Self::RevReg, timestamp: u64) -> VcxCoreResult<()>; }