private static Execution Convert(ExecJson execJson) { Execution environment = new Execution(); environment.Address = execJson.Address == null ? null : new Address(execJson.Address); environment.Caller = execJson.Caller == null ? null : new Address(execJson.Caller); environment.Origin = execJson.Origin == null ? null : new Address(execJson.Origin); environment.Code = Bytes.FromHexString(execJson.Code); environment.Data = Bytes.FromHexString(execJson.Data); environment.Gas = Bytes.FromHexString(execJson.Gas).ToUInt256(); environment.GasPrice = Bytes.FromHexString(execJson.GasPrice).ToUInt256(); environment.Value = Bytes.FromHexString(execJson.Value).ToUInt256(); return(environment); }
private static Execution Convert(ExecJson execJson) { Execution environment = new Execution(); environment.Address = execJson.Address == null ? null : new Address(execJson.Address); environment.Caller = execJson.Caller == null ? null : new Address(execJson.Caller); environment.Origin = execJson.Origin == null ? null : new Address(execJson.Origin); environment.Code = Hex.ToBytes(execJson.Code); environment.Data = Hex.ToBytes(execJson.Data); environment.Gas = Hex.ToBytes(execJson.Gas).ToUnsignedBigInteger(); environment.GasPrice = Hex.ToBytes(execJson.GasPrice).ToUnsignedBigInteger(); environment.Value = Hex.ToBytes(execJson.Value).ToUnsignedBigInteger(); return(environment); }