3
3
use schemars:: JsonSchema ;
4
4
use serde:: { Deserialize , Serialize } ;
5
5
6
- use cosmwasm_std:: { Binary , Uint128 } ;
6
+ use cosmwasm_std:: { Addr , Binary , Uint128 } ;
7
+
8
+ pub trait HasDecoy {
9
+ fn decoys ( & self ) -> & Option < Vec < Addr > > ;
10
+ }
7
11
8
12
#[ derive( Serialize , Deserialize , JsonSchema , Clone , Debug ) ]
9
13
#[ serde( rename_all = "snake_case" ) ]
10
14
pub struct TransferAction {
11
15
pub recipient : String ,
12
16
pub amount : Uint128 ,
13
17
pub memo : Option < String > ,
18
+ pub decoys : Option < Vec < Addr > > ,
14
19
}
15
20
16
21
#[ derive( Serialize , Deserialize , JsonSchema , Clone , Debug ) ]
@@ -21,6 +26,7 @@ pub struct SendAction {
21
26
pub amount : Uint128 ,
22
27
pub msg : Option < Binary > ,
23
28
pub memo : Option < String > ,
29
+ pub decoys : Option < Vec < Addr > > ,
24
30
}
25
31
26
32
#[ derive( Serialize , Deserialize , JsonSchema , Clone , Debug ) ]
@@ -30,6 +36,7 @@ pub struct TransferFromAction {
30
36
pub recipient : String ,
31
37
pub amount : Uint128 ,
32
38
pub memo : Option < String > ,
39
+ pub decoys : Option < Vec < Addr > > ,
33
40
}
34
41
35
42
#[ derive( Serialize , Deserialize , JsonSchema , Clone , Debug ) ]
@@ -41,6 +48,7 @@ pub struct SendFromAction {
41
48
pub amount : Uint128 ,
42
49
pub msg : Option < Binary > ,
43
50
pub memo : Option < String > ,
51
+ pub decoys : Option < Vec < Addr > > ,
44
52
}
45
53
46
54
#[ derive( Serialize , Deserialize , JsonSchema , Clone , Debug ) ]
@@ -49,6 +57,7 @@ pub struct MintAction {
49
57
pub recipient : String ,
50
58
pub amount : Uint128 ,
51
59
pub memo : Option < String > ,
60
+ pub decoys : Option < Vec < Addr > > ,
52
61
}
53
62
54
63
#[ derive( Serialize , Deserialize , JsonSchema , Clone , Debug ) ]
@@ -57,4 +66,22 @@ pub struct BurnFromAction {
57
66
pub owner : String ,
58
67
pub amount : Uint128 ,
59
68
pub memo : Option < String > ,
69
+ pub decoys : Option < Vec < Addr > > ,
60
70
}
71
+
72
+ macro_rules! impl_decoyable {
73
+ ( $struct: ty) => {
74
+ impl HasDecoy for $struct {
75
+ fn decoys( & self ) -> & Option <Vec <Addr >> {
76
+ & self . decoys
77
+ }
78
+ }
79
+ } ;
80
+ }
81
+
82
+ impl_decoyable ! ( BurnFromAction ) ;
83
+ impl_decoyable ! ( MintAction ) ;
84
+ impl_decoyable ! ( SendFromAction ) ;
85
+ impl_decoyable ! ( TransferFromAction ) ;
86
+ impl_decoyable ! ( TransferAction ) ;
87
+ impl_decoyable ! ( SendAction ) ;
0 commit comments