1
1
//!
2
- //! An implementation of ELIP0101 as defined in
3
- //! <https://github.com/ElementsProject/ELIPs/blob/main/elip-0101 .mediawiki>
2
+ //! An implementation of ELIP0102 as defined in
3
+ //! <https://github.com/ElementsProject/ELIPs/blob/main/elip-0102 .mediawiki>
4
4
//!
5
- //! ELIP0101 defines how to encode the extra data for LiquiDEX in a PSET.
5
+ //! ELIP0102 defines how to encode the extra data for LiquiDEX in a PSET.
6
6
//!
7
7
8
8
use crate :: pset:: {
@@ -13,13 +13,13 @@ use crate::pset::{
13
13
Input , Output ,
14
14
} ;
15
15
16
- /// Input Asset Blinding Factor keytype as defined in ELIP0101
16
+ /// Input Asset Blinding Factor keytype as defined in ELIP0102
17
17
pub const PSBT_ELEMENTS_LIQUIDEX_IN_ABF : u8 = 0x00u8 ;
18
18
19
- /// Output Asset Blinding Factor keytype as defined in ELIP0101
19
+ /// Output Asset Blinding Factor keytype as defined in ELIP0102
20
20
pub const PSBT_ELEMENTS_LIQUIDEX_OUT_ABF : u8 = 0x00u8 ;
21
21
22
- /// Prefix for PSET LiquiDEX extension as defined in ELIP0101
22
+ /// Prefix for PSET LiquiDEX extension as defined in ELIP0102
23
23
pub const PSET_LIQUIDEX_PREFIX : & [ u8 ] = b"pset_liquidex" ;
24
24
25
25
fn prop_key ( keytype : u8 ) -> ProprietaryKey {
@@ -30,7 +30,7 @@ fn prop_key(keytype: u8) -> ProprietaryKey {
30
30
}
31
31
}
32
32
33
- /// ELIP0101 LiquiDEX extensions
33
+ /// ELIP0102 LiquiDEX extensions
34
34
impl Input {
35
35
/// Set Asset Blinding Factor
36
36
pub fn set_abf ( & mut self , abf : AssetBlindingFactor ) {
@@ -47,7 +47,7 @@ impl Input {
47
47
}
48
48
}
49
49
50
- /// ELIP0101 LiquiDEX extensions
50
+ /// ELIP0102 LiquiDEX extensions
51
51
impl Output {
52
52
/// Set Asset Blinding Factor
53
53
pub fn set_abf ( & mut self , abf : AssetBlindingFactor ) {
@@ -72,7 +72,7 @@ mod test {
72
72
use crate :: hex:: { FromHex , ToHex } ;
73
73
74
74
// b'\xfc\rpset_liquidex'
75
- const ELIP0101_IDENTIFIER : & str = "fc0d707365745f6c69717569646578" ;
75
+ const ELIP0102_IDENTIFIER : & str = "fc0d707365745f6c69717569646578" ;
76
76
77
77
#[ test]
78
78
fn prop_key_serialize ( ) {
@@ -85,7 +85,7 @@ mod test {
85
85
format!( "0d{}00" , PSET_LIQUIDEX_PREFIX . to_hex( ) )
86
86
) ;
87
87
88
- assert ! ( vec. to_hex( ) . starts_with( & ELIP0101_IDENTIFIER [ 2 ..] ) ) ; // cut proprietary prefix "fc"
88
+ assert ! ( vec. to_hex( ) . starts_with( & ELIP0102_IDENTIFIER [ 2 ..] ) ) ; // cut proprietary prefix "fc"
89
89
}
90
90
91
91
#[ test]
@@ -100,15 +100,15 @@ mod test {
100
100
input. set_abf ( abf) ;
101
101
assert_eq ! ( input. get_abf( ) . unwrap( ) . unwrap( ) , abf) ;
102
102
let input_hex = serialize_hex ( & input) ;
103
- assert ! ( input_hex. contains( ELIP0101_IDENTIFIER ) ) ;
103
+ assert ! ( input_hex. contains( ELIP0102_IDENTIFIER ) ) ;
104
104
assert ! ( input_hex. contains( abf_hex) ) ;
105
105
106
106
let mut output = Output :: default ( ) ;
107
107
assert ! ( output. get_abf( ) . is_none( ) ) ;
108
108
output. set_abf ( abf) ;
109
109
assert_eq ! ( output. get_abf( ) . unwrap( ) . unwrap( ) , abf) ;
110
110
let output_hex = serialize_hex ( & output) ;
111
- assert ! ( output_hex. contains( ELIP0101_IDENTIFIER ) ) ;
111
+ assert ! ( output_hex. contains( ELIP0102_IDENTIFIER ) ) ;
112
112
assert ! ( output_hex. contains( abf_hex) ) ;
113
113
}
114
114
0 commit comments