156: ctx = ctx.WithPriority(GetTxPriority(priorityFee, int64(gas), baseGasPrice))
148: func (dfd FeeMarketDeductDecorator) BurnFeeAndRefund(ctx sdk.Context, fee, tip sdk.Coin, feePayer sdk.AccAddress, defaultFeeDenom string) error {
...   // [...]
163:
164: 	// refund the tip if it is not nil and non zero
165: 	if !tip.IsNil() && !tip.IsZero() {
166: 		err := RefundTip(dfd.bankKeeper, ctx, feePayer, sdk.NewCoins(tip))
167: 		if err != nil {
168: 			return err
169: 		}
diff --git a/Makefile b/Makefile
index 0ad0cdc..80d3c5a 100644
--- a/Makefile
+++ b/Makefile
@@ -220,12 +220,13 @@ mocks:
 build-and-run-single-node: build
 	@echo "Building and running a single node for testing..."
 	@mkdir -p .mantrasinglenodetest
-	@if [ ! -f .mantrasinglenodetest/config.toml ]; then \
+	@if [ ! -f .mantrasinglenodetest/config/config.toml ]; then \
 		./build/mantrachaind init single-node-test --chain-id test-chain --home .mantrasinglenodetest; \
 		./build/mantrachaind keys add validator --keyring-backend test --home .mantrasinglenodetest; \
-		./build/mantrachaind genesis add-genesis-account $$(./build/mantrachaind keys show validator -a --keyring-backend test --home .mantrasinglenodetest) 100000000stake --home .mantrasinglenodetest; \
+		./build/mantrachaind genesis add-genesis-account $$(./build/mantrachaind keys show validator -a --keyring-backend test --home .mantrasinglenodetest) 100000000000000stake --home .mantrasinglenodetest; \
 		./build/mantrachaind genesis gentx validator 100000000stake --chain-id test-chain --keyring-backend test --home .mantrasinglenodetest; \
 		./build/mantrachaind genesis collect-gentxs --home .mantrasinglenodetest; \
+		sed -i'' -e 's/"max_gas": "-1"/"max_gas": "75000000"/' .mantrasinglenodetest/config/genesis.json; \
 	fi
 	./build/mantrachaind start --home .mantrasinglenodetest --minimum-gas-prices 0stake
make build-and-run-single-node
#!/bin/bash

MAX_BLOCK_GAS=75000000

ACCOUNT_ADDRESS=$(./build/mantrachaind keys show validator -a --keyring-backend test --home .mantrasinglenodetest)

# Query account to get current sequence number
ACCOUNT_INFO=$(./build/mantrachaind query auth account $ACCOUNT_ADDRESS --home .mantrasinglenodetest -o json)

# Extract sequence number using jq, navigating through the nested structure
# Note: Install jq if not already installed: sudo apt-get install jq
SEQUENCE=$(echo $ACCOUNT_INFO | jq -r '.account.value.sequence')

# Increment for second transaction
NEXT_SEQUENCE=$((SEQUENCE + 1))

echo "Current sequence: $SEQUENCE"
echo "Next sequence: $NEXT_SEQUENCE"

# Generate first unsigned tx
./build/mantrachaind tx bank send \
    $ACCOUNT_ADDRESS \
    mantra1y6xz2ggfc0pcsmyjlekh0j9pxh6hk87yz9jkm3 \
    222stake \
    --from validator \
    --keyring-backend test \
    --chain-id test-chain \
    --home .mantrasinglenodetest \
    --gas $MAX_BLOCK_GAS \
    --gas-adjustment 1.5 \
    --gas-prices 1.5stake \
    --generate-only > unsigned_tx1.json

# Generate second unsigned tx
./build/mantrachaind tx bank send \
    $ACCOUNT_ADDRESS \
    mantra1y6xz2ggfc0pcsmyjlekh0j9pxh6hk87yz9jkm3 \
    333stake \
    --from validator \
    --keyring-backend test \
    --chain-id test-chain \
    --home .mantrasinglenodetest \
    --gas 1000000 \
    --gas-adjustment 1.5 \
    --gas-prices 1.5stake \
    --generate-only > unsigned_tx2.json

# Sign first tx (use current sequence number)
./build/mantrachaind tx sign \
    unsigned_tx1.json \
    --from validator \
    --keyring-backend test \
    --chain-id test-chain \
    --home .mantrasinglenodetest \
    --sequence "$SEQUENCE" \
    --account-number 0 \
    --offline > signed_tx1.json

# Sign second tx (use current sequence + 1)
./build/mantrachaind tx sign \
    unsigned_tx2.json \
    --from validator \
    --keyring-backend test \
    --chain-id test-chain \
    --home .mantrasinglenodetest \
    --sequence "$NEXT_SEQUENCE" \
    --account-number 0 \
    --offline > signed_tx2.json

# Broadcast both txs quickly and capture their hashes
TX1_HASH=$(./build/mantrachaind tx broadcast signed_tx1.json --home .mantrasinglenodetest -o json | jq -r '.txhash')
TX2_HASH=$(./build/mantrachaind tx broadcast signed_tx2.json --home .mantrasinglenodetest -o json | jq -r '.txhash')

echo "Waiting for transactions to be included in blocks..."
sleep 6  # Give some time for transactions to be processed

# Query and display details for first transaction
echo "Transaction 1 ($TX1_HASH) details:"
TX1_DETAILS=$(./build/mantrachaind query tx $TX1_HASH --home .mantrasinglenodetest -o json)
echo "Gas used:    $(echo $TX1_DETAILS | jq -r '.gas_used')"
echo "Gas wanted:  $(echo $TX1_DETAILS | jq -r '.gas_wanted')"
echo "Height:      $(echo $TX1_DETAILS | jq -r '.height')"
echo "Fee refunded:  $(echo $TX1_DETAILS | jq -r '.events[] | select(.type=="tip_refund") | .attributes[0].value')"

echo -e "\nTransaction 2 ($TX2_HASH) details:"
TX2_DETAILS=$(./build/mantrachaind query tx $TX2_HASH --home .mantrasinglenodetest -o json)
echo "Gas used:    $(echo $TX2_DETAILS | jq -r '.gas_used')"
echo "Gas wanted:  $(echo $TX2_DETAILS | jq -r '.gas_wanted')"
echo "Height:      $(echo $TX2_DETAILS | jq -r '.height')"
echo "Fee refunded:  $(echo $TX2_DETAILS | jq -r '.events[] | select(.type=="tip_refund") | .attributes[0].value')"

# Calculate height difference
HEIGHT1=$(echo $TX1_DETAILS | jq -r '.height')
HEIGHT2=$(echo $TX2_DETAILS | jq -r '.height')
HEIGHT_DIFF=$((HEIGHT2 - HEIGHT1))
echo -e "\nHeight difference between transactions: $HEIGHT_DIFF blocks"
Current sequence: 3
Next sequence: 4
Waiting for transactions to be included in blocks...
Transaction 1 (654A5B452A32349CDBFC7949319484490BC082A3A2F63C7E1FF29F7789218033) details:
Gas used:    120980
Gas wanted:  75000000
Height:      187
Fee refunded:  112410901stake

Transaction 2 (D2416E3DCD64871D1ED68C4AF6272E2E3A4E96153727C54C605728927F482F72) details:
Gas used:    120848
Gas wanted:  1000000
Height:      188
Fee refunded:  1410961stake

Height difference between transactions: 1 blocks
