Skip to content

Commit

Permalink
linted
Browse files Browse the repository at this point in the history
Signed-off-by: DenisRybas <[email protected]>
  • Loading branch information
DenisRybas committed Feb 12, 2024
1 parent b02ae42 commit 1104f78
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 20 deletions.
24 changes: 14 additions & 10 deletions vdr/src/contracts/cl/credential_definition_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,9 @@ pub mod test {
},
contracts::{
cl::types::{
credential_definition::test::{credential_definition, CREDENTIAL_DEFINITION_TAG, credential_definition_value},
credential_definition::test::{
credential_definition, credential_definition_value, CREDENTIAL_DEFINITION_TAG,
},
schema::test::SCHEMA_ID,
schema_id::SchemaId,
},
Expand All @@ -281,8 +283,8 @@ pub mod test {
use std::sync::RwLock;

mod build_create_credential_definition_transaction {
use rstest::rstest;
use super::*;
use rstest::rstest;
use serde_json::Value;

#[async_std::test]
Expand Down Expand Up @@ -351,17 +353,19 @@ pub mod test {
) {
init_env_logger();
let client = mock_client();
let (id, mut cred_def) = credential_definition(
&DID::from(ISSUER_ID),
&SchemaId::from(SCHEMA_ID),
Some(tag),
);
let (id, mut cred_def) =
credential_definition(&DID::from(ISSUER_ID), &SchemaId::from(SCHEMA_ID), Some(tag));
cred_def.tag = tag.to_string();
cred_def.value = value;

let err = build_create_credential_definition_transaction(&client, &TRUSTEE_ACC, &id, &cred_def)
.await
.unwrap_err();
let err = build_create_credential_definition_transaction(
&client,
&TRUSTEE_ACC,
&id,
&cred_def,
)
.await
.unwrap_err();

assert!(matches!(err, VdrError::InvalidCredentialDefinition { .. }));
}
Expand Down
2 changes: 0 additions & 2 deletions vdr/src/contracts/cl/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
pub mod credential_definition_registry;
pub mod schema_registry;
pub mod types;


6 changes: 3 additions & 3 deletions vdr/src/contracts/cl/schema_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,17 +259,17 @@ pub mod test {
mock_client, CHAIN_ID, DEFAULT_NONCE, SCHEMA_REGISTRY_ADDRESS, TRUSTEE_ACC,
},
contracts::{
cl::types::schema::test::{schema, SCHEMA_NAME, SCHEMA_VERSION, SCHEMA_ATTRIBUTES},
cl::types::schema::test::{schema, SCHEMA_ATTRIBUTES, SCHEMA_NAME, SCHEMA_VERSION},
did::types::{did::DID, did_doc::test::ISSUER_ID},
},
utils::init_env_logger,
};
use std::sync::RwLock;

mod build_create_schema_transaction {
use std::collections::HashSet;
use rstest::rstest;
use super::*;
use rstest::rstest;
use std::collections::HashSet;

#[async_std::test]
async fn build_create_schema_transaction_test() {
Expand Down
8 changes: 6 additions & 2 deletions vdr/src/contracts/cl/types/schema.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
use crate::{error::VdrError, types::{ContractOutput, ContractParam}, Address, VdrResult, SchemaId};
use crate::{
error::VdrError,
types::{ContractOutput, ContractParam},
Address, SchemaId, VdrResult,
};
use std::collections::HashSet;

use crate::{contracts::did::types::did::DID, types::ContractEvent};
Expand Down Expand Up @@ -94,12 +98,12 @@ impl TryFrom<ContractEvent> for SchemaCreatedEvent {

#[cfg(test)]
pub mod test {
use once_cell::sync::Lazy;
use super::*;
use crate::{
contracts::{cl::types::schema_id::SchemaId, did::types::did_doc::test::ISSUER_ID},
utils::rand_string,
};
use once_cell::sync::Lazy;

pub const SCHEMA_ID: &str =
"did:ethr:testnet:0xf0e2db6c8dc6c681bb5d6ad121a107f300e9b2b5/anoncreds/v0/SCHEMA/F1DClaFEzi3t/1.0.0";
Expand Down
2 changes: 1 addition & 1 deletion vdr/src/contracts/did/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ pub mod types;

pub(crate) mod did_ethr_resolver;

pub use types::{did_doc::*};
pub use types::did_doc::*;
1 change: 0 additions & 1 deletion vdr/src/contracts/migration/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
pub mod legacy_mapping_registry;
pub mod types;

1 change: 0 additions & 1 deletion vdr/src/contracts/network/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
pub mod validator_control;
pub mod validator_info;

0 comments on commit 1104f78

Please sign in to comment.