Beispiel #1
0
 public State(ISmartContractStateFactory smartContractStateFactory,
              IStateRepository repository,
              IContractLogHolder contractLogHolder,
              List <TransferInfo> internalTransfers,
              IBlock block,
              uint256 transactionHash)
 {
     this.ContractState             = repository;
     this.LogHolder                 = contractLogHolder;
     this.internalTransfers         = internalTransfers;
     this.BalanceState              = new BalanceState(this.ContractState, this.InternalTransfers);
     this.NonceGenerator            = new NonceGenerator();
     this.Block                     = block;
     this.TransactionHash           = transactionHash;
     this.smartContractStateFactory = smartContractStateFactory;
 }
Beispiel #2
0
        private State(State state)
        {
            this.ContractState = state.ContractState.StartTracking();

            // We create a new log holder but use references to the original raw logs
            this.LogHolder = new ContractLogHolder();
            this.LogHolder.AddRawLogs(state.LogHolder.GetRawLogs());

            // We create a new list but use references to the original transfers.
            this.internalTransfers = new List <TransferInfo>(state.InternalTransfers);

            // Create a new balance state based off the old one but with the repository and internal transfers list reference
            this.BalanceState              = new BalanceState(this.ContractState, this.internalTransfers, state.BalanceState.InitialTransfer);
            this.NonceGenerator            = state.NonceGenerator;
            this.Block                     = state.Block;
            this.TransactionHash           = state.TransactionHash;
            this.smartContractStateFactory = state.smartContractStateFactory;
        }
 public State(
     ISmartContractStateFactory smartContractStateFactory,
     IStateRepository repository,
     IContractLogHolder contractLogHolder,
     List <TransferInfo> internalTransfers,
     IBlock block,
     Network network,
     ulong txAmount,
     uint256 transactionHash)
 {
     this.ContractState             = repository;
     this.LogHolder                 = contractLogHolder;
     this.internalTransfers         = internalTransfers;
     this.BalanceState              = new BalanceState(this.ContractState, txAmount, this.InternalTransfers);
     this.Network                   = network;
     this.Nonce                     = 0;
     this.Block                     = block;
     this.TransactionHash           = transactionHash;
     this.smartContractStateFactory = smartContractStateFactory;
 }
Beispiel #4
0
 public StateFactory(ISmartContractStateFactory smartContractStateFactory)
 {
     this.smartContractStateFactory = smartContractStateFactory;
 }
 public StateFactory(Network network,
                     ISmartContractStateFactory smartContractStateFactory)
 {
     this.network = network;
     this.smartContractStateFactory = smartContractStateFactory;
 }