@@ -395,6 +395,9 @@ pub mod verify {
395
395
impl < A : LocalStateStore , E : LocalStateStore > LocalStateStore for VerifyStateStore < A , E > {
396
396
define_local_state_store_associated_type ! ( ) ;
397
397
398
+ // We don't verify `surely_not_have` across different state stores because
399
+ // the return value of `surely_not_have` is implementation specific and may not
400
+ // be consistent across different state store backends.
398
401
fn surely_not_have (
399
402
& self ,
400
403
_key_range : ( Bound < Vec < u8 > > , Bound < Vec < u8 > > ) ,
@@ -799,14 +802,26 @@ pub mod boxed_state_store {
799
802
800
803
// For LocalStateStore
801
804
805
+ #[ async_trait:: async_trait]
802
806
pub trait DynamicDispatchedLocalStateStore :
803
807
DynamicDispatchedStateStoreRead + DynamicDispatchedStateStoreWrite
804
808
{
809
+ async fn surely_not_have (
810
+ & self ,
811
+ key_range : ( Bound < Vec < u8 > > , Bound < Vec < u8 > > ) ,
812
+ read_options : ReadOptions ,
813
+ ) -> StorageResult < bool > ;
805
814
}
806
815
807
- impl < S : DynamicDispatchedStateStoreRead + DynamicDispatchedStateStoreWrite >
808
- DynamicDispatchedLocalStateStore for S
809
- {
816
+ #[ async_trait:: async_trait]
817
+ impl < S : LocalStateStore > DynamicDispatchedLocalStateStore for S {
818
+ async fn surely_not_have (
819
+ & self ,
820
+ key_range : ( Bound < Vec < u8 > > , Bound < Vec < u8 > > ) ,
821
+ read_options : ReadOptions ,
822
+ ) -> StorageResult < bool > {
823
+ self . surely_not_have ( key_range, read_options) . await
824
+ }
810
825
}
811
826
812
827
pub type BoxDynamicDispatchedLocalStateStore = Box < dyn DynamicDispatchedLocalStateStore > ;
@@ -819,10 +834,10 @@ pub mod boxed_state_store {
819
834
820
835
fn surely_not_have (
821
836
& self ,
822
- _key_range : ( Bound < Vec < u8 > > , Bound < Vec < u8 > > ) ,
823
- _read_options : ReadOptions ,
837
+ key_range : ( Bound < Vec < u8 > > , Bound < Vec < u8 > > ) ,
838
+ read_options : ReadOptions ,
824
839
) -> Self :: SurelyNotHaveFuture < ' _ > {
825
- async move { Ok ( false ) }
840
+ self . deref ( ) . surely_not_have ( key_range , read_options )
826
841
}
827
842
}
828
843
0 commit comments