-
Notifications
You must be signed in to change notification settings - Fork 109
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
How to send a Cairo 1.0 class transactions #511
Comments
Is your account version V1 or V2? It should work if you set the account version to 2, but if your account is actually V1 let me know. For example, the following transaction was generated successfully by starknet.go, and uses a V2 account. |
I understand, but as soon as my wallet is upgraded to cairo1 the code below fails to execute, if I keep my account unupgraded the cario version is 0 and the code succeeds. Is there something wrong with my code? // maxfee, err := utils.HexToFelt("0x9184e72a000")
invokeTx := rpc.InvokeTxnV1{
// MaxFee: maxfee,
MaxFee: new(felt.Felt).SetUint64(0),
Version: rpc.TransactionV1,
Nonce: nonce,
Type: rpc.TransactionType_Invoke,
SenderAddress: s.account.AccountAddress,
}
// Build the Calldata
if invokeTx.Calldata, err = s.account.FmtCalldata(fnCalls); err != nil {
panic(err.Error())
}
// Sign the transaction
if err = s.account.SignInvokeTransaction(ctx, &invokeTx); err != nil {
panic(err.Error())
}
// account_cairo_version = 2
// 1.my account Class Version is actually Cairo 2 ; output err: Invalid params
// 2.my account Class Version is actually Cairo 0 ; success
fees, err := s.account.EstimateFee(ctx, []rpc.BroadcastTxn{invokeTx}, []rpc.SimulationFlag{}, latestBlock)
if err != nil {
panic(err.Error()) //output err: Invalid params (when Class Version = Cairo 2)
} |
With tag v0.5.0 it is possible to send Cairo 0 class transactions successfully, as soon as the account is upgraded to Cairo 1, the transaction fails!
The text was updated successfully, but these errors were encountered: