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

Define default values for Caller/Sender params #161

Merged
merged 2 commits into from Jun 4, 2018

Conversation

JamesLefrere
Copy link
Contributor

@JamesLefrere JamesLefrere commented Jun 4, 2018

Description

This PR allows developers to define default values for Caller/Sender parameters, and implements this for ColonyClient.createTask.

  • Add a third (optional) parameter for the Param flow type; the default value
  • Fall back to default values in ContractClient._parseInputValues
  • Add a default value (1) for domainId in ColonyClient.createTask

Contributes to #153

Copy link
Member

@chmanie chmanie left a comment

Choose a reason for hiding this comment

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

clap

input: [['specificationHash', 'ipfsHash'], ['domainId', 'number']],
input: [
['specificationHash', 'ipfsHash'],
['domainId', 'number', DEFAULT_DOMAIN_ID],
Copy link
Member

Choose a reason for hiding this comment

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

👍

@@ -4,7 +4,7 @@
import isPlainObject from 'lodash.isplainobject';
import { makeAssert } from '@colony/colony-js-utils';

import type { ContractMethodArgs, ParamTypePairs } from '../flowtypes';
import type { ContractMethodArgs, Params } from '../flowtypes';
Copy link
Member

Choose a reason for hiding this comment

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

I like the renaming there.

* Fall back to default values in `_parseInputValues`
* Rename Param flow types to better represent what they are for
* Add a pass-through third option for `Param` (default value)
@JamesLefrere JamesLefrere force-pushed the feature/default-values-for-parameters branch from 8132ffb to a475cce Compare June 4, 2018 15:04
@JamesLefrere JamesLefrere merged commit b418adb into master Jun 4, 2018
@JamesLefrere JamesLefrere deleted the feature/default-values-for-parameters branch June 4, 2018 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants