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