File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -85,9 +85,11 @@ impl<'a> KVStore for TopLevelKVStore<'a> {
8585 self . state . update_ibc_data ( & key, value. to_vec ( ) ) . expect ( "Set in IBC KVStore" ) . map ( Bytes :: from)
8686 }
8787
88- fn delete ( & mut self , path : Path ) {
88+ fn remove ( & mut self , path : Path ) -> Option < Bytes > {
89+ let prev = self . get ( path) ;
8990 let key = TopLevelKVStore :: key ( path) ;
9091 self . state . remove_ibc_data ( & key) ;
92+ prev
9193 }
9294
9395 fn root ( & self ) -> H256 {
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ pub trait KVStore {
2424 fn get ( & self , path : Path ) -> Option < Bytes > ;
2525 fn contains_key ( & self , path : Path ) -> bool ;
2626 fn insert ( & mut self , path : Path , value : & [ u8 ] ) -> Option < Bytes > ;
27- fn delete ( & mut self , path : Path ) ;
27+ fn remove ( & mut self , path : Path ) -> Option < Bytes > ;
2828 fn root ( & self ) -> H256 ;
2929 fn make_proof ( & self , path : Path ) -> ( CryptoProofUnit , CryptoProof ) ;
3030}
You can’t perform that action at this time.
0 commit comments