diff --git a/cmd/account/account.go b/cmd/account/account.go index 3e50dd01..61581ebd 100644 --- a/cmd/account/account.go +++ b/cmd/account/account.go @@ -2,17 +2,27 @@ package account import ( "github.com/spf13/cobra" + flag "github.com/spf13/pflag" "github.com/oasisprotocol/cli/cmd/account/show" ) -var Cmd = &cobra.Command{ - Use: "account", - Short: "Account operations", - Aliases: []string{"a", "acc", "accounts"}, -} +// SubtractFeeFlags is a force mode switch. +var ( + subtractFee bool + SubtractFeeFlags *flag.FlagSet + + Cmd = &cobra.Command{ + Use: "account", + Short: "Account operations", + Aliases: []string{"a", "acc", "accounts"}, + } +) func init() { + SubtractFeeFlags = flag.NewFlagSet("", flag.ContinueOnError) + SubtractFeeFlags.BoolVar(&subtractFee, "subtract-fee", false, "subtract fee from the amount") + Cmd.AddCommand(allowCmd) Cmd.AddCommand(amendCommissionScheduleCmd) Cmd.AddCommand(burnCmd) diff --git a/cmd/account/transfer.go b/cmd/account/transfer.go index 1f6bfcb6..6b119eff 100644 --- a/cmd/account/transfer.go +++ b/cmd/account/transfer.go @@ -3,6 +3,7 @@ package account import ( "context" + "github.com/oasisprotocol/oasis-core/go/common/quantity" "github.com/spf13/cobra" staking "github.com/oasisprotocol/oasis-core/go/staking/api" @@ -60,6 +61,7 @@ var transferCmd = &cobra.Command{ var sigTx, meta interface{} switch npa.ParaTime { case nil: + // Consensus layer transfer. common.CheckForceErr(common.CheckAddressIsConsensusCapable(cfg, toAddr.String())) if toEthAddr != nil { common.CheckForceErr(common.CheckAddressIsConsensusCapable(cfg, toEthAddr.Hex())) @@ -69,29 +71,46 @@ var transferCmd = &cobra.Command{ cobra.CheckErr("consensus layer only supports the native denomination") } - // Consensus layer transfer. - amount, err := helpers.ParseConsensusDenomination(npa.Network, amount) + amt, err := helpers.ParseConsensusDenomination(npa.Network, amount) cobra.CheckErr(err) // Prepare transaction. - tx := staking.NewTransferTx(0, nil, &staking.Transfer{ + innerTx := staking.Transfer{ To: toAddr.ConsensusAddress(), - Amount: *amount, - }) - + Amount: *amt, + } + tx := staking.NewTransferTx(0, nil, &innerTx) + if subtractFee { + var fee *quantity.Quantity + _, fee, err = common.PrepareConsensusTransaction(ctx, npa, acc.ConsensusSigner(), conn, tx) + cobra.CheckErr(err) + err = amt.Sub(fee) + cobra.CheckErr(err) + innerTx.Amount = *amt + tx = staking.NewTransferTx(0, nil, &innerTx) + } sigTx, err = common.SignConsensusTransaction(ctx, npa, acc, conn, tx) cobra.CheckErr(err) default: // ParaTime transfer. - amountBaseUnits, err := helpers.ParseParaTimeDenomination(npa.ParaTime, amount, types.Denomination(denom)) + amtBaseUnits, err := helpers.ParseParaTimeDenomination(npa.ParaTime, amount, types.Denomination(denom)) cobra.CheckErr(err) // Prepare transaction. - tx := accounts.NewTransferTx(nil, &accounts.Transfer{ + innerTx := accounts.Transfer{ To: *toAddr, - Amount: *amountBaseUnits, - }) - + Amount: *amtBaseUnits, + } + tx := accounts.NewTransferTx(nil, &innerTx) + if subtractFee { + var fee *quantity.Quantity + _, fee, _, err = common.PrepareParatimeTransaction(ctx, npa, acc, conn, tx) + cobra.CheckErr(err) + err = amtBaseUnits.Amount.Sub(fee) + cobra.CheckErr(err) + innerTx.Amount = *amtBaseUnits + tx = accounts.NewTransferTx(nil, &innerTx) + } txDetails := sdkSignature.TxDetails{OrigTo: toEthAddr} sigTx, meta, err = common.SignParaTimeTransaction(ctx, npa, acc, conn, tx, &txDetails) cobra.CheckErr(err) @@ -102,6 +121,7 @@ var transferCmd = &cobra.Command{ } func init() { + transferCmd.Flags().AddFlagSet(SubtractFeeFlags) transferCmd.Flags().AddFlagSet(common.SelectorFlags) transferCmd.Flags().AddFlagSet(common.RuntimeTxFlags) transferCmd.Flags().AddFlagSet(common.ForceFlag) diff --git a/cmd/account/withdraw.go b/cmd/account/withdraw.go index b9fc97ad..ec584aca 100644 --- a/cmd/account/withdraw.go +++ b/cmd/account/withdraw.go @@ -7,6 +7,7 @@ import ( ethCommon "github.com/ethereum/go-ethereum/common" "github.com/spf13/cobra" + "github.com/oasisprotocol/oasis-core/go/common/quantity" "github.com/oasisprotocol/oasis-sdk/client-sdk/go/client" "github.com/oasisprotocol/oasis-sdk/client-sdk/go/connection" "github.com/oasisprotocol/oasis-sdk/client-sdk/go/helpers" @@ -75,12 +76,22 @@ var withdrawCmd = &cobra.Command{ cobra.CheckErr(err) // Prepare transaction. - tx := consensusaccounts.NewWithdrawTx(nil, &consensusaccounts.Withdraw{ + innerTx := consensusaccounts.Withdraw{ To: toAddr, Amount: *amountBaseUnits, - }) + } + tx := consensusaccounts.NewWithdrawTx(nil, &innerTx) acc := common.LoadAccount(cfg, npa.AccountName) + if subtractFee { + var fee *quantity.Quantity + _, fee, _, err = common.PrepareParatimeTransaction(ctx, npa, acc, conn, tx) + cobra.CheckErr(err) + err = amountBaseUnits.Amount.Sub(fee) + cobra.CheckErr(err) + innerTx.Amount = *amountBaseUnits + tx = consensusaccounts.NewWithdrawTx(nil, &innerTx) + } sigTx, meta, err := common.SignParaTimeTransaction(ctx, npa, acc, conn, tx, nil) cobra.CheckErr(err) @@ -125,6 +136,7 @@ var withdrawCmd = &cobra.Command{ } func init() { + withdrawCmd.Flags().AddFlagSet(SubtractFeeFlags) withdrawCmd.Flags().AddFlagSet(common.SelectorFlags) withdrawCmd.Flags().AddFlagSet(common.RuntimeTxFlags) withdrawCmd.Flags().AddFlagSet(common.ForceFlag) diff --git a/cmd/common/transaction.go b/cmd/common/transaction.go index a165d55d..d1dd43c3 100644 --- a/cmd/common/transaction.go +++ b/cmd/common/transaction.go @@ -88,82 +88,99 @@ func isRuntimeTx(tx interface{}) bool { return isRuntimeTx } +// PrepareConsensusTransaction initialized nonce and gas fields of the +// consensus transaction and estimates gas. +// +// Returns the estimated gas limit and total fee amount. +func PrepareConsensusTransaction(ctx context.Context, npa *NPASelection, signer coreSignature.Signer, conn connection.Connection, tx *consensusTx.Transaction) (consensusTx.Gas, *quantity.Quantity, error) { + // Nonce is required for correct gas estimation. + if tx.Nonce == 0 { + tx.Nonce = txNonce + } + + // Default to passed values and do online estimation when possible. + if tx.Fee == nil { + tx.Fee = &consensusTx.Fee{} + } + tx.Fee.Gas = consensusTx.Gas(txGasLimit) + + // Gas price estimation if not specified. + gasPrice := quantity.NewQuantity() + var err error + if txGasPrice != "" { + gasPrice, err = helpers.ParseConsensusDenomination(npa.Network, txGasPrice) + if err != nil { + return 0, nil, fmt.Errorf("bad gas price: %w", err) + } + } + + // Gas limit estimation if not specified. + gas := consensusTx.Gas(txGasLimit) + if !txOffline && gas == invalidGasLimit { + gas, err = conn.Consensus().EstimateGas(ctx, &consensus.EstimateGasRequest{ + Signer: signer.Public(), + Transaction: tx, + }) + if err != nil { + return 0, nil, fmt.Errorf("failed to estimate gas: %w", err) + } + } + + // Compute the fee. + fee := gasPrice.Clone() + if err = fee.Mul(quantity.NewFromUint64(uint64(gas))); err != nil { + return 0, nil, fmt.Errorf("failed to compute gas fee: %w", err) + } + return gas, fee, nil +} + // SignConsensusTransaction signs a consensus transaction. func SignConsensusTransaction( ctx context.Context, npa *NPASelection, - wallet wallet.Account, + account wallet.Account, conn connection.Connection, tx *consensusTx.Transaction, ) (interface{}, error) { - // Require consensus signer. - signer := wallet.ConsensusSigner() + // Sanity checks. + signer := account.ConsensusSigner() if signer == nil { return nil, fmt.Errorf("account does not support signing consensus transactions") } - if txEncrypted { return nil, fmt.Errorf("--encrypted not supported for consensus transactions") } - - // Default to passed values and do online estimation when possible. - tx.Nonce = txNonce - if tx.Fee == nil { - tx.Fee = &consensusTx.Fee{} - } - tx.Fee.Gas = consensusTx.Gas(txGasLimit) - - // For sanity make sure no fee denomination has been specified. if txFeeDenom != "" { return nil, fmt.Errorf("consensus layer only supports the native denomination for paying fees") } - gasPrice := quantity.NewQuantity() - if txGasPrice != "" { - var err error - gasPrice, err = helpers.ParseConsensusDenomination(npa.Network, txGasPrice) - if err != nil { - return nil, fmt.Errorf("bad gas price: %w", err) - } + gas, fee, err := PrepareConsensusTransaction(ctx, npa, signer, conn, tx) + if err != nil { + return nil, err } - if !txOffline { //nolint: nestif - // Query nonce if not specified. - if tx.Nonce == invalidNonce { - nonce, err := conn.Consensus().GetSignerNonce(ctx, &consensus.GetSignerNonceRequest{ - AccountAddress: wallet.Address().ConsensusAddress(), - Height: consensus.HeightLatest, - }) - if err != nil { - return nil, fmt.Errorf("failed to query nonce: %w", err) - } - tx.Nonce = nonce - } + if tx.Fee.Gas == invalidGasLimit { + tx.Fee.Gas = gas + tx.Fee.Amount = *fee + } - // Gas estimation if not specified. - if tx.Fee.Gas == invalidGasLimit { - gas, err := conn.Consensus().EstimateGas(ctx, &consensus.EstimateGasRequest{ - Signer: signer.Public(), - Transaction: tx, - }) - if err != nil { - return nil, fmt.Errorf("failed to estimate gas: %w", err) - } - tx.Fee.Gas = gas + // Query nonce if not specified. + if !txOffline && tx.Nonce == invalidNonce { + var nonce uint64 + nonce, err = conn.Consensus().GetSignerNonce(ctx, &consensus.GetSignerNonceRequest{ + AccountAddress: account.Address().ConsensusAddress(), + Height: consensus.HeightLatest, + }) + if err != nil { + return nil, fmt.Errorf("failed to query nonce: %w", err) } + tx.Nonce = nonce } // If we are using offline mode and either nonce or gas limit is not specified, abort. if tx.Nonce == invalidNonce || tx.Fee.Gas == invalidGasLimit { return nil, fmt.Errorf("nonce and/or gas limit must be specified in offline mode") } - - // Compute fee amount based on gas price. - if err := gasPrice.Mul(quantity.NewFromUint64(uint64(tx.Fee.Gas))); err != nil { - return nil, err - } - tx.Fee.Amount = *gasPrice - if txUnsigned { // Return an unsigned transaction. return tx, nil @@ -183,24 +200,14 @@ func SignConsensusTransaction( return &consensusTx.SignedTransaction{Signed: *signed}, nil } -// SignParaTimeTransaction signs a ParaTime transaction. +// PrepareParatimeTransaction initializes nonce and gas fields of the ParaTime +// transaction and estimates gas. // -// Returns the signed transaction and call format-specific metadata for result decoding. -func SignParaTimeTransaction( - ctx context.Context, - npa *NPASelection, - account wallet.Account, - conn connection.Connection, - tx *types.Transaction, - txDetails *signature.TxDetails, -) (interface{}, interface{}, error) { - if npa.ParaTime == nil { - return nil, nil, fmt.Errorf("no ParaTime configured for ParaTime transaction signing") - } - +// Returns the estimated gas limit, total fee amount and fee denominator. +func PrepareParatimeTransaction(ctx context.Context, npa *NPASelection, account wallet.Account, conn connection.Connection, tx *types.Transaction) (uint64, *quantity.Quantity, types.Denomination, error) { // Determine whether the signer information for a transaction has already been set. - var hasSignerInfo bool accountAddressSpec := account.SignatureAddressSpec() + var hasSignerInfo bool for _, si := range tx.AuthInfo.SignerInfo { if si.AddressSpec.Signature == nil { continue @@ -212,74 +219,89 @@ func SignParaTimeTransaction( break } - // Default to passed values and do online estimation when possible. - if tx.AuthInfo.Fee.Gas == 0 { - tx.AuthInfo.Fee.Gas = txGasLimit - } - - feeDenom := types.Denomination(txFeeDenom) - - gasPrice := &types.BaseUnits{} - if txGasPrice != "" { - var err error - gasPrice, err = helpers.ParseParaTimeDenomination(npa.ParaTime, txGasPrice, feeDenom) - if err != nil { - return nil, nil, fmt.Errorf("bad gas price: %w", err) - } - } - + var err error if !hasSignerInfo { nonce := txNonce - // Query nonce if not specified. if !txOffline && nonce == invalidNonce { - var err error nonce, err = conn.Runtime(npa.ParaTime).Accounts.Nonce(ctx, client.RoundLatest, account.Address()) if err != nil { - return nil, nil, fmt.Errorf("failed to query nonce: %w", err) + return 0, nil, "", fmt.Errorf("failed to query nonce: %w", err) } } if nonce == invalidNonce { - return nil, nil, fmt.Errorf("nonce must be specified in offline mode") + return 0, nil, "", fmt.Errorf("nonce must be specified in offline mode") } // Prepare the transaction before (optional) gas estimation to ensure correct estimation. - tx.AppendAuthSignature(account.SignatureAddressSpec(), nonce) + tx.AppendAuthSignature(accountAddressSpec, nonce) } - if !txOffline { //nolint: nestif - // Gas estimation if not specified. - if tx.AuthInfo.Fee.Gas == invalidGasLimit { - var err error - tx.AuthInfo.Fee.Gas, err = conn.Runtime(npa.ParaTime).Core.EstimateGas(ctx, client.RoundLatest, tx, false) - if err != nil { - return nil, nil, fmt.Errorf("failed to estimate gas: %w", err) - } + // Gas price estimation if not specified. + gasPrice := &types.BaseUnits{} + feeDenom := types.Denomination(txFeeDenom) + if txGasPrice != "" { + gasPrice, err = helpers.ParseParaTimeDenomination(npa.ParaTime, txGasPrice, feeDenom) + if err != nil { + return 0, nil, "", fmt.Errorf("bad gas price: %w", err) } + } else if !txOffline { + var mgp map[types.Denomination]types.Quantity + mgp, err = conn.Runtime(npa.ParaTime).Core.MinGasPrice(ctx) + if err != nil { + return 0, nil, "", fmt.Errorf("failed to query minimum gas price: %w", err) + } + *gasPrice = types.NewBaseUnits(mgp[feeDenom], feeDenom) + } - // Gas price determination if not specified. - if txGasPrice == "" { - mgp, err := conn.Runtime(npa.ParaTime).Core.MinGasPrice(ctx) - if err != nil { - return nil, nil, fmt.Errorf("failed to query minimum gas price: %w", err) - } - - *gasPrice = types.NewBaseUnits(mgp[feeDenom], feeDenom) + // Gas limit estimation if not specified. + gas := txGasLimit + if gas == invalidGasLimit && !txOffline { + gas, err = conn.Runtime(npa.ParaTime).Core.EstimateGas(ctx, client.RoundLatest, tx, false) + if err != nil { + return 0, nil, "", fmt.Errorf("failed to estimate gas: %w", err) } } - // If we are using offline mode and gas limit is not specified, abort. - if tx.AuthInfo.Fee.Gas == invalidGasLimit { - return nil, nil, fmt.Errorf("gas limit must be specified in offline mode") + // Compute fee. + fee := gasPrice.Amount.Clone() + if err = fee.Mul(quantity.NewFromUint64(gas)); err != nil { + return 0, nil, "", err } + return gas, fee, feeDenom, nil +} - // Compute fee amount based on gas price. - if err := gasPrice.Amount.Mul(quantity.NewFromUint64(tx.AuthInfo.Fee.Gas)); err != nil { +// SignParaTimeTransaction signs a ParaTime transaction. +// +// Returns the signed transaction and call format-specific metadata for result decoding. +func SignParaTimeTransaction( + ctx context.Context, + npa *NPASelection, + account wallet.Account, + conn connection.Connection, + tx *types.Transaction, + txDetails *signature.TxDetails, +) (interface{}, interface{}, error) { + if npa.ParaTime == nil { + return nil, nil, fmt.Errorf("no ParaTime configured for ParaTime transaction signing") + } + + gas, fee, feeDenom, err := PrepareParatimeTransaction(ctx, npa, account, conn, tx) + if err != nil { return nil, nil, err } - tx.AuthInfo.Fee.Amount.Amount = gasPrice.Amount - tx.AuthInfo.Fee.Amount.Denomination = gasPrice.Denomination + + if tx.AuthInfo.Fee.Gas == 0 { + tx.AuthInfo.Fee.Gas = gas + tx.AuthInfo.Fee.Amount.Amount = *fee + tx.AuthInfo.Fee.Amount.Denomination = feeDenom + } + + // If we are using offline mode and gas limit is not specified, abort. + if tx.AuthInfo.Fee.Gas == invalidGasLimit { + return nil, nil, fmt.Errorf("gas limit must be specified in offline mode") + } // Handle confidential transactions. var meta interface{} @@ -328,7 +350,7 @@ func SignParaTimeTransaction( return ts.UnverifiedTransaction(), meta, nil } -// PrintTransaction prints the transaction which can be either signed or unsigned. +// PrintTransactionRaw prints the transaction which can be either signed or unsigned. func PrintTransactionRaw(npa *NPASelection, tx interface{}) { switch rtx := tx.(type) { case consensusPretty.PrettyPrinter: diff --git a/docs/account.md b/docs/account.md index 79219ad3..9f6ecd0c 100644 --- a/docs/account.md +++ b/docs/account.md @@ -231,6 +231,13 @@ Consensus layer token transfers: ::: +:::info + +The [`--subtract-fee`](#subtract-fee) flag is available both for consensus +and ParaTime transfers. + +::: + ## Allowance {#allow} `account allow ` command makes your funds withdrawable by @@ -364,6 +371,13 @@ not supported on the consensus layer! ::: +:::info + +The [`--subtract-fee`](#subtract-fee) flag is available for withdrawal +transactions. + +::: + ## Delegate Tokens to a Validator {#delegate} To stake your tokens on the consensus layer, run @@ -528,6 +542,16 @@ the standard output for you to examine. Use [`--output-file`](#output-file), if you wish to save the transaction to the file and submit it to the network afterwards by using the [`transaction submit`][transaction-submit] command. +### Subtract fee {#subtract-fee} + +To include the transaction fee inside the given amount, pass the +`--subtract-fee` flag. This comes handy, if you want to drain the account or +keep it rounded to some specific number. + +![code shell](../examples/account/transfer-subtract-fee.y.in) + +![code shell](../examples/account/transfer-subtract-fee.y.out) + ### Account's Nonce {#nonce} `--nonce ` will override the detection of the account's nonce used diff --git a/examples/account/allow-paratime.y.out b/examples/account/allow-paratime.y.out index 78fc3e01..a929a427 100644 --- a/examples/account/allow-paratime.y.out +++ b/examples/account/allow-paratime.y.out @@ -6,7 +6,7 @@ Body: Nonce: 2 Fee: Amount: 0.0 TEST - Gas limit: 1278 + Gas limit: 1286 (gas price: 0.0 TEST per gas unit) Network: testnet diff --git a/examples/account/allow.y.out b/examples/account/allow.y.out index 3cad3244..5d4e9ea8 100644 --- a/examples/account/allow.y.out +++ b/examples/account/allow.y.out @@ -6,7 +6,7 @@ Body: Nonce: 2 Fee: Amount: 0.0 TEST - Gas limit: 1278 + Gas limit: 1286 (gas price: 0.0 TEST per gas unit) Network: testnet diff --git a/examples/account/amend-commission-schedule.y.out b/examples/account/amend-commission-schedule.y.out index b8ae9911..79f2df20 100644 --- a/examples/account/amend-commission-schedule.y.out +++ b/examples/account/amend-commission-schedule.y.out @@ -15,7 +15,7 @@ Body: Nonce: 2 Fee: Amount: 0.0 TEST - Gas limit: 1361 + Gas limit: 1369 (gas price: 0.0 TEST per gas unit) Network: testnet diff --git a/examples/account/burn.y.out b/examples/account/burn.y.out index ff1b1e5b..b9a09467 100644 --- a/examples/account/burn.y.out +++ b/examples/account/burn.y.out @@ -5,7 +5,7 @@ Body: Nonce: 2 Fee: Amount: 0.0 TEST - Gas limit: 1235 + Gas limit: 1243 (gas price: 0.0 TEST per gas unit) Network: testnet diff --git a/examples/account/delegate.y.out b/examples/account/delegate.y.out index e099a20a..1a0da7e7 100644 --- a/examples/account/delegate.y.out +++ b/examples/account/delegate.y.out @@ -6,7 +6,7 @@ Body: Nonce: 2 Fee: Amount: 0.0 TEST - Gas limit: 1271 + Gas limit: 1279 (gas price: 0.0 TEST per gas unit) Network: testnet diff --git a/examples/account/entity-deregister.y.out b/examples/account/entity-deregister.y.out index 6a96808e..3b948399 100644 --- a/examples/account/entity-deregister.y.out +++ b/examples/account/entity-deregister.y.out @@ -5,7 +5,7 @@ Body: Nonce: 2 Fee: Amount: 0.0 TEST - Gas limit: 1231 + Gas limit: 1239 (gas price: 0.0 TEST per gas unit) Network: testnet diff --git a/examples/account/entity-register.y.out b/examples/account/entity-register.y.out index ea9103db..1e31185e 100644 --- a/examples/account/entity-register.y.out +++ b/examples/account/entity-register.y.out @@ -19,7 +19,7 @@ Body: Nonce: 2 Fee: Amount: 0.0 TEST - Gas limit: 2471 + Gas limit: 2479 (gas price: 0.0 TEST per gas unit) Network: testnet diff --git a/examples/account/node-unfreeze.y.out b/examples/account/node-unfreeze.y.out index 00538de2..63dff9df 100644 --- a/examples/account/node-unfreeze.y.out +++ b/examples/account/node-unfreeze.y.out @@ -7,7 +7,7 @@ Body: Nonce: 2 Fee: Amount: 0.0 TEST - Gas limit: 1274 + Gas limit: 1282 (gas price: 0.0 TEST per gas unit) Network: testnet diff --git a/examples/account/transfer-named-no-paratime.y.out b/examples/account/transfer-named-no-paratime.y.out index d5ff22d7..7843cde1 100644 --- a/examples/account/transfer-named-no-paratime.y.out +++ b/examples/account/transfer-named-no-paratime.y.out @@ -6,7 +6,7 @@ Body: Nonce: 0 Fee: Amount: 0.0 TEST - Gas limit: 1264 + Gas limit: 1272 (gas price: 0.0 TEST per gas unit) Network: testnet diff --git a/examples/account/transfer-subtract-fee.y.in b/examples/account/transfer-subtract-fee.y.in new file mode 100644 index 00000000..90395aab --- /dev/null +++ b/examples/account/transfer-subtract-fee.y.in @@ -0,0 +1 @@ +oasis account transfer 1.0 0xDce075E1C39b1ae0b75D554558b6451A226ffe00 --account orlando --subtract-fee diff --git a/examples/account/transfer-subtract-fee.y.out b/examples/account/transfer-subtract-fee.y.out new file mode 100644 index 00000000..1e0baf35 --- /dev/null +++ b/examples/account/transfer-subtract-fee.y.out @@ -0,0 +1,17 @@ +You are about to sign the following transaction: +Format: plain +Method: accounts.Transfer +Body: + To: test:dave (oasis1qrk58a6j2qn065m6p06jgjyt032f7qucy5wqeqpt) + Amount: 0.999769 TEST +Authorized signer(s): + 1. cb+NHKt7JT4fumy0wQdkiBwO3P+DUh8ylozMpsu1xH4= (ed25519) + Nonce: 0 +Fee: + Amount: 0.000231 TEST + Gas limit: 2310 + (gas price: 0.0000001 TEST per gas unit) + +Network: testnet +ParaTime: sapphire +Account: orlando diff --git a/examples/account/undelegate.y.out b/examples/account/undelegate.y.out index dac2cc32..b59d19ed 100644 --- a/examples/account/undelegate.y.out +++ b/examples/account/undelegate.y.out @@ -6,7 +6,7 @@ Body: Nonce: 2 Fee: Amount: 0.0 TEST - Gas limit: 1275 + Gas limit: 1283 (gas price: 0.0 TEST per gas unit) Network: testnet diff --git a/examples/transaction/sign.y.out b/examples/transaction/sign.y.out index 517a0913..38a554bb 100644 --- a/examples/transaction/sign.y.out +++ b/examples/transaction/sign.y.out @@ -3,7 +3,7 @@ Method: staking.Transfer Body: To: oasis1qrydpazemvuwtnp3efm7vmfvg3tde044qg6cxwzx Amount: 1.0 TEST -Nonce: 50 +Nonce: 32 Fee: Amount: 0.0 TEST Gas limit: 1265