Skip to content
Snippets Groups Projects

Frond End Assistance And Iterative Clean Up

Merged Josh Brooks requested to merge XX-4076/UnexpectedEndOfJson into release
Files
14
+ 10
3
@@ -145,19 +145,26 @@ func (e *E2e) GetUdCertFromNdf() []byte {
@@ -145,19 +145,26 @@ func (e *E2e) GetUdCertFromNdf() []byte {
// Returns
// Returns
// - []byte - A byte marshalled contact.Contact.
// - []byte - A byte marshalled contact.Contact.
func (e *E2e) GetUdContactFromNdf() ([]byte, error) {
func (e *E2e) GetUdContactFromNdf() ([]byte, error) {
udIdData := e.api.GetCmix().GetInstance().GetPartialNdf().Get().UDB.ID
// Retrieve data from E2e
 
netDef := e.api.GetCmix().GetInstance().GetPartialNdf().Get()
 
e2eGroup := e.api.GetE2E().GetGroup()
 
 
// Unmarshal UD ID
 
udIdData := netDef.UDB.ID
udId, err := id.Unmarshal(udIdData)
udId, err := id.Unmarshal(udIdData)
if err != nil {
if err != nil {
return nil, err
return nil, err
}
}
udDhPubKeyData := e.api.GetCmix().GetInstance().GetPartialNdf().Get().UDB.DhPubKey
// Unmarshal DH pub key
udDhPubKey := e.api.GetE2E().GetGroup().NewInt(1)
udDhPubKeyData := netDef.UDB.DhPubKey
 
udDhPubKey := e2eGroup.NewInt(1)
err = udDhPubKey.UnmarshalJSON(udDhPubKeyData)
err = udDhPubKey.UnmarshalJSON(udDhPubKeyData)
if err != nil {
if err != nil {
return nil, err
return nil, err
}
}
 
// Construct contact
udContact := contact.Contact{
udContact := contact.Contact{
ID: udId,
ID: udId,
DhPubKey: udDhPubKey,
DhPubKey: udDhPubKey,
Loading