Skip to content

Commit 84e0683

Browse files
committed
receipts: Receipts.IsSuccess()
1 parent 51dd4ea commit 84e0683

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

receipts/receipts.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,17 @@ type Receipts struct {
3131
Receipts []Receipt
3232
}
3333

34+
func (r *Receipts) IsSuccess() bool {
35+
for _, receipt := range r.Receipts {
36+
switch receipt.Status {
37+
case StatusNotExecuted, StatusFailed, StatusAborted:
38+
return false
39+
}
40+
}
41+
42+
return true
43+
}
44+
3445
func (r *Receipts) Find(digest common.Hash) *Receipts {
3546
if digest == r.Digest {
3647
return r

0 commit comments

Comments
 (0)