Skip to content

Commit

Permalink
Changes to version 1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Relfos committed Oct 11, 2019
1 parent e5667e5 commit 3653d6b
Show file tree
Hide file tree
Showing 59 changed files with 2,149 additions and 211 deletions.
6 changes: 3 additions & 3 deletions Assets/Neo/Core/NEP5.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,17 @@ public IEnumerator BalanceOf(byte[] addressHash, Action<BigInteger> callback)
});
}

public IEnumerator Transfer(UnspentEntries unspent, NeoKeys from_key, string to_address, BigInteger amount, string interop, Action<Transaction> callback)
public IEnumerator Transfer(UnspentEntries unspent, NeoKeys from_key, string to_address, BigInteger amount, string interop, Action<Transaction, string> callback)
{
return Transfer(unspent, from_key, to_address.GetScriptHashFromAddress(), amount, interop, callback);
}

public IEnumerator Transfer(UnspentEntries unspent, NeoKeys from_key, UInt160 to_address_hash, BigInteger amount, string interop, Action<Transaction> callback)
public IEnumerator Transfer(UnspentEntries unspent, NeoKeys from_key, UInt160 to_address_hash, BigInteger amount, string interop, Action<Transaction, string> callback)
{
return Transfer(unspent, from_key, to_address_hash.ToArray(), amount, interop, callback);
}

public IEnumerator Transfer(UnspentEntries unspent, NeoKeys from_key, byte[] to_address_hash, BigInteger amount, string interop, Action<Transaction> callback)
public IEnumerator Transfer(UnspentEntries unspent, NeoKeys from_key, byte[] to_address_hash, BigInteger amount, string interop, Action<Transaction, string> callback)
{
var sender_address_hash = from_key.Address.GetScriptHashFromAddress();
return api.CallContract(callback, unspent, from_key, ScriptHash, "transfer", new object[] { sender_address_hash, to_address_hash, amount}, interop);
Expand Down
34 changes: 17 additions & 17 deletions Assets/Neo/Core/NeoAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -591,18 +591,18 @@ public void GenerateInputsOutputs(UnspentEntries unspent, UInt160 from_script_ha
}
}

public IEnumerator CallContract(Action<Transaction> callback, UnspentEntries unspent, NeoKeys key, UInt160 scriptHash, string operation, object[] args, string interop, string attachSymbol = null, IEnumerable<Transaction.Output> attachTargets = null)
public IEnumerator CallContract(Action<Transaction, string> callback, UnspentEntries unspent, NeoKeys key, UInt160 scriptHash, string operation, object[] args, string interop, string attachSymbol = null, IEnumerable<Transaction.Output> attachTargets = null)
{
return CallContract(callback, unspent, key, scriptHash, new object[] { operation, args }, interop, attachSymbol, attachTargets);
}

public IEnumerator CallContract(Action<Transaction> callback, UnspentEntries unspent, NeoKeys key, UInt160 scriptHash, object[] args, string interop, string attachSymbol = null, IEnumerable<Transaction.Output> attachTargets = null)
public IEnumerator CallContract(Action<Transaction, string> callback, UnspentEntries unspent, NeoKeys key, UInt160 scriptHash, object[] args, string interop, string attachSymbol = null, IEnumerable<Transaction.Output> attachTargets = null)
{
var bytes = GenerateScript(scriptHash, args);
return CallContract(callback, unspent, key, scriptHash, bytes, interop, attachSymbol, attachTargets);
}

