Skip to content
Snippets Groups Projects
Unverified Commit 249fa46a authored by Levente Pap's avatar Levente Pap
Browse files

Feed the dog

parent cd45152b
No related branches found
No related tags found
No related merge requests found
......@@ -37,8 +37,11 @@ const (
// WeakParent identifies a weak parent in the bitmask.
WeakParent uint8 = 0
MinParentsCount = 1
MaxParentsCount = 8
// MinParentsCount defines the minimum number of parents a message must have.
MinParentsCount = 1
// MaxParentsCount defines the maximum number of parents a message must have.
MaxParentsCount = 8
// MinStrongParentsCount defines the minimum number of strong parents a message must have.
MinStrongParentsCount = 1
)
......
......@@ -59,9 +59,9 @@ func testSortParents(parents []MessageID) {
func TestNewMessageID(t *testing.T) {
t.Run("CASE: Happy path", func(t *testing.T) {
randID := randomMessageID()
randIdString := randID.String()
randIDString := randID.String()
result, err := NewMessageID(randIdString)
result, err := NewMessageID(randIDString)
assert.NoError(t, err)
assert.Equal(t, randID, result)
})
......@@ -75,9 +75,9 @@ func TestNewMessageID(t *testing.T) {
t.Run("CASE: Too long string", func(t *testing.T) {
randID := randomMessageID()
randIdString := randID.String()
randIDString := randID.String()
result, err := NewMessageID(randIdString + "1")
result, err := NewMessageID(randIDString + "1")
assert.Error(t, err)
assert.True(t, strings.Contains(err.Error(), "length of base58 formatted message id is wrong"))
assert.Equal(t, EmptyMessageID, result)
......
......@@ -8,7 +8,6 @@ import (
"golang.org/x/xerrors"
)
// TODO: need to adjust the max size of the payload if we want to keep a message to 64 KB
// MaxSize defines the maximum allowed size of a marshaled Payload (in bytes).
// MaxPayloadSize = MaxMessageSize -
// (version(1) + parentsCount(1) + parentsType(1) + maxParents(8) * 32 + issuerPK(32) +
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment