Skip to content

Commit

Permalink
update doc comments for getters
Browse files Browse the repository at this point in the history
  • Loading branch information
AryanGodara committed May 15, 2024
1 parent 06fb7cb commit ab14b37
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 130 deletions.
70 changes: 0 additions & 70 deletions rpc/types_block_transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
63 changes: 3 additions & 60 deletions rpc/types_transaction_receipt.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
Expand All @@ -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
}
Expand All @@ -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
}
Expand All @@ -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
}
Expand All @@ -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
}
Expand All @@ -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
}
Expand Down

0 comments on commit ab14b37

Please sign in to comment.