@@ -14,12 +14,13 @@ use std::collections::{btree_map, btree_set};
14
14
15
15
use derive_more:: { Constructor , DebugCustom , Display } ;
16
16
use getset:: Getters ;
17
- use iroha_data_model_derive:: IdEqOrdHash ;
17
+ use iroha_data_model_derive:: { model , IdEqOrdHash } ;
18
18
use iroha_schema:: IntoSchema ;
19
19
use parity_scale_codec:: { Decode , Encode } ;
20
20
use serde:: { Deserialize , Serialize } ;
21
21
use serde_with:: { DeserializeFromStr , SerializeDisplay } ;
22
22
23
+ pub use self :: model:: * ;
23
24
use crate :: {
24
25
asset:: {
25
26
prelude:: { Asset , AssetId } ,
@@ -28,7 +29,6 @@ use crate::{
28
29
domain:: prelude:: * ,
29
30
expression:: { ContainsAny , ContextValue , EvaluatesTo } ,
30
31
metadata:: Metadata ,
31
- model,
32
32
role:: { prelude:: RoleId , RoleIds } ,
33
33
HasMetadata , Identifiable , Name , ParseError , PublicKey , Registered ,
34
34
} ;
@@ -50,7 +50,10 @@ pub const TRANSACTION_SIGNATORIES_VALUE: &str = "transaction_signatories";
50
50
/// The context value name for account signatories.
51
51
pub const ACCOUNT_SIGNATORIES_VALUE : & str = "account_signatories" ;
52
52
53
- model ! {
53
+ #[ model]
54
+ pub mod model {
55
+ use super :: * ;
56
+
54
57
/// Identification of an [`Account`]. Consists of Account name and Domain name.
55
58
///
56
59
/// # Examples
@@ -60,7 +63,23 @@ model! {
60
63
///
61
64
/// let id = "user@company".parse::<AccountId>().expect("Valid");
62
65
/// ```
63
- #[ derive( DebugCustom , Display , Clone , PartialEq , Eq , PartialOrd , Ord , Hash , Constructor , Getters , Decode , Encode , DeserializeFromStr , SerializeDisplay , IntoSchema ) ]
66
+ #[ derive(
67
+ DebugCustom ,
68
+ Display ,
69
+ Clone ,
70
+ PartialEq ,
71
+ Eq ,
72
+ PartialOrd ,
73
+ Ord ,
74
+ Hash ,
75
+ Constructor ,
76
+ Getters ,
77
+ Decode ,
78
+ Encode ,
79
+ DeserializeFromStr ,
80
+ SerializeDisplay ,
81
+ IntoSchema ,
82
+ ) ]
64
83
#[ display( fmt = "{name}@{domain_id}" ) ]
65
84
#[ debug( fmt = "{name}@{domain_id}" ) ]
66
85
#[ getset( get = "pub" ) ]
@@ -73,7 +92,18 @@ model! {
73
92
}
74
93
75
94
/// Account entity is an authority which is used to execute `Iroha Special Instructions`.
76
- #[ derive( Debug , Display , Clone , IdEqOrdHash , Getters , Decode , Encode , Deserialize , Serialize , IntoSchema ) ]
95
+ #[ derive(
96
+ Debug ,
97
+ Display ,
98
+ Clone ,
99
+ IdEqOrdHash ,
100
+ Getters ,
101
+ Decode ,
102
+ Encode ,
103
+ Deserialize ,
104
+ Serialize ,
105
+ IntoSchema ,
106
+ ) ]
77
107
#[ allow( clippy:: multiple_inherent_impl) ]
78
108
#[ display( fmt = "({id})" ) ] // TODO: Add more?
79
109
#[ ffi_type]
@@ -94,7 +124,9 @@ model! {
94
124
}
95
125
96
126
/// Builder which should be submitted in a transaction to create a new [`Account`]
97
- #[ derive( DebugCustom , Display , Clone , IdEqOrdHash , Decode , Encode , Deserialize , Serialize , IntoSchema ) ]
127
+ #[ derive(
128
+ DebugCustom , Display , Clone , IdEqOrdHash , Decode , Encode , Deserialize , Serialize , IntoSchema ,
129
+ ) ]
98
130
#[ display( fmt = "[{id}]" ) ]
99
131
#[ debug( fmt = "[{id:?}] {{ signatories: {signatories:?}, metadata: {metadata} }}" ) ]
100
132
#[ ffi_type]
@@ -108,7 +140,22 @@ model! {
108
140
}
109
141
110
142
/// Condition which checks if the account has the right signatures.
111
- #[ derive( Debug , Display , Clone , PartialEq , Eq , PartialOrd , Ord , Hash , Constructor , Decode , Encode , Deserialize , Serialize , IntoSchema ) ]
143
+ #[ derive(
144
+ Debug ,
145
+ Display ,
146
+ Clone ,
147
+ PartialEq ,
148
+ Eq ,
149
+ PartialOrd ,
150
+ Ord ,
151
+ Hash ,
152
+ Constructor ,
153
+ Decode ,
154
+ Encode ,
155
+ Deserialize ,
156
+ Serialize ,
157
+ IntoSchema ,
158
+ ) ]
112
159
#[ serde( transparent) ]
113
160
#[ repr( transparent) ]
114
161
// SAFETY: `SignatureCheckCondition` has no trap representation in `EvalueatesTo<bool>`
0 commit comments