Skip to content

Commit

Permalink
Clear query bit in deploy account transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
joshklop committed Sep 12, 2023
1 parent 7372436 commit e2bc506
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions vm/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,22 @@ func marshalTxn(txn core.Transaction) (json.RawMessage, error) {
return nil, err
}

t.Version = clearQueryBit(t.Version)
switch txn.(type) {
case *core.InvokeTransaction:
versionFelt := clearQueryBit(t.Version)
// workaround until starknet_api::transaction::InvokeTranscationV0 is fixed
if versionFelt.IsZero() {
if t.Version.IsZero() {
t.Nonce = &felt.Zero
t.SenderAddress = t.ContractAddress
}
txnMap["Invoke"] = map[string]any{
"V" + clearQueryBit(t.Version).Text(felt.Base10): t,
"V" + t.Version.Text(felt.Base10): t,
}
case *core.DeployAccountTransaction:
txnMap["DeployAccount"] = t
case *core.DeclareTransaction:
txnMap["Declare"] = map[string]any{
"V" + clearQueryBit(t.Version).Text(felt.Base10): t,
"V" + t.Version.Text(felt.Base10): t,
}
case *core.L1HandlerTransaction:
txnMap["L1Handler"] = t
Expand Down

0 comments on commit e2bc506

Please sign in to comment.