Ejemplo n.º 1
0
 public State(
     IContractPrimitiveSerializer serializer,
     InternalTransactionExecutorFactory internalTransactionExecutorFactory,
     ISmartContractVirtualMachine vm,
     IContractStateRoot repository,
     IBlock block,
     Network network,
     ulong txAmount,
     uint256 transactionHash,
     IAddressGenerator addressGenerator,
     Gas gasLimit)
 {
     this.intermediateState = repository;
     this.LogHolder         = new ContractLogHolder(network);
     this.internalTransfers = new List <TransferInfo>();
     this.BalanceState      = new BalanceState(this.intermediateState, txAmount, this.InternalTransfers);
     this.Network           = network;
     this.Nonce             = 0;
     this.Block             = block;
     this.TransactionHash   = transactionHash;
     this.AddressGenerator  = addressGenerator;
     this.InternalTransactionExecutorFactory = internalTransactionExecutorFactory;
     this.Vm           = vm;
     this.GasRemaining = gasLimit;
     this.Serializer   = serializer;
 }
 public ReflectionSmartContractExecutorFactory(ILoggerFactory loggerFactory,
                                               ICallDataSerializer serializer,
                                               ISmartContractResultRefundProcessor refundProcessor,
                                               ISmartContractResultTransferProcessor transferProcessor,
                                               ISmartContractVirtualMachine vm)
 {
     this.loggerFactory     = loggerFactory;
     this.refundProcessor   = refundProcessor;
     this.transferProcessor = transferProcessor;
     this.vm         = vm;
     this.serializer = serializer;
 }
Ejemplo n.º 3
0
 public Executor(ILoggerFactory loggerFactory,
                 ICallDataSerializer serializer,
                 IContractStateRepository stateSnapshot,
                 ISmartContractResultRefundProcessor refundProcessor,
                 ISmartContractResultTransferProcessor transferProcessor,
                 ISmartContractVirtualMachine vm)
 {
     this.logger            = loggerFactory.CreateLogger(this.GetType());
     this.stateSnapshot     = stateSnapshot;
     this.refundProcessor   = refundProcessor;
     this.transferProcessor = transferProcessor;
     this.vm         = vm;
     this.serializer = serializer;
 }
Ejemplo n.º 4
0
 public StateFactory(
     Network network,
     IContractPrimitiveSerializer contractPrimitiveSerializer,
     ISmartContractVirtualMachine vm,
     IAddressGenerator addressGenerator,
     InternalTransactionExecutorFactory internalTransactionExecutorFactory
     )
 {
     this.network = network;
     this.contractPrimitiveSerializer = contractPrimitiveSerializer;
     this.vm = vm;
     this.addressGenerator = addressGenerator;
     this.internalTransactionExecutorFactory = internalTransactionExecutorFactory;
 }
Ejemplo n.º 5
0
 public InternalTransactionExecutor(ITransactionContext transactionContext, ISmartContractVirtualMachine vm,
                                    IContractStateRepository contractStateRepository,
                                    List <TransferInfo> internalTransferList,
                                    IKeyEncodingStrategy keyEncodingStrategy,
                                    ILoggerFactory loggerFactory,
                                    Network network)
 {
     this.transactionContext      = transactionContext;
     this.contractStateRepository = contractStateRepository;
     this.internalTransferList    = internalTransferList;
     this.keyEncodingStrategy     = keyEncodingStrategy;
     this.loggerFactory           = loggerFactory;
     this.logger  = loggerFactory.CreateLogger(this.GetType());
     this.network = network;
     this.vm      = vm;
 }
Ejemplo n.º 6
0
 public IInternalTransactionExecutor Create(ISmartContractVirtualMachine vm,
                                            IContractLogHolder contractLogHolder,
                                            IContractStateRepository stateRepository,
                                            List <TransferInfo> internalTransferList,
                                            ITransactionContext transactionContext)
 {
     return(new InternalTransactionExecutor(
                transactionContext,
                vm,
                contractLogHolder,
                stateRepository,
                internalTransferList,
                this.keyEncodingStrategy,
                this.loggerFactory,
                this.network
                ));
 }
 public CallSmartContract(IKeyEncodingStrategy keyEncodingStrategy,
                          ILoggerFactory loggerFactory,
                          Network network,
                          IContractStateRepository stateSnapshot,
                          ISmartContractResultRefundProcessor refundProcessor,
                          ISmartContractResultTransferProcessor transferProcessor,
                          ISmartContractVirtualMachine vm)
 {
     this.logger              = loggerFactory.CreateLogger(this.GetType());
     this.loggerFactory       = loggerFactory;
     this.stateSnapshot       = stateSnapshot;
     this.network             = network;
     this.keyEncodingStrategy = keyEncodingStrategy;
     this.refundProcessor     = refundProcessor;
     this.transferProcessor   = transferProcessor;
     this.vm = vm;
 }
Ejemplo n.º 8
0
 public ReflectionSmartContractExecutorFactory(
     IKeyEncodingStrategy keyEncodingStrategy,
     ILoggerFactory loggerFactory,
     Network network,
     ISmartContractResultRefundProcessor refundProcessor,
     ISmartContractResultTransferProcessor transferProcessor,
     SmartContractValidator validator,
     ISmartContractVirtualMachine vm)
 {
     this.keyEncodingStrategy = keyEncodingStrategy;
     this.loggerFactory       = loggerFactory;
     this.network             = network;
     this.refundProcessor     = refundProcessor;
     this.transferProcessor   = transferProcessor;
     this.validator           = validator;
     this.vm = vm;
 }