core: remove Persist from NativeCache interface
Lower native cache should be assigned to the upper's value during persist.
This commit is contained in:
parent
8ec8511d9d
commit
c8bdd2ad1a
7 changed files with 3 additions and 101 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue