aboutsummaryrefslogtreecommitdiffstats
path: root/core/types/position.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/types/position.go')
-rw-r--r--core/types/position.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/core/types/position.go b/core/types/position.go
index 4e254ba..51de405 100644
--- a/core/types/position.go
+++ b/core/types/position.go
@@ -17,7 +17,10 @@
package types
-import "errors"
+import (
+ "errors"
+ "fmt"
+)
// ErrComparePositionOnDifferentChains raised when attempting to
// compare two positions with different chain ID.
@@ -31,6 +34,10 @@ type Position struct {
Height uint64 `json:"height"`
}
+func (pos *Position) String() string {
+ return fmt.Sprintf("pos[%d:%d:%d]", pos.ChainID, pos.Round, pos.Height)
+}
+
// Equal checks if two positions are equal, it panics when their chainIDs
// are different.
func (pos *Position) Equal(other *Position) bool {