Exemplo n.º 1
0
 public StateMachine(Block persisting_block, DataCache <UInt160, AccountState> accounts, DataCache <ECPoint, ValidatorState> validators, DataCache <UInt256, AssetState> assets, DataCache <UInt160, ContractState> contracts, DataCache <StorageKey, StorageItem> storages)
 {
     this.persisting_block = persisting_block;
     this.accounts         = new CloneCache <UInt160, AccountState>(accounts);
     this.validators       = new CloneCache <ECPoint, ValidatorState>(validators);
     this.assets           = new CloneCache <UInt256, AssetState>(assets);
     this.contracts        = new CloneCache <UInt160, ContractState>(contracts);
     this.storages         = new CloneCache <StorageKey, StorageItem>(storages);
     Notify += StateMachine_Notify;
     Register("Neo.Account.SetVotes", Account_SetVotes);
     Register("Neo.Validator.Register", Validator_Register);
     Register("Neo.Asset.Create", Asset_Create);
     Register("Neo.Asset.Renew", Asset_Renew);
     Register("Neo.Contract.Create", Contract_Create);
     Register("Neo.Contract.Migrate", Contract_Migrate);
     Register("Neo.Contract.GetStorageContext", Contract_GetStorageContext);
     Register("Neo.Contract.Destroy", Contract_Destroy);
     Register("Neo.Storage.Put", Storage_Put);
     Register("Neo.Storage.Delete", Storage_Delete);
     #region Old AntShares APIs
     Register("AntShares.Account.SetVotes", Account_SetVotes);
     Register("AntShares.Validator.Register", Validator_Register);
     Register("AntShares.Asset.Create", Asset_Create);
     Register("AntShares.Asset.Renew", Asset_Renew);
     Register("AntShares.Contract.Create", Contract_Create);
     Register("AntShares.Contract.Migrate", Contract_Migrate);
     Register("AntShares.Contract.GetStorageContext", Contract_GetStorageContext);
     Register("AntShares.Contract.Destroy", Contract_Destroy);
     Register("AntShares.Storage.Put", Storage_Put);
     Register("AntShares.Storage.Delete", Storage_Delete);
     #endregion
 }