1
- use alloy:: primitives:: { Address , AddressError } ;
2
1
use chrono:: { DateTime , FixedOffset } ;
3
2
use sea_orm:: entity:: prelude:: * ;
4
- use sea_orm_newtype:: DeriveNewType ;
5
3
use serde:: { Deserialize , Serialize } ;
6
4
5
+ use crate :: types:: AddressWrapper ;
6
+
7
7
#[ derive( Clone , Debug , PartialEq , DeriveEntityModel , Eq , Serialize , Deserialize ) ]
8
8
#[ sea_orm( table_name = "autoallocations" ) ]
9
9
pub struct Model {
@@ -16,26 +16,3 @@ pub struct Model {
16
16
pub enum Relation { }
17
17
18
18
impl ActiveModelBehavior for ActiveModel { }
19
-
20
- #[ derive( Clone , Debug , PartialEq , DeriveNewType , Eq , Serialize , Deserialize ) ]
21
- #[ sea_orm_newtype( try_from_into = "String" , primary_key) ]
22
- pub struct AddressWrapper ( pub Address ) ;
23
-
24
- impl TryFrom < String > for AddressWrapper {
25
- type Error = AddressError ;
26
- fn try_from ( value : String ) -> Result < Self , Self :: Error > {
27
- Ok ( AddressWrapper ( Address :: parse_checksummed ( value, None ) ?) )
28
- }
29
- }
30
-
31
- impl From < AddressWrapper > for String {
32
- fn from ( value : AddressWrapper ) -> Self {
33
- value. 0 . to_checksum ( None )
34
- }
35
- }
36
-
37
- impl From < Address > for AddressWrapper {
38
- fn from ( value : Address ) -> Self {
39
- AddressWrapper ( value)
40
- }
41
- }
0 commit comments