Skip to content

Commit

Permalink
feat: update ioconnect-go library and fix did doc release
Browse files Browse the repository at this point in the history
  • Loading branch information
saitofun committed May 14, 2024
1 parent fac50f2 commit ced25a9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 41 deletions.
40 changes: 1 addition & 39 deletions pkg/ioconnect/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,45 +79,7 @@ func (doc *DIDDoc) ParseJWK() (*JWK, error) {

func (doc *DIDDoc) Destroy() {
if doc._ptr != nil {
// TODO need iotex_diddoc_destroy to release c-language memory
if v := doc._ptr.contexts.contexts; v != nil {
C.cJSON_Delete(v)
}
if v := doc._ptr.aka.alsoKnownAs; v != nil {
C.cJSON_Delete(v)
}
if v := doc._ptr.cons.controllers; v != nil {
C.cJSON_Delete(v)
}
if v := doc._ptr.vm.vm; v != nil {
C.cJSON_Delete(v)
}
if v := doc._ptr.auth.vm; v != nil {
C.cJSON_Delete(v)
}
if v := doc._ptr.assertion.vm; v != nil {
C.cJSON_Delete(v)
}
if v := doc._ptr.keyagreement.vm; v != nil {
C.cJSON_Delete(v)
}
if v := doc._ptr.ci.vm; v != nil {
C.cJSON_Delete(v)
}
if v := doc._ptr.cd.vm; v != nil {
C.cJSON_Delete(v)
}
if v := doc._ptr.publickey.vm; v != nil {
C.cJSON_Delete(v)
}
if v := doc._ptr.services.Services; v != nil {
C.cJSON_Delete(v)
}
if v := doc._ptr.property_set; v != nil {
C.cJSON_Delete((*C.cJSON)(v))
}

C.free(unsafe.Pointer(doc._ptr))
C.iotex_diddoc_destroy(doc._ptr)
doc._ptr = nil
}
}
3 changes: 2 additions & 1 deletion pkg/ioconnect/include/dids/did/did.h
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,10 @@ char* verification_relationship_to_str(enum VerificationRelationship ship);
char* verification_relationship_to_iri(enum VerificationRelationship ship);

char* iotex_did_generate(char *name, JWK *jwk);
char *iotex_dids_get_default(char *did, JWK *jwk);

DIDDoc* iotex_diddoc_new(void);
void iotex_diddoc_destroy(DIDDoc *doc);

DIDDoc_VerificationMethod* iotex_diddoc_verification_method_new(DIDDoc* diddoc, enum VerificationMethod_Purpose purpose, enum VerificationMethod_Type type);
VerificationMethod_Map iotex_diddoc_verification_method_map_new(void);
did_status_t iotex_diddoc_verification_method_map_set(VerificationMethod_Map map, unsigned int build_type, void *value);
Expand Down
Binary file modified pkg/ioconnect/lib/linux-x86_64/libioConnectCore.a
Binary file not shown.
2 changes: 1 addition & 1 deletion pkg/ioconnect/lib/linux-x86_64/md5
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ac09d91a73caebafe691403716afca37
e8eb2131e215259c15e1635787c92e5e

0 comments on commit ced25a9

Please sign in to comment.