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
feat: support new APIs from StarkNet v0.8.0
#90
Conversation
I just ran a simple test to see the issue with the |
Hmmm lemme try to make it into a test case ser. |
Went through the rest, all looks good. |
There you have it, the new test case Note that the target type is This is a very similar situation with the But it might not be related after all, since that issue was rather on format-specific stuff like |
I'm confused now. What's the point of the test if the call to I tried reproducing with this code (which is the same call as in the test case) and it worked either way: use starknet::{
core::types::{BlockId, FieldElement, InvokeFunctionTransactionRequest},
providers::{Provider, SequencerGatewayProvider},
};
#[tokio::main]
async fn main() {
let provider = SequencerGatewayProvider::starknet_alpha_goerli();
let tx = InvokeFunctionTransactionRequest {
contract_address: FieldElement::from_hex_be(
"0x07394cbe418daa16e42b87ba67372d4ab4a5df0b05c6e554d158458ce245bc10",
)
.unwrap(),
entry_point_selector: FieldElement::from_hex_be(
"0x02f0b3c5710379609eb5495f1ecd348cb28167711b73609fe565a72734550354",
)
.unwrap(),
calldata: vec![
FieldElement::from_dec_str(
"2536338608804621486891098924999890751656158566880912297504415061810375427475",
)
.unwrap(),
FieldElement::from_dec_str("1000000000000000000000").unwrap(),
FieldElement::ZERO,
],
signature: vec![],
};
let fee = provider.estimate_fee(tx, BlockId::Latest).await.unwrap();
dbg!(fee);
} |
The wrapping with For the second part, I tried running your code and yes it works with or without the attribute, which is quite weird, because you're still deserializing into Lemme look deeper into why this is working at all... |
So I made another test project that's really just the same as the failing test case: use starknet::{core::types::FeeEstimate, providers::GatewayResponse};
fn main() {
serde_json::from_str::<GatewayResponse<FeeEstimate>>(
"{\"amount\": 1630000000000, \"unit\": \"wei\"}",
)
.unwrap();
} and it works. Very strange. It looks like it's only failing within our library. |
Does it mean it only fails under |
OK I figured it out. Turns out it's a bug that's fixed in The standalone test project works because it's not locked to 1.0.74 like our project. |
Specifically, it's fixed here: |
OK lemme upgrade |
Well done on figuring it out 💪 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolves task 2 of #85:
This PR uses a special deserializer for the
amount
field inFeeEstimate
because for some unknown reasons it just won't work out of the box.