stellar / js-stellar-base

The lowest-level stellar helper library. It consists of classes to read, write, hash, and sign Stellar xdr
https://stellar.github.io/js-stellar-base/
Apache License 2.0
106 stars 138 forks source link

[Discuss] Should we add the `resourceFee` in `sorobanData` to the `fee`? #761

Open overcat opened 1 month ago

overcat commented 1 month ago

Describe the bug Currently, when we call TransactionBuilder.builder, regardless of whether sorobanData exists or not, the way we calculate the fee is op_count * baseFee. However, the meaning of the fee is the maximum stroops willing to be paid for this transaction. So I wonder if we should add the resourceFee in sorobanData to the fee?

What version are you on?

c4f9989991ac9592b01b16fc4e6a84b2e4d18070

To Reproduce See https://github.com/stellar/js-stellar-base/blob/c4f9989991ac9592b01b16fc4e6a84b2e4d18070/src/transaction_builder.js#L579-L681

Expected behavior See above. Additional context N/A