From ab14b37cc49db7b86d817a591b0d788ec6614cb8 Mon Sep 17 00:00:00 2001 From: Aryan Godara Date: Wed, 15 May 2024 22:13:47 +0530 Subject: [PATCH] update doc comments for getters --- rpc/types_block_transaction.go | 70 -------------------------------- rpc/types_transaction_receipt.go | 63 ++-------------------------- 2 files changed, 3 insertions(+), 130 deletions(-) diff --git a/rpc/types_block_transaction.go b/rpc/types_block_transaction.go index 0b0b6d61..7eb7cd24 100644 --- a/rpc/types_block_transaction.go +++ b/rpc/types_block_transaction.go @@ -26,121 +26,51 @@ var _ BlockTransaction = BlockDeployAccountTxn{} var _ BlockTransaction = BlockL1HandlerTxn{} // Hash returns the transaction hash of the BlockInvokeTxnV0. -// -// Parameters: -// -// none -// -// Returns: -// - *felt.Felt: the transaction hash func (tx BlockInvokeTxnV0) Hash() *felt.Felt { return tx.TransactionHash } // Hash returns the hash of the BlockInvokeTxnV1 transaction. -// -// Parameters: -// -// none -// -// Returns: -// - *felt.Felt: the transaction hash func (tx BlockInvokeTxnV1) Hash() *felt.Felt { return tx.TransactionHash } // Hash returns the hash of the BlockInvokeTxnV3 transaction. -// -// Parameters: -// -// none -// -// Returns: -// - *felt.Felt: the transaction hash func (tx BlockInvokeTxnV3) Hash() *felt.Felt { return tx.TransactionHash } // Hash returns the transaction hash of the BlockDeclareTxnV0. -// -// Parameters: -// -// none -// -// Returns: -// - *felt.Felt: the transaction hash func (tx BlockDeclareTxnV0) Hash() *felt.Felt { return tx.TransactionHash } // Hash returns the transaction hash of the BlockDeclareTxnV1. -// -// Parameters: -// -// none -// -// Returns: -// - *felt.Felt: the transaction hash func (tx BlockDeclareTxnV1) Hash() *felt.Felt { return tx.TransactionHash } // Hash returns the transaction hash of the BlockDeclareTxnV2. -// -// Parameters: -// -// none -// -// Returns: -// - *felt.Felt: the transaction hash func (tx BlockDeclareTxnV2) Hash() *felt.Felt { return tx.TransactionHash } // Hash returns the transaction hash of the BlockDeclareTxnV3. -// -// Parameters: -// -// none -// -// Returns: -// - *felt.Felt: the transaction hash func (tx BlockDeclareTxnV3) Hash() *felt.Felt { return tx.TransactionHash } // Hash returns the hash of the BlockDeployTxn. -// -// Parameters: -// -// none -// -// Returns: -// - *felt.Felt: the transaction hash func (tx BlockDeployTxn) Hash() *felt.Felt { return tx.TransactionHash } // Hash returns the Felt hash of the BlockDeployAccountTxn. -// -// Parameters: -// -// none -// -// Returns: -// - *felt.Felt: the transaction hash func (tx BlockDeployAccountTxn) Hash() *felt.Felt { return tx.TransactionHash } // Hash returns the hash of the BlockL1HandlerTxn. -// -// Parameters: -// -// none -// -// Returns: -// - *felt.Felt: the transaction hash func (tx BlockL1HandlerTxn) Hash() *felt.Felt { return tx.TransactionHash } diff --git a/rpc/types_transaction_receipt.go b/rpc/types_transaction_receipt.go index d4dcd336..d65fa54c 100644 --- a/rpc/types_transaction_receipt.go +++ b/rpc/types_transaction_receipt.go @@ -37,6 +37,7 @@ type CommonTransactionReceipt struct { ExecutionResources ExecutionResources `json:"execution_resources"` } +// Hash returns the transaction hash associated with the CommonTransactionReceipt. func (tr CommonTransactionReceipt) Hash() *felt.Felt { return tr.TransactionHash } @@ -100,10 +101,6 @@ func (tt *TransactionType) UnmarshalJSON(data []byte) error { // MarshalJSON marshals the TransactionType to JSON. // -// Parameters: -// -// none -// // Returns: // - []byte: a byte slice // - error: an error if any @@ -114,10 +111,12 @@ func (tt TransactionType) MarshalJSON() ([]byte, error) { // InvokeTransactionReceipt Invoke Transaction Receipt type InvokeTransactionReceipt CommonTransactionReceipt +// Hash returns the hash of the invoke transaction receipt. func (tr InvokeTransactionReceipt) Hash() *felt.Felt { return tr.TransactionHash } +// GetExecutionStatus returns the execution status of the InvokeTransactionReceipt. func (tr InvokeTransactionReceipt) GetExecutionStatus() TxnExecutionStatus { return tr.ExecutionStatus } @@ -126,25 +125,11 @@ func (tr InvokeTransactionReceipt) GetExecutionStatus() TxnExecutionStatus { type DeclareTransactionReceipt CommonTransactionReceipt // Hash returns the transaction hash. -// -// Parameters: -// -// none -// -// Returns: -// - *felt.Felt: the transaction hash func (tr DeclareTransactionReceipt) Hash() *felt.Felt { return tr.TransactionHash } // GetExecutionStatus returns the execution status of the DeclareTransactionReceipt function. -// -// Parameters: -// -// none -// -// Returns: -// - TxnExecutionStatus: the execution status func (tr DeclareTransactionReceipt) GetExecutionStatus() TxnExecutionStatus { return tr.ExecutionStatus } @@ -157,25 +142,11 @@ type DeployTransactionReceipt struct { } // Hash returns the transaction hash of the DeployTransactionReceipt. -// -// Parameters: -// -// none -// -// Returns: -// - *felt.Felt: the transaction hash func (tr DeployTransactionReceipt) Hash() *felt.Felt { return tr.TransactionHash } // GetExecutionStatus returns the execution status of the DeployTransactionReceipt. -// -// Parameters: -// -// none -// -// Returns: -// - TxnExecutionStatus: the execution status func (tr DeployTransactionReceipt) GetExecutionStatus() TxnExecutionStatus { return tr.ExecutionStatus } @@ -188,25 +159,11 @@ type DeployAccountTransactionReceipt struct { } // Hash returns the transaction hash for the given DeployAccountTransactionReceipt. -// -// Parameters: -// -// none -// -// Returns: -// - *felt.Felt: the transaction hash func (tr DeployAccountTransactionReceipt) Hash() *felt.Felt { return tr.TransactionHash } // GetExecutionStatus returns the execution status of the DeployAccountTransactionReceipt. -// -// Parameters: -// -// none -// -// Returns: -// - *TxnExecutionStatus: the execution status func (tr DeployAccountTransactionReceipt) GetExecutionStatus() TxnExecutionStatus { return tr.ExecutionStatus } @@ -215,25 +172,11 @@ func (tr DeployAccountTransactionReceipt) GetExecutionStatus() TxnExecutionStatu type L1HandlerTransactionReceipt CommonTransactionReceipt // Hash returns the transaction hash. -// -// Parameters: -// -// none -// -// Returns: -// - *felt.Felt: the transaction hash func (tr L1HandlerTransactionReceipt) Hash() *felt.Felt { return tr.TransactionHash } // GetExecutionStatus returns the execution status of the L1HandlerTransactionReceipt. -// -// Parameters: -// -// none -// -// Returns: -// - TxnExecutionStatus: the execution status func (tr L1HandlerTransactionReceipt) GetExecutionStatus() TxnExecutionStatus { return tr.ExecutionStatus }