pathfinder
pathfinder copied to clipboard
Disallow decimal strings for starknet_addInvokeTransaction
Remove the: #[serde_as(as = "Vec<CallSignatureElemAsDecimalStr>")]
:
module.register_async_method(
"starknet_addInvokeTransaction",
|params, context| async move {
#[serde_with::serde_as]
#[derive(Debug, Deserialize)]
struct NamedArgs {
function_invocation: ContractCall,
#[serde_as(as = "Vec<CallSignatureElemAsDecimalStr>")]
signature: Vec<CallSignatureElem>,
#[serde_as(as = "FeeAsHexStr")]
max_fee: Fee,
#[serde_as(as = "TransactionVersionAsHexStr")]
version: TransactionVersion,
}
let params = params.parse::<NamedArgs>()?;
context
.add_invoke_transaction(
params.function_invocation,
params.signature,
params.max_fee,
params.version,
)
.await
},
)?;
The hex representation is correctly deserialized only because of the fallback to hex in starkhash_from_dec_str
.