Skip to content
This repository has been archived by the owner on Nov 22, 2023. It is now read-only.

Commit

Permalink
convert string to StackItem
Browse files Browse the repository at this point in the history
  • Loading branch information
erikzhang committed Sep 21, 2018
1 parent 9d06c0f commit 94a91ae
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/neo-vm/StackItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ public virtual string GetString()
return new ByteArray(value);
}

public static implicit operator StackItem(string value)
{
return new ByteArray(Encoding.UTF8.GetBytes(value));
}

public static implicit operator StackItem(StackItem[] value)
{
return new Array(value);
Expand Down

0 comments on commit 94a91ae

Please sign in to comment.