@@ -36,7 +36,7 @@ use crate::{
3636 unresolved_bytes:: UnresolvedBytes ,
3737 Address , AssetId , ContractId ,
3838 } ,
39- utils:: calculate_witnesses_size,
39+ utils:: { calculate_witnesses_size, sealed } ,
4040} ;
4141
4242#[ cfg_attr( not( target_arch = "wasm32" ) , async_trait) ]
@@ -67,7 +67,7 @@ struct UnresolvedWitnessIndexes {
6767}
6868
6969#[ cfg_attr( not( target_arch = "wasm32" ) , async_trait) ]
70- pub trait BuildableTransaction {
70+ pub trait BuildableTransaction : sealed :: Sealed {
7171 type TxType : Transaction ;
7272
7373 async fn build ( self , provider : & impl DryRunner ) -> Result < Self :: TxType > ;
@@ -78,6 +78,8 @@ pub trait BuildableTransaction {
7878 async fn build_without_signatures ( self , provider : & impl DryRunner ) -> Result < Self :: TxType > ;
7979}
8080
81+ impl sealed:: Sealed for ScriptTransactionBuilder { }
82+
8183#[ cfg_attr( not( target_arch = "wasm32" ) , async_trait) ]
8284impl BuildableTransaction for ScriptTransactionBuilder {
8385 type TxType = ScriptTransaction ;
@@ -94,6 +96,8 @@ impl BuildableTransaction for ScriptTransactionBuilder {
9496 }
9597}
9698
99+ impl sealed:: Sealed for CreateTransactionBuilder { }
100+
97101#[ cfg_attr( not( target_arch = "wasm32" ) , async_trait) ]
98102impl BuildableTransaction for CreateTransactionBuilder {
99103 type TxType = CreateTransaction ;
@@ -111,7 +115,7 @@ impl BuildableTransaction for CreateTransactionBuilder {
111115}
112116
113117#[ cfg_attr( not( target_arch = "wasm32" ) , async_trait) ]
114- pub trait TransactionBuilder : BuildableTransaction + Send {
118+ pub trait TransactionBuilder : BuildableTransaction + Send + sealed :: Sealed {
115119 type TxType : Transaction ;
116120
117121 fn add_signer ( & mut self , signer : impl Signer + Send + Sync ) -> Result < & mut Self > ;
0 commit comments