Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: change return type from certificate to consent #67

Merged
merged 7 commits into from
Jan 5, 2023

Conversation

inchori
Copy link
Contributor

@inchori inchori commented Jan 5, 2023

Closes #64

@inchori inchori self-assigned this Jan 5, 2023
Comment on lines 158 to 161
payload := datadealtypes.Consent{
Certificate: certificate,
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @youngjoon-lee said in offline channel, oracle will just return the certificate, and provider will make consent to provide the data with this certificate.
So, let's just return the certificate itself

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, when I tested this code and seller request validating a data, this API returns like this:

{
    "certificate": {
        "unsigned_certificate": {
            "cid": "...",
            "unique_id": "...",
            "oracle_address": "...",
            "deal_id": 1,
            "provider_address": "...",
            "data_hash": "..."
        },
        "signature": "..."
    }
}

Because consent includes a certificate, so would I need to change it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it includes certificate. I just wanna say that returning consent and returning certificate are distinctly different.

For example, in the future, let's assume that we add a expiration for the consent (how long the provider provide the data).
Then, the provider will get a certificate from oracle, and make consent message to provide data with expiration he/she want. Making the consent is the provider's job.

Copy link
Contributor Author

@inchori inchori Jan 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we discussed in offline, I rollbacked and renamed variables. I understand the @H4NLee's comment. And I think that it was right. So I changed it in d3e313e.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good. I agree.
Thank you!

Copy link
Contributor

@gyuguen gyuguen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@inchori inchori requested review from gyuguen and 0xHansLee January 5, 2023 06:31
Copy link
Contributor

@0xHansLee 0xHansLee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Contributor

@youngjoon-lee youngjoon-lee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ㅣㅎ스

@inchori inchori merged commit 26f0eb4 into main Jan 5, 2023
@inchori inchori deleted the ft/64/change_return_type branch January 5, 2023 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change json return type after validate a data
4 participants