From 8119b2bfa555137ae64e7c2acba310e91ce602fc Mon Sep 17 00:00:00 2001 From: Yogesh Deshpande Date: Mon, 18 Sep 2023 09:54:49 -0400 Subject: [PATCH] Correct Extension parameters Signed-off-by: Yogesh Deshpande --- corim/entity_extension_test.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/corim/entity_extension_test.go b/corim/entity_extension_test.go index e17c6872..6fefc1e9 100644 --- a/corim/entity_extension_test.go +++ b/corim/entity_extension_test.go @@ -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) {