use of org.aion.base.db.IByteArrayKeyValueStore in project aion by aionnetwork.
the class AionContractDetailsImpl method getSnapshotTo.
@Override
public IContractDetails<DataWord> getSnapshotTo(byte[] hash) {
IByteArrayKeyValueStore keyValueDataSource = this.storageTrie.getCache().getDb();
SecureTrie snapStorage = wrap(hash).equals(wrap(EMPTY_TRIE_HASH)) ? new SecureTrie(keyValueDataSource, "".getBytes()) : new SecureTrie(keyValueDataSource, hash);
snapStorage.withPruningEnabled(storageTrie.isPruningEnabled());
snapStorage.setCache(this.storageTrie.getCache());
AionContractDetailsImpl details = new AionContractDetailsImpl(this.address, snapStorage, getCodes());
details.externalStorage = this.externalStorage;
details.externalStorageDataSource = this.externalStorageDataSource;
details.keys = this.keys;
details.dataSource = dataSource;
return details;
}
Aggregations