Skip to content

Commit f356d55

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 [cherry-picked da05af1]
1 parent aa2cf6d commit f356d55

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
@@ -215,13 +215,11 @@ namespace eosio { namespace chain {
215215
const auto& tx_fee_payer_info = itr->second.get<transaction_fee_payer_tx_ext>();
216216
tx_fee_payer = tx_fee_payer_info.fee_payer;
217217
}
218-
//if (!tx_fee_payer) {
219-
// // if tx-fee-payer is not specified on transaction message, then 'bill-first-authorizer' policy is used
220-
// tx_fee_payer = trx.first_authorizer();
221-
//}
222-
if (tx_fee_payer) {
223-
bill_to_accounts.insert(*tx_fee_payer);
218+
if (!tx_fee_payer) {
219+
// if tx-fee-payer is not specified on transaction message, then 'bill-first-authorizer' policy is used
220+
tx_fee_payer = trx.first_authorizer();
224221
}
222+
bill_to_accounts.insert(*tx_fee_payer);
225223

226224
////////////////////////////////////////////////////////////////
227225
/// InfraBlockchain Transaction-Extension support for Transaction-as-a-vote and Proof-of-Transaction

0 commit comments

Comments
 (0)