Skip to content

Commit

Permalink
feat: implement get timestamp for tendermint
Browse files Browse the repository at this point in the history
  • Loading branch information
izyak committed Jan 17, 2024
1 parent c34fcc5 commit 0356f8a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions libraries/go/common/tendermint/consensus_state_extended.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
package tendermint

import "time"

func (m *ConsensusState) ValidateBasic() error { return nil }
func (m *ConsensusState) ClientType() string { return "icon" }
func (m *ConsensusState) GetTimestamp() uint64 { return 0 }
func (m *ConsensusState) ClientType() string { return "icAon" }

// this returns the timestamp in nanoseconds
func (m *ConsensusState) GetTimestamp() uint64 {
secondsToNano := time.Second * time.Duration(m.Timestamp.Seconds) // convert seconds to nanoseconds
return uint64(secondsToNano + time.Duration(m.Timestamp.Nanos))
}

0 comments on commit 0356f8a

Please sign in to comment.