Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

Remove hardcoded values in estimate_fee test #1526

Closed
Closed
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Next release

- dev: better estimate fee test
- test: Adding txv3 tests
- feat: L1 gas price/fix

Expand Down
8 changes: 1 addition & 7 deletions starknet-rpc-test/estimate_fee.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
extern crate starknet_rpc_test;
use anyhow::Error;
use assert_matches::assert_matches;
use rstest::rstest;
Expand Down Expand Up @@ -123,13 +124,6 @@ async fn works_ok(madara: &ThreadSafeMadaraClient) -> Result<(), anyhow::Error>
.await?;

assert_eq!(estimates.len(), 2);
assert_eq!(estimates[0].overall_fee, FieldElement::from(2060u128));
// less gas as the second transaction doesn't cause a storage change
assert_eq!(estimates[1].overall_fee, FieldElement::from(2060u128));
// It's 271 gas on sepolia as well (15 gas and 256 data gas). The difference in gas costs
// can be due to different accounts. Also, gas calculation tests are done in the blockifier
assert_eq!(estimates[0].gas_consumed, FieldElement::from_hex_be("0xce").unwrap());
assert_eq!(estimates[1].gas_consumed, FieldElement::from_hex_be("0xce").unwrap());

tx.is_query = false;
let invoke_transaction = BroadcastedInvokeTransaction::V1(tx.clone());
Expand Down
Loading