public IEnumerator CallContract(Action<Transaction> callback, UnspentEntries unspent, NeoKeys key, UInt160 scriptHash, byte[] bytes, string interop, string attachSymbol = null, IEnumerable<Transaction.Output> attachTargets = null)
public IEnumerator CallContract(Action<Transaction, string> callback, UnspentEntries unspent, NeoKeys key, UInt160 scriptHash, byte[] bytes, string interop, string attachSymbol = null, IEnumerable<Transaction.Output> attachTargets = null)
{
List<Transaction.Input> inputs = null;
List<Transaction.Output> outputs = null;
Expand Down Expand Up @@ -636,9 +636,9 @@ public IEnumerator CallContract(Action<Transaction> callback, UnspentEntries uns

transaction.Sign(key);

return SendTransaction(transaction, (success) =>
return SendTransaction(transaction, (error) =>
{
callback(success ? transaction : null);
callback(string.IsNullOrEmpty(error) ? transaction : null, error);
});
}

Expand All @@ -648,7 +648,7 @@ public IEnumerator GetTransaction(string hash, Action<Transaction> callback)
return GetTransaction(val, callback);
}

public IEnumerator SendAsset(Action<Transaction> callback, UnspentEntries unspent, NeoKeys fromKey, string toAddress, string symbol, decimal amount, string interop)
public IEnumerator SendAsset(Action<Transaction, string> callback, UnspentEntries unspent, NeoKeys fromKey, string toAddress, string symbol, decimal amount, string interop)
{
if (String.Equals(fromKey.Address, toAddress, StringComparison.OrdinalIgnoreCase))
{
Expand All @@ -661,7 +661,7 @@ public IEnumerator SendAsset(Action<Transaction> callback, UnspentEntries unspen
return SendAsset(callback, unspent, fromKey, symbol, targets, interop);
}

public IEnumerator SendAsset(Action<Transaction> callback, UnspentEntries unspent, NeoKeys fromKey, string symbol, IEnumerable<Transaction.Output> targets, string interop)
public IEnumerator SendAsset(Action<Transaction, string> callback, UnspentEntries unspent, NeoKeys fromKey, string symbol, IEnumerable<Transaction.Output> targets, string interop)
{
List<Transaction.Input> inputs;
List<Transaction.Output> outputs;
Expand All @@ -681,13 +681,13 @@ public IEnumerator SendAsset(Action<Transaction> callback, UnspentEntries unspen

tx.Sign(fromKey);

return SendTransaction(tx, (success) =>
return SendTransaction(tx, (error) =>
{
callback(success ? tx : null);
callback(string.IsNullOrEmpty(error) ? tx : null, error);
});
}

public IEnumerator ClaimGas(UnspentEntries unspent, NeoKeys ownerKey, List<UnspentEntry> claimable, decimal amount, Action<Transaction> callback)
public IEnumerator ClaimGas(UnspentEntries unspent, NeoKeys ownerKey, List<UnspentEntry> claimable, decimal amount, Action<Transaction, string> callback)
{
var targetScriptHash = new UInt160(ownerKey.Address.AddressToScriptHash());

Expand Down Expand Up @@ -727,9 +727,9 @@ public IEnumerator ClaimGas(UnspentEntries unspent, NeoKeys ownerKey, List<Unspe

tx.Sign(ownerKey);

return SendTransaction(tx, (sucess) =>
return SendTransaction(tx, (error) =>
{
callback(sucess ? tx : null);
callback(string.IsNullOrEmpty(error) ? tx : null, error);
});
}

Expand Down Expand Up @@ -903,7 +903,7 @@ public IEnumerator GetClaimable(UInt160 hash, Action<List<UnspentEntry>, decimal
, ErrorHandler, url);
}

public IEnumerator SendRawTransaction(string hexTx, Action<bool> callback)
public IEnumerator SendRawTransaction(string hexTx, Action<string> callback)
{
return ExecuteRequestRPC((response) =>
{
Expand All @@ -920,17 +920,17 @@ public IEnumerator SendRawTransaction(string hexTx, Action<bool> callback)
result = response.AsBool();
}
callback(result);
callback(result ? null :"sendrawtx rpc returned false");
}
catch
catch (Exception e)
{
callback(false);
callback(e.ToString());
}
},
ErrorHandler, "sendrawtransaction", new object[] { hexTx });
}

protected IEnumerator SendTransaction(Transaction tx, Action<bool> callback)
protected IEnumerator SendTransaction(Transaction tx, Action<string> callback)
{
var rawTx = tx.Serialize(true);
var hexTx = rawTx.ByteToHex();
Expand Down
Binary file modified Assets/Plugins/Phantasma.Blockchain.dll
Binary file not shown.
Binary file modified Assets/Plugins/Phantasma.Contracts.dll
Binary file not shown.
Binary file modified Assets/Plugins/Phantasma.Core.dll
Binary file not shown.
Binary file modified Assets/Plugins/Phantasma.Cryptography.dll
Binary file not shown.
Binary file modified Assets/Plugins/Phantasma.Domain.dll
Binary file not shown.
Binary file modified Assets/Plugins/Phantasma.Numerics.dll
Binary file not shown.
Binary file removed Assets/Plugins/Phantasma.P2P.dll
Binary file not shown.
33 changes: 0 additions & 33 deletions Assets/Plugins/Phantasma.P2P.dll.meta

This file was deleted.

Binary file modified Assets/Plugins/Phantasma.VM.dll
Binary file not shown.
Binary file added Assets/Resources/Tokens/ACAT.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
91 changes: 91 additions & 0 deletions Assets/Resources/Tokens/ACAT.png.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Assets/Resources/Tokens/APH.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
91 changes: 91 additions & 0 deletions Assets/Resources/Tokens/APH.png.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Assets/Resources/Tokens/AVA.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 3653d6b

Please sign in to comment.