Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix max gas for slashing transactions #2591

Merged
merged 1 commit into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading