Skip to content

Commit

Permalink
Fixes from Scott's feedback
Browse files Browse the repository at this point in the history
- 2 uses of Unix() instead of UnixMilli() in iterator_test.go
- updated comment in sign.go to refer to milliseconds
  • Loading branch information
ezavada committed Oct 29, 2024
1 parent 7020f1e commit 268c9ce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cardinal/router/iterator/iterator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func TestIteratorHappyPath(t *testing.T) {
assert.Equal(t, tx.MsgValue, msgValue)
assert.Equal(t, tx.MsgID, fooMsg.ID())
assert.Equal(t, tx.Tx.PersonaTag, protoTx.GetPersonaTag())
assert.Equal(t, tx.Tx.Timestamp, time.Date(2023, 1, 1, 0, 0, 0, 0, time.UTC).Unix())
assert.Equal(t, tx.Tx.Timestamp, time.Date(2023, 1, 1, 0, 0, 0, 0, time.UTC).UnixMilli())
assert.True(t, len(tx.Tx.Hash.Bytes()) > 1)
assert.Equal(t, tx.Tx.Namespace, namespace)
assert.DeepEqual(t, []byte(tx.Tx.Body), msgBytes)
Expand Down Expand Up @@ -180,7 +180,7 @@ func TestIteratorStopRange(t *testing.T) {
protoTx := &shard.Transaction{
PersonaTag: "ty",
Namespace: namespace,
Timestamp: time.Date(2023, 1, 1, 0, 0, 0, 0, time.UTC).Unix(),
Timestamp: time.Date(2023, 1, 1, 0, 0, 0, 0, time.UTC).UnixMilli(),
Signature: "fo",
Body: msgBytes,
}
Expand Down
2 changes: 1 addition & 1 deletion sign/sign.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var (
type Transaction struct {
PersonaTag string `json:"personaTag"`
Namespace string `json:"namespace"`
Timestamp int64 `json:"timestamp"` // unix microsecond timestamp
Timestamp int64 `json:"timestamp"` // unix millisecond timestamp
Salt uint16 `json:"salt,omitempty"` // an optional field for additional hash uniqueness
Signature string `json:"signature"` // hex encoded string
Hash common.Hash `json:"-"` // don't marshal or unmarshal for json
Expand Down

0 comments on commit 268c9ce

Please sign in to comment.