github.com/koko1123/flow-go-1@v0.29.6/model/flow/transaction_result.go (about)

     1  // (c) 2019 Dapper Labs - ALL RIGHTS RESERVED
     2  package flow
     3  
     4  import (
     5  	"fmt"
     6  )
     7  
     8  // TransactionResult contains the artifacts generated after executing a Cadence transaction.
     9  type TransactionResult struct {
    10  	// TransactionID is the ID of the transaction this error was emitted from.
    11  	TransactionID Identifier
    12  	// ErrorMessage contains the error message of any error that may have occurred when the transaction was executed
    13  	ErrorMessage string
    14  	// Computation used
    15  	ComputationUsed uint64
    16  	// Memory used (estimation)
    17  	MemoryUsed uint64
    18  }
    19  
    20  // String returns the string representation of this error.
    21  func (t TransactionResult) String() string {
    22  	return fmt.Sprintf("Transaction ID: %s, Error Message: %s", t.TransactionID.String(), t.ErrorMessage)
    23  }
    24  
    25  // ID returns a canonical identifier that is guaranteed to be unique.
    26  func (t TransactionResult) ID() Identifier {
    27  	return t.TransactionID
    28  }
    29  
    30  func (te *TransactionResult) Checksum() Identifier {
    31  	return te.ID()
    32  }