File tree 4 files changed +13
-16
lines changed 4 files changed +13
-16
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,8 @@ default = ["uniffi/cli"]
13
13
14
14
[dependencies ]
15
15
bitcoin = { version = " 0.32.4" }
16
- uniffi = { version = " =0.28.2 " }
16
+ uniffi = { version = " =0.29.0 " }
17
17
thiserror = " 1.0.58"
18
18
19
19
[build-dependencies ]
20
- uniffi = { version = " =0.28.2 " , features = [" build" ] }
20
+ uniffi = { version = " =0.29.0 " , features = [" build" ] }
Original file line number Diff line number Diff line change 1
1
namespace bitcoin {};
2
2
3
- [NonExhaustive]
3
+ [NonExhaustive, Remote ]
4
4
enum Network {
5
5
"Bitcoin",
6
6
"Testnet",
Original file line number Diff line number Diff line change @@ -18,19 +18,16 @@ macro_rules! impl_from_ffi_type {
18
18
} ;
19
19
}
20
20
21
+ #[ macro_export]
21
22
macro_rules! define_custom_string_type {
22
23
( $ffi_type: ident) => {
23
- uniffi:: custom_type!( $ffi_type, String ) ;
24
-
25
- impl UniffiCustomTypeConverter for $ffi_type {
26
- type Builtin = String ;
27
- fn into_custom( val: Self :: Builtin ) -> uniffi:: Result <Self > {
28
- Ok ( val. parse:: <$ffi_type>( ) ?)
29
- }
30
-
31
- fn from_custom( obj: Self ) -> Self :: Builtin {
32
- obj. to_string( )
33
- }
34
- }
24
+ uniffi:: custom_type!( $ffi_type, String , {
25
+ remote,
26
+ lower: |value: $ffi_type| value. to_string( ) ,
27
+ try_lift: |value: String | value. parse( )
28
+ . map_err( |_| uniffi:: deps:: anyhow:: Error :: msg(
29
+ format!( "Failed to parse {} from string" , stringify!( $ffi_type) )
30
+ ) ) ,
31
+ } ) ;
35
32
} ;
36
33
}
Original file line number Diff line number Diff line change @@ -6,4 +6,4 @@ version = "0.1.0"
6
6
edition = " 2021"
7
7
8
8
[dependencies ]
9
- uniffi = { version = " 0.28 .0" , features = [" cli" ] }
9
+ uniffi = { version = " 0.29 .0" , features = [" cli" ] }
You can’t perform that action at this time.
0 commit comments