示例#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;
 }
示例#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);
        }
示例#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);
 }