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

Rename argument field to payload in the command/create request #4192

Merged
merged 1 commit into from
Jan 24, 2020

Conversation

leo-da
Copy link
Contributor

@leo-da leo-da commented Jan 23, 2020

Rename argument field to payload in the command/create request.

Closes: #4189

Pull Request Checklist

  • Read and understand the contribution guidelines
  • Include appropriate tests
  • Set a descriptive title and thorough description
  • Add a reference to the issue this PR will solve, if appropriate
  • Include changelog additions in one or more commit message bodies between the CHANGELOG_BEGIN and CHANGELOG_END tags
  • Normal production system change, include purpose of change in description

NOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with /AzurePipelines run to
trigger the build.

[JSON API - Experimental] Rename ``argument`` field to ``payload`` in the ``command/create`` request. See #4189.

CHANGELOG_END
@@ -154,12 +154,12 @@ class Ledger {
/**
* Create a contract for a given template.
*/
async create<T extends object, K>(template: Template<T, K>, argument: T): Promise<CreateEvent<T, K>> {
const payload = {
async create<T extends object, K>(template: Template<T, K>, contractPayload: T): Promise<CreateEvent<T, K>> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
async create<T extends object, K>(template: Template<T, K>, contractPayload: T): Promise<CreateEvent<T, K>> {
async create<T extends object, K>(template: Template<T, K>, payload: T): Promise<CreateEvent<T, K>> {

Seems more in the spirit of the change, no?

templateId: template.templateId,
argument,
payload: contractPayload,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
payload: contractPayload,
payload,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess, it is just in a few other places, @hurryabit refers to the entire command as a payload.

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair, well, whatever you think is best.

Copy link
Contributor

@hurryabit hurryabit left a comment

Choose a reason for hiding this comment

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

I like this change very much. Thanks a lot.

@hurryabit hurryabit merged commit 9ab419f into master Jan 24, 2020
@hurryabit hurryabit deleted the leo-4189-command-payload branch January 24, 2020 08:04
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.

Rename argument field in the JSON command to payload
3 participants