public static PrimitiveReturn convertStackItem(PrimitiveType item) { return(item.Type switch { StackItemType.Boolean => new PrimitiveReturn(item, item.GetBoolean()), StackItemType.Integer => new IntegerReturn(item, item.GetInteger().ToByteArray()), StackItemType.ByteString => new PrimitiveReturn(item, item.GetSpan().ToArray()), _ => throw new ArgumentException($"{item.Type} is not a valid StackItem argument") });
public ByteArrayWrapper(PrimitiveType value) { this.array = value.GetSpan().ToArray(); }