Skip to content

Commit da05af1

Browse files
committed
[TxFeePayment] fee payment by first authorizer : if transaction fee payer is not specified on transaction message, first authorizer of a transaction is implicitly set as transaction fee payer account
1 parent d900cee commit da05af1

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

infrablockchain-bios/local_testnet_boot_bios_infrablockchain.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ $INFRA_CLI push action ${SYS_ACCOUNT} settxfee "{\"code\":\"${SYS_ACCOUNT}\",\"a
265265
$INFRA_CLI get txfee list -L "${SYS_ACCOUNT}" -U "${SYS_ACCOUNT}"
266266
$INFRA_CLI push action ${SYS_ACCOUNT} unsettxfee "{\"code\":\"${SYS_ACCOUNT}\",\"action\":\"linkauth\"}" -p ${SYS_ACCOUNT}@active --txfee-payer ${SYS_ACCOUNT}
267267
$INFRA_CLI get txfee list -L "${SYS_ACCOUNT}" -U "${SYS_ACCOUNT}"
268-
$INFRA_CLI push action ${SYS_ACCOUNT} settxfee "{\"code\":\"${SYS_ACCOUNT}\",\"action\":\"linkauth\",\"value\":1000,\"feetype\":1}" -p ${SYS_ACCOUNT}@active --txfee-payer ${SYS_ACCOUNT}
268+
$INFRA_CLI push action ${SYS_ACCOUNT} settxfee "{\"code\":\"${SYS_ACCOUNT}\",\"action\":\"linkauth\",\"value\":1500,\"feetype\":1}" -p ${SYS_ACCOUNT}@active --txfee-payer ${SYS_ACCOUNT}
269269

270270
sleep 1
271271

@@ -512,6 +512,9 @@ $INFRA_CLI get token balance systoken.a useraccountc
512512

513513
$INFRA_CLI push action systoken.a transfer '{"t":"systoken.a","from":"useraccounta","to":"useraccountb","qty":"999.5000 DUSD","tag":"transfer tag"}' -p useraccounta@active --txfee-payer useraccounta -v producer.a
514514

515+
# first authorizer as tx fee payer
516+
$INFRA_CLI push action systoken.a transfer '{"t":"systoken.a","from":"useraccounta","to":"useraccountb","qty":"0.1000 DUSD","tag":"transfer tag"}' -p useraccounta@active -v producer.a
517+
515518
$INFRA_CLI get systoken balance useraccounta
516519
$INFRA_CLI get systoken balance useraccountb
517520
$INFRA_CLI get systoken balance useraccountc

libraries/chain/transaction_context.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,13 +209,11 @@ namespace eosio { namespace chain {
209209
const auto& tx_fee_payer_info = std::get<transaction_fee_payer_tx_ext>(itr->second);
210210
tx_fee_payer = tx_fee_payer_info.fee_payer;
211211
}
212-
//if (!tx_fee_payer) {
213-
// // if tx-fee-payer is not specified on transaction message, then 'bill-first-authorizer' policy is used
214-
// tx_fee_payer = trx.first_authorizer();
215-
//}
216-
if (tx_fee_payer) {
217-
bill_to_accounts.insert(*tx_fee_payer);
212+
if (!tx_fee_payer) {
213+
// if tx-fee-payer is not specified on transaction message, then 'bill-first-authorizer' policy is used
214+
tx_fee_payer = trx.first_authorizer();
218215
}
216+
bill_to_accounts.insert(*tx_fee_payer);
219217

220218
////////////////////////////////////////////////////////////////
221219
/// InfraBlockchain Transaction-Extension support for Transaction-as-a-vote and Proof-of-Transaction

0 commit comments

Comments
 (0)