core: remove Persist from NativeCache interface

Lower native cache should be assigned to the upper's value during persist.
This commit is contained in:
Anna Shaleva 2022-04-19 12:39:34 +03:00
parent 8ec8511d9d
commit c8bdd2ad1a
7 changed files with 3 additions and 101 deletions

View file

@ -96,19 +96,6 @@ func (c *OracleCache) Copy() storage.NativeContractCache {
return cp
}
// Persist implements NativeContractCache interface.
func (c *OracleCache) Persist(ps storage.NativeContractCache) (storage.NativeContractCache, error) {
if ps == nil {
ps = &OracleCache{}
}
psCache, ok := ps.(*OracleCache)
if !ok {
return nil, errors.New("not an Oracle native cache")
}
copyOracleCache(c, psCache)
return psCache, nil
}
func copyOracleCache(src, dst *OracleCache) {
*dst = *src
}