-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fix wallet view #6597
Fix wallet view #6597
Changes from all commits
4b0c183
6473128
3d895a5
0e530ad
6d3927a
c7f652e
a1ea2df
7f4d8d0
bd50a25
7660481
4777b48
fcff2ab
4c664da
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -283,7 +283,8 @@ export default class CreateWalletStore { | |
|
||
const owners = _wallet.owners.filter((owner) => !/^(0x)?0*$/.test(owner)); | ||
|
||
if (_wallet.required > owners.length) { | ||
// Real number of owners is owners + creator | ||
if (_wallet.required > owners.length + 1) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should now check that there are no duplicate identities between the creator and named owners. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the actual wallet code ensuring that? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not sure about the very latest version, but i know at least one of the original versions didn't. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At least here it doesn't : https://github.com/paritytech/contracts/blob/master/Wallet.sol#L58 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
requiredValidation.valueError = 'the number of required validators should be lower or equal the number of owners'; | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,8 +40,8 @@ export default class TypedInput extends Component { | |
PropTypes.string | ||
]).isRequired, | ||
|
||
accounts: PropTypes.object, | ||
allowCopy: PropTypes.bool, | ||
allowedValues: PropTypes.array, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. DeployContract also used There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not a required prop. If empty, it should be ignored (ie. all values are allowed) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perfect, however we are still passing If those are needed, should be replaced with the real values, if not, should be removed since it creates confusion in the codebase. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed |
||
className: PropTypes.string, | ||
error: PropTypes.any, | ||
hint: nodeOrStringProptype(), | ||
|
@@ -97,7 +97,7 @@ export default class TypedInput extends Component { | |
const { type } = param; | ||
|
||
if (type === ABI_TYPES.ARRAY) { | ||
const { accounts, className, label } = this.props; | ||
const { allowedValues, className, label } = this.props; | ||
const { subtype, length } = param; | ||
const value = this.getValue() || param.default; | ||
|
||
|
@@ -113,8 +113,8 @@ export default class TypedInput extends Component { | |
|
||
return ( | ||
<TypedInput | ||
accounts={ accounts } | ||
allowCopy={ allowCopy } | ||
allowedValues={ allowedValues } | ||
className={ className } | ||
key={ `${subtype.type}_${index}` } | ||
onChange={ onChange } | ||
|
@@ -340,13 +340,13 @@ export default class TypedInput extends Component { | |
} | ||
|
||
renderAddress () { | ||
const { accounts, allowCopy, className, label, error, hint, readOnly } = this.props; | ||
const { allowCopy, allowedValues, className, label, error, hint, readOnly } = this.props; | ||
const value = this.getValue(); | ||
|
||
return ( | ||
<InputAddressSelect | ||
allowCopy={ allowCopy } | ||
accounts={ accounts } | ||
allowedValues={ allowedValues } | ||
className={ className } | ||
error={ error } | ||
hint={ hint } | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this true for the latest wallet code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay so it seems that it hasn't been updated to the latest wallet (after the last PR was merged in
paritytech/contracts
), somsg.sender
is still one of the owner.We should update it to the latest version. Although it would be easier with this PR merged : https://github.com/paritytech/contracts/pull/74