diff --git a/token/delegation/delegation_test.go b/token/delegation/delegation_test.go index 22831d7..7ce3497 100644 --- a/token/delegation/delegation_test.go +++ b/token/delegation/delegation_test.go @@ -56,9 +56,6 @@ const ( ] ` - newCID = "zdpuAnaCA4uaSJyuthxdu6sRkgTeUt1fbGqzb1CsRxiBygjty" - rootCID = "zdpuAkgGmUp5JrXvehGuuw9JA8DLQKDaxtK3R8brDQQVC2i5X" - aesKey = "xQklMmNTnVrmaPBq/0pwV5fEwuv/iClF5HWak9MsgI8=" ) diff --git a/token/delegation/schema_test.go b/token/delegation/schema_test.go index d88c0a1..f0f22dd 100644 --- a/token/delegation/schema_test.go +++ b/token/delegation/schema_test.go @@ -33,9 +33,12 @@ func TestSchemaRoundTrip(t *testing.T) { p1, err := delegation.FromDagJson(delegationJson) require.NoError(t, err) + _, newCID, err := p1.ToSealed(privKey) + require.NoError(t, err) + cborBytes, id, err := p1.ToSealed(privKey) require.NoError(t, err) - assert.Equal(t, newCID, envelope.CIDToBase58BTC(id)) + assert.Equal(t, envelope.CIDToBase58BTC(newCID), envelope.CIDToBase58BTC(id)) p2, c2, err := delegation.FromSealed(cborBytes) require.NoError(t, err) @@ -58,10 +61,13 @@ func TestSchemaRoundTrip(t *testing.T) { p1, err := delegation.FromDagJsonReader(buf) require.NoError(t, err) + _, newCID, err := p1.ToSealed(privKey) + require.NoError(t, err) + cborBytes := &bytes.Buffer{} id, err := p1.ToSealedWriter(cborBytes, privKey) require.NoError(t, err) - assert.Equal(t, newCID, envelope.CIDToBase58BTC(id)) + assert.Equal(t, envelope.CIDToBase58BTC(newCID), envelope.CIDToBase58BTC(id)) // buf = bytes.NewBuffer(cborBytes.Bytes()) p2, c2, err := delegation.FromSealedReader(cborBytes)