-
Notifications
You must be signed in to change notification settings - Fork 296
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
dev: Better estimate fee test #1368
Comments
Hello, can I take this? |
@kenkomu you don't seem to be active. Comment again if you want to work on it again |
@tdelabro could I take it? Thanks |
I want to work on it again. |
@kenkomu What is your ETA? |
What do you mean by ETA? |
@kenkomu Estimated Time of Arrival: when do you think you will be finished? We gave you the issue two weeks ago and you haven't started it yet, so this time I would like you to commit to a schedule.
Lucas was referring tho this test: starknet-rpc-test/estimate_fee.rs #[rstest]
#[tokio::test]
async fn works_ok(madara: &ThreadSafeMadaraClient) -> Result<(), anyhow::Error> {
let rpc = madara.get_starknet_client().await;
let tx = BroadcastedInvokeTransaction {
max_fee: FieldElement::ZERO,
signature: vec![],
nonce: FieldElement::ZERO,
sender_address: FieldElement::from_hex_be(ACCOUNT_CONTRACT).unwrap(),
calldata: vec![
FieldElement::from_hex_be(TEST_CONTRACT_ADDRESS).unwrap(),
get_selector_from_name("sqrt").unwrap(),
FieldElement::from_hex_be("1").unwrap(),
FieldElement::from(81u8),
],
is_query: true,
};
let invoke_transaction = BroadcastedTransaction::Invoke(tx.clone());
let invoke_transaction_2 =
BroadcastedTransaction::Invoke(BroadcastedInvokeTransaction { nonce: FieldElement::ONE, ..tx });
let estimates =
rpc.estimate_fee(&vec![invoke_transaction, invoke_transaction_2], BlockId::Tag(BlockTag::Latest)).await?;
// TODO: instead execute the tx and check that the actual fee are the same as the estimated ones
assert_eq!(estimates.len(), 2);
assert_eq!(estimates[0].overall_fee, 420);
assert_eq!(estimates[1].overall_fee, 420);
// https://starkscan.co/block/5
assert_eq!(estimates[0].gas_consumed, 0);
assert_eq!(estimates[1].gas_consumed, 0);
Ok(())
} As you can see at the end we do Does it sound doable? |
Yes, it sounds doable. Can you give me a week to complete it? I will be reaching out to you frequently. |
There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale. |
@kenkomu are you still working on this? |
No, sorry for the late reply. |
Don't worry no problem |
@tdelabro could I take it? Thanks |
sure. Go ahead @fishseabowl |
There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale. |
Instead of comparing hardcoded values, execute the transaction and compare the actual fees with the estimated fees
The text was updated successfully, but these errors were encountered: