-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rpcv05 implement broadcast txn types (#437)
* rpcv05 implement broadcast txn types * fix properties of broadcasted declare transactions --------- Co-authored-by: Carmen Cabrera <[email protected]> Co-authored-by: Carmen Irene Cabrera Rodríguez <[email protected]>
- Loading branch information
1 parent
d623521
commit 3dc638d
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package rpc | ||
|
||
import "github.com/NethermindEth/juno/core/felt" | ||
|
||
type BroadcastTxn interface{} | ||
|
||
var ( | ||
_ BroadcastTxn = BroadcastInvokev0Txn{} | ||
_ BroadcastTxn = BroadcastInvokev1Txn{} | ||
_ BroadcastTxn = BroadcastDeclareV1Txn{} | ||
_ BroadcastTxn = BroadcastDeclareV2Txn{} | ||
_ BroadcastTxn = BroadcastDeployAccountTxn{} | ||
) | ||
|
||
type BroadcastInvokev0Txn struct { | ||
InvokeTxnV0 | ||
} | ||
|
||
type BroadcastInvokev1Txn struct { | ||
InvokeTxnV1 | ||
} | ||
|
||
type BroadcastDeclareV1Txn struct { | ||
Type TransactionType `json:"type"` | ||
// SenderAddress the address of the account contract sending the declaration transaction | ||
SenderAddress *felt.Felt `json:"sender_address"` | ||
MaxFee *felt.Felt `json:"max_fee"` | ||
Version NumAsHex `json:"version"` | ||
Signature []*felt.Felt `json:"signature"` | ||
Nonce *felt.Felt `json:"nonce"` | ||
ContractClass DeprecatedContractClass `json:"contract_class"` | ||
} | ||
type BroadcastDeclareV2Txn struct { | ||
Type TransactionType `json:"type"` | ||
// SenderAddress the address of the account contract sending the declaration transaction | ||
SenderAddress *felt.Felt `json:"sender_address"` | ||
CompiledClassHash *felt.Felt `json:"compiled_class_hash"` | ||
MaxFee *felt.Felt `json:"max_fee"` | ||
Version NumAsHex `json:"version"` | ||
Signature []*felt.Felt `json:"signature"` | ||
Nonce *felt.Felt `json:"nonce"` | ||
ContractClass ContractClass `json:"contract_class"` | ||
} | ||
|
||
type BroadcastDeployAccountTxn struct { | ||
DeployAccountTxn | ||
} |