@@ -39,6 +39,7 @@ use rgb::{
39
39
SchemaId , SecretSeal , Transition , TxoSeal , XChain , XOutpoint , XOutputSeal , XWitnessId ,
40
40
} ;
41
41
use strict_encoding:: FieldName ;
42
+ use strict_types:: TypeSystem ;
42
43
43
44
use super :: {
44
45
ContractStateRead , Index , IndexError , IndexInconsistency , IndexProvider , IndexReadProvider ,
@@ -494,6 +495,9 @@ impl<S: StashProvider, H: StateProvider, P: IndexProvider> Stock<S, H, P> {
494
495
pub fn iface ( & self , iface : impl Into < IfaceRef > ) -> Result < & Iface , StockError < S , H , P > > {
495
496
Ok ( self . stash . iface ( iface) ?)
496
497
}
498
+ pub fn type_system ( & self , iface : & Iface ) -> Result < TypeSystem , StockError < S , H , P > > {
499
+ Ok ( self . stash . type_system ( iface) ?)
500
+ }
497
501
pub fn schemata ( & self ) -> Result < impl Iterator < Item = SchemaInfo > + ' _ , StockError < S , H , P > > {
498
502
Ok ( self . stash . schemata ( ) ?. map ( SchemaInfo :: with) )
499
503
}
@@ -573,7 +577,7 @@ impl<S: StashProvider, H: StateProvider, P: IndexProvider> Stock<S, H, P> {
573
577
let iimpl = self . stash . impl_for :: < C > ( schema_ifaces) ?;
574
578
575
579
let iface = self . stash . iface ( iimpl. iface_id ) ?;
576
- let ( types, _ ) = self . stash . extract ( & schema_ifaces . schema , [ iface] ) ?;
580
+ let types = self . stash . type_system ( iface) ?;
577
581
578
582
Ok ( C :: Wrapper :: with ( ContractIface {
579
583
state,
@@ -599,7 +603,7 @@ impl<S: StashProvider, H: StateProvider, P: IndexProvider> Stock<S, H, P> {
599
603
ContractIfaceError :: NoAbstractImpl ( iface_id, schema_ifaces. schema . schema_id ( ) )
600
604
} ) ?;
601
605
602
- let ( types, _ ) = self . stash . extract ( & schema_ifaces . schema , [ iface] ) ?;
606
+ let types = self . stash . type_system ( iface) ?;
603
607
604
608
Ok ( ContractIface {
605
609
state,
@@ -678,7 +682,9 @@ impl<S: StashProvider, H: StateProvider, P: IndexProvider> Stock<S, H, P> {
678
682
kit. iimpls
679
683
. extend ( schema_ifaces. iimpls . values ( ) . cloned ( ) )
680
684
. expect ( "type guarantees" ) ;
681
- let ( types, scripts) = self . stash . extract ( & schema_ifaces. schema , & kit. ifaces ) ?;
685
+ let ( types, scripts) = self
686
+ . stash
687
+ . types_scripts ( & schema_ifaces. schema , & kit. ifaces ) ?;
682
688
kit. scripts
683
689
. extend ( scripts. into_values ( ) )
684
690
. expect ( "type guarantees" ) ;
@@ -843,7 +849,9 @@ impl<S: StashProvider, H: StateProvider, P: IndexProvider> Stock<S, H, P> {
843
849
let terminals =
844
850
Confined :: try_from ( terminals) . map_err ( |_| ConsignError :: TooManyTerminals ) ?;
845
851
846
- let ( types, scripts) = self . stash . extract ( & schema_ifaces. schema , ifaces. keys ( ) ) ?;
852
+ let ( types, scripts) = self
853
+ . stash
854
+ . types_scripts ( & schema_ifaces. schema , ifaces. keys ( ) ) ?;
847
855
let scripts = Confined :: from_iter_checked ( scripts. into_values ( ) ) ;
848
856
let supplements =
849
857
Confined :: try_from ( supplements) . map_err ( |_| ConsignError :: TooManySupplements ) ?;
0 commit comments