From 98f21d8973398ccf58a762788a1972ef16213de5 Mon Sep 17 00:00:00 2001 From: obscuren Date: Mon, 14 Jul 2014 22:52:44 +0200 Subject: [PATCH] Compare method for receipts --- ethchain/transaction.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ethchain/transaction.go b/ethchain/transaction.go index da3f9bcf2..0b4f8d1a4 100644 --- a/ethchain/transaction.go +++ b/ethchain/transaction.go @@ -227,6 +227,18 @@ func (self *Receipt) String() string { self.CumulativeGasUsed) } +func (self *Receipt) Cmp(other *Receipt) bool { + if bytes.Compare(self.PostState, other.PostState) != 0 { + return false + } + + if self.CumulativeGasUsed.Cmp(other.CumulativeGasUsed) != 0 { + return false + } + + return true +} + // Transaction slice type for basic sorting type Transactions []*Transaction