@@ -35,6 +35,7 @@ use commit_verify::{mpc, Conceal};
35
35
use single_use_seals:: SealWitness ;
36
36
use strict_encoding:: { StrictDecode , StrictDumb , StrictEncode , StrictType } ;
37
37
38
+ use crate :: contract:: xchain:: Impossible ;
38
39
use crate :: { XChain , XOutpoint , LIB_NAME_RGB } ;
39
40
40
41
pub type GenesisSeal = SingleBlindSeal < Method > ;
@@ -70,36 +71,42 @@ impl<Seal: TxoSeal> TxoSeal for XChain<Seal> {
70
71
fn method ( & self ) -> CloseMethod {
71
72
match self {
72
73
XChain :: Bitcoin ( seal) | XChain :: Liquid ( seal) => seal. method ( ) ,
74
+ XChain :: Other ( _) => unreachable ! ( ) ,
73
75
}
74
76
}
75
77
76
78
fn txid ( & self ) -> Option < Txid > {
77
79
match self {
78
80
XChain :: Bitcoin ( seal) | XChain :: Liquid ( seal) => seal. txid ( ) ,
81
+ XChain :: Other ( _) => unreachable ! ( ) ,
79
82
}
80
83
}
81
84
82
85
fn vout ( & self ) -> Vout {
83
86
match self {
84
87
XChain :: Bitcoin ( seal) | XChain :: Liquid ( seal) => seal. vout ( ) ,
88
+ XChain :: Other ( _) => unreachable ! ( ) ,
85
89
}
86
90
}
87
91
88
92
fn outpoint ( & self ) -> Option < Outpoint > {
89
93
match self {
90
94
XChain :: Bitcoin ( seal) | XChain :: Liquid ( seal) => seal. outpoint ( ) ,
95
+ XChain :: Other ( _) => unreachable ! ( ) ,
91
96
}
92
97
}
93
98
94
99
fn txid_or ( & self , default_txid : Txid ) -> Txid {
95
100
match self {
96
101
XChain :: Bitcoin ( seal) | XChain :: Liquid ( seal) => seal. txid_or ( default_txid) ,
102
+ XChain :: Other ( _) => unreachable ! ( ) ,
97
103
}
98
104
}
99
105
100
106
fn outpoint_or ( & self , default_txid : Txid ) -> Outpoint {
101
107
match self {
102
108
XChain :: Bitcoin ( seal) | XChain :: Liquid ( seal) => seal. outpoint_or ( default_txid) ,
109
+ XChain :: Other ( _) => unreachable ! ( ) ,
103
110
}
104
111
}
105
112
}
@@ -135,6 +142,7 @@ impl<U: ExposedSeal> XChain<U> {
135
142
match self {
136
143
XChain :: Bitcoin ( seal) => seal. method ( ) ,
137
144
XChain :: Liquid ( seal) => seal. method ( ) ,
145
+ XChain :: Other ( _) => unreachable ! ( ) ,
138
146
}
139
147
}
140
148
@@ -150,6 +158,7 @@ impl<U: ExposedSeal> XChain<U> {
150
158
let outpoint = seal. outpoint ( ) ?;
151
159
XChain :: Liquid ( ExplicitSeal :: new ( seal. method ( ) , outpoint) )
152
160
}
161
+ XChain :: Other ( _) => unreachable ! ( ) ,
153
162
} )
154
163
}
155
164
@@ -228,7 +237,7 @@ impl WitnessOrd {
228
237
}
229
238
}
230
239
231
- pub type XPubWitness = XChain < Tx > ;
240
+ pub type XPubWitness < X = Impossible > = XChain < Tx , X > ;
232
241
233
242
pub type XWitness < Dbc > = XChain < Witness < Dbc > > ;
234
243
@@ -237,6 +246,7 @@ impl XPubWitness {
237
246
match self {
238
247
Self :: Bitcoin ( tx) => WitnessId :: Bitcoin ( tx. txid ( ) ) ,
239
248
Self :: Liquid ( tx) => WitnessId :: Liquid ( tx. txid ( ) ) ,
249
+ Self :: Other ( _) => unreachable ! ( ) ,
240
250
}
241
251
}
242
252
}
@@ -246,6 +256,7 @@ impl<Dbc: dbc::Proof> XWitness<Dbc> {
246
256
match self {
247
257
Self :: Bitcoin ( w) => WitnessId :: Bitcoin ( w. txid ) ,
248
258
Self :: Liquid ( w) => WitnessId :: Liquid ( w. txid ) ,
259
+ Self :: Other ( _) => unreachable ! ( ) ,
249
260
}
250
261
}
251
262
}
@@ -257,6 +268,7 @@ impl<Dbc: dbc::Proof, Seal: TxoSeal> SealWitness<Seal> for XWitness<Dbc> {
257
268
fn verify_seal ( & self , seal : & Seal , msg : & Self :: Message ) -> Result < ( ) , Self :: Error > {
258
269
match self {
259
270
Self :: Bitcoin ( witness) | Self :: Liquid ( witness) => witness. verify_seal ( seal, msg) ,
271
+ Self :: Other ( _) => unreachable ! ( ) ,
260
272
}
261
273
}
262
274
@@ -270,6 +282,7 @@ impl<Dbc: dbc::Proof, Seal: TxoSeal> SealWitness<Seal> for XWitness<Dbc> {
270
282
{
271
283
match self {
272
284
Self :: Bitcoin ( witness) | Self :: Liquid ( witness) => witness. verify_many_seals ( seals, msg) ,
285
+ Self :: Other ( _) => unreachable ! ( ) ,
273
286
}
274
287
}
275
288
}
0 commit comments