mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-23 13:38:35 +00:00
Merge pull request #698 from nspcc-dev/fix/sendtoaddress
rpc: rename (*Client).SendToAddress to TransferAsset
This commit is contained in:
commit
f2397607b3
2 changed files with 5 additions and 6 deletions
|
@ -126,10 +126,10 @@ func (c *Client) sendRawTransaction(rawTX *transaction.Transaction) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// SendToAddress sends an amount of specific asset to a given address.
|
// TransferAsset sends an amount of specific asset to a given address.
|
||||||
// This call requires open wallet. (`wif` key in client struct.)
|
// This call requires open wallet. (`wif` key in client struct.)
|
||||||
// If response.Result is `true` then transaction was formed correctly and was written in blockchain.
|
// If response.Result is `true` then transaction was formed correctly and was written in blockchain.
|
||||||
func (c *Client) SendToAddress(asset util.Uint256, address string, amount util.Fixed8) (util.Uint256, error) {
|
func (c *Client) TransferAsset(asset util.Uint256, address string, amount util.Fixed8) (util.Uint256, error) {
|
||||||
var (
|
var (
|
||||||
err error
|
err error
|
||||||
rawTx *transaction.Transaction
|
rawTx *transaction.Transaction
|
||||||
|
@ -144,7 +144,7 @@ func (c *Client) SendToAddress(asset util.Uint256, address string, amount util.F
|
||||||
)
|
)
|
||||||
|
|
||||||
if rawTx, err = request.CreateRawContractTransaction(txParams); err != nil {
|
if rawTx, err = request.CreateRawContractTransaction(txParams); err != nil {
|
||||||
return resp, errors.Wrap(err, "failed to create raw transaction for `sendtoaddress`")
|
return resp, errors.Wrap(err, "failed to create raw transaction")
|
||||||
}
|
}
|
||||||
if err = c.sendRawTransaction(rawTx); err != nil {
|
if err = c.sendRawTransaction(rawTx); err != nil {
|
||||||
return resp, errors.Wrap(err, "failed to send raw transaction")
|
return resp, errors.Wrap(err, "failed to send raw transaction")
|
||||||
|
|
|
@ -12,9 +12,8 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
// ContractTxParams contains parameters for tx to transfer assets;
|
// ContractTxParams contains parameters for tx to transfer assets.
|
||||||
// includes parameters duplication `sendtoaddress` RPC call params
|
// It includes (*Client).TransferAsset call params and utility data.
|
||||||
// and also some utility data;
|
|
||||||
ContractTxParams struct {
|
ContractTxParams struct {
|
||||||
AssetID util.Uint256
|
AssetID util.Uint256
|
||||||
Address string
|
Address string
|
||||||
|
|
Loading…
Reference in a new issue