Beispiel #1
0
 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;
 }
Beispiel #2
0
        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);
        }
Beispiel #3
0
 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);
 }