Skip to content

Commit

Permalink
Merge pull request #2591 from Taraxa-project/fix-slashing-gas
Browse files Browse the repository at this point in the history
chore: fix max gas for slashing transactions
  • Loading branch information
MatusKysel authored Oct 20, 2023
2 parents baeee05 + dda8c30 commit d0b213e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@ bool SlashingManager::submitDoubleVotingProof(const std::shared_ptr<Vote> &vote_

auto input = final_chain::ContractInterface::packFunctionCall("commitDoubleVotingProof(bytes,bytes)", vote_a->rlp(),
vote_b->rlp());

// TODO we need to calculate gas for this transaction and hardcode it
// CommitDoubleVotingProofGas uint64 = 20000
const auto trx = std::make_shared<Transaction>(account.nonce, 0, gas_pricer_->bid(), 1000000, std::move(input),
const auto trx = std::make_shared<Transaction>(account.nonce, 0, gas_pricer_->bid(), 100000, std::move(input),
kPrivateKey, kContractAddress, kConfig.genesis.chain_id);

if (trx_manager_->insertTransaction(trx).first) {
Expand Down
5 changes: 1 addition & 4 deletions tests/final_chain_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -807,10 +807,7 @@ std::shared_ptr<Transaction> makeDoubleVotingProofTx(const std::shared_ptr<Vote>

auto input = final_chain::ContractInterface::packFunctionCall("commitDoubleVotingProof(bytes,bytes)", vote_a->rlp(),
vote_b->rlp());

// TODO we need to calculate gas for this transaction and hardcode it
// CommitDoubleVotingProofGas uint64 = 20000
return std::make_shared<Transaction>(nonce, 0, 1, 1000000, std::move(input), keys.secret(), kSlashingContractAddress);
return std::make_shared<Transaction>(nonce, 0, 1, 100000, std::move(input), keys.secret(), kSlashingContractAddress);
}

TEST_F(FinalChainTest, remove_jailed_validator_votes_from_total) {
Expand Down

0 comments on commit d0b213e

Please sign in to comment.