-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from ElrondNetwork/rc/2022-july
`rc/2022 july`
- Loading branch information
Showing
21 changed files
with
712 additions
and
472 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package core | ||
|
||
// OptionalUint32 holds an optional uint32 value | ||
type OptionalUint32 struct { | ||
Value uint32 | ||
HasValue bool | ||
} | ||
|
||
// OptionalUint64 holds an optional uint64 value | ||
type OptionalUint64 struct { | ||
Value uint64 | ||
HasValue bool | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package core | ||
|
||
import ( | ||
"bytes" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestNewPeerID(t *testing.T) { | ||
t.Parallel() | ||
t.Run("invalid string should error", func(t *testing.T) { | ||
t.Parallel() | ||
|
||
providedStr := "provided str" | ||
_, err := NewPeerID(providedStr) | ||
assert.NotNil(t, err) | ||
}) | ||
t.Run("should work", func(t *testing.T) { | ||
t.Parallel() | ||
|
||
providedStr := "provided str" | ||
providedPeerID := PeerID(providedStr) | ||
pid, err := NewPeerID(providedPeerID.Pretty()) | ||
assert.Nil(t, err) | ||
assert.True(t, bytes.Equal([]byte(providedPeerID), pid.Bytes())) | ||
}) | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.