protected void Init(ISource <byte[], AccountState> accountStateCache, ISource <byte[], byte[]> codeCache, MultiCache <ICachedSource <byte[], byte[]> > storageCache, ISource <byte[], ContractUnspentOutput> vinCache) { this.accountStateCache = accountStateCache; this.codeCache = codeCache; this.storageCache = storageCache; this.vinCache = vinCache; }
public IContractState StartTracking() { ISource <byte[], AccountState> trackAccountStateCache = new WriteCache <AccountState>(this.accountStateCache, WriteCache <AccountState> .CacheType.SIMPLE); ISource <byte[], ContractUnspentOutput> trackVinCache = new WriteCache <ContractUnspentOutput>(this.vinCache, WriteCache <ContractUnspentOutput> .CacheType.SIMPLE); ISource <byte[], byte[]> trackCodeCache = new WriteCache <byte[]>(this.codeCache, WriteCache <byte[]> .CacheType.SIMPLE); MultiCacheBase <ICachedSource <byte[], byte[]> > trackStorageCache = new MultiCache(this.storageCache); var stateRepository = new ContractState(trackAccountStateCache, trackCodeCache, trackStorageCache, trackVinCache) { parent = this }; return(stateRepository); }
public ContractState(ISource <byte[], AccountState> accountStateCache, ISource <byte[], byte[]> codeCache, MultiCache <ICachedSource <byte[], byte[]> > storageCache, ISource <byte[], ContractUnspentOutput> vinCache) { this.Init(accountStateCache, codeCache, storageCache, vinCache); }