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

Commit

Permalink
Add data (#686)
Browse files Browse the repository at this point in the history
* Sync to neo-project/neo#2096

* Update neo-cli/CLI/MainService.NEP5.cs

Co-authored-by: Shargon <shargon@gmail.com>

* update to 3.0.0-CI01091

Co-authored-by: Shargon <shargon@gmail.com>
  • Loading branch information
superboyiii and shargon committed Dec 3, 2020
1 parent 5bfa70e commit 8737259
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions neo-cli/CLI/MainService.NEP5.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ partial class MainService
/// <param name="from">From</param>
/// <param name="signersAccounts">Signer's accounts</param>
[ConsoleCommand("transfer", Category = "NEP5 Commands")]
private void OnTransferCommand(UInt160 tokenHash, UInt160 to, decimal amount, UInt160 from = null, UInt160[] signersAccounts = null)
private void OnTransferCommand(UInt160 tokenHash, UInt160 to, decimal amount, string data = null, UInt160 from = null, UInt160[] signersAccounts = null)
{
var asset = new AssetDescriptor(tokenHash);
var value = BigDecimal.Parse(amount.ToString(CultureInfo.InvariantCulture), asset.Decimals);
Expand All @@ -36,7 +36,8 @@ private void OnTransferCommand(UInt160 tokenHash, UInt160 to, decimal amount, UI
{
AssetId = tokenHash,
Value = value,
ScriptHash = to
ScriptHash = to,
Data = data
}
}, from: from, cosigners: signersAccounts?.Select(p => new Signer
{
Expand Down
5 changes: 3 additions & 2 deletions neo-cli/CLI/MainService.Wallet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ private void OnSignCommand(JObject jsonObjectToSign)
/// <param name="from">From</param>
/// <param name="signerAccounts">Signer's accounts</param>
[ConsoleCommand("send", Category = "Wallet Commands")]
private void OnSendCommand(UInt160 asset, UInt160 to, string amount, UInt160 from = null, UInt160[] signerAccounts = null)
private void OnSendCommand(UInt160 asset, UInt160 to, string amount, string data = null, UInt160 from = null, UInt160[] signerAccounts = null)
{
if (NoWallet()) return;
string password = ReadUserInput("password", true);
Expand Down Expand Up @@ -480,7 +480,8 @@ private void OnSendCommand(UInt160 asset, UInt160 to, string amount, UInt160 fro
{
AssetId = asset,
Value = decimalAmount,
ScriptHash = to
ScriptHash = to,
Data = data
}
}, from: from, cosigners: signerAccounts?.Select(p => new Signer
{
Expand Down
2 changes: 1 addition & 1 deletion neo-cli/neo-cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Neo" Version="3.0.0-CI01089" />
<PackageReference Include="Neo" Version="3.0.0-CI01091" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 8737259

Please sign in to comment.