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

Add data #686

Merged
merged 4 commits into from
Dec 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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