Skip to content

Commit

Permalink
Correct Extension parameters
Browse files Browse the repository at this point in the history
Signed-off-by: Yogesh Deshpande <[email protected]>
  • Loading branch information
yogeshbdeshpande committed Sep 18, 2023
1 parent 57d7340 commit 8119b2b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions corim/entity_extension_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,14 @@ func TestEntities_Extensions_ToCBOR_ok(t *testing.T) {

func TestEntities_Extensions_FromCBOR_ok(t *testing.T) {
data := []byte{0xa4, 0x00, 0x69, 0x41, 0x43, 0x4d, 0x45, 0x20, 0x4c, 0x74, 0x64, 0x2e, 0x01, 0xd8, 0x20, 0x73, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x61, 0x63, 0x6d, 0x65, 0x2e, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x02, 0x81, 0x01, 0x03, 0xa2, 0x00, 0x6a, 0x6d, 0x79, 0x20, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x01, 0x18, 0x56}
e := &Entity{}
var extension EntityExtension
//var ext1 EntityExtension
e := &Entity{Extension: &EntityExtension{}}

err := e.FromCBOR(data)
require.NotNil(t, err)
require.Nil(t, err)
ext, err := e.GetExtension()
extension = ext.(EntityExtension)
require.Nil(t, err)
fmt.Printf("Entity Extension = %s, %x", extension.Param1, extension.Param2)

require.NotNil(t, ext)
}

func TestEntities_NoExtensions_ToCBOR_ok(t *testing.T) {
Expand Down

0 comments on commit 8119b2b

Please sign in to comment.