diff options
author | obscuren <geffobscura@gmail.com> | 2014-07-15 04:52:44 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-07-15 04:52:44 +0800 |
commit | 98f21d8973398ccf58a762788a1972ef16213de5 (patch) | |
tree | f851ebbeeb531436304d98c9fed34ca67546f342 | |
parent | 767d24ea5da8794dbc3b8bed19f6c204e775e406 (diff) | |
download | dexon-98f21d8973398ccf58a762788a1972ef16213de5.tar.gz dexon-98f21d8973398ccf58a762788a1972ef16213de5.tar.zst dexon-98f21d8973398ccf58a762788a1972ef16213de5.zip |
Compare method for receipts
-rw-r--r-- | ethchain/transaction.go | 12 |
1 files changed, 12 insertions, 0 deletions
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 |