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

Feat/external txs #850

Merged
merged 13 commits into from
Aug 21, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/aragonjs-wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,9 +467,7 @@ const templateParamFilters = {

if (neededSignatures < 1 || neededSignatures > signers.length) {
throw new Error(
`neededSignatures must be between 1 and the total number of signers (${
signers.length
})`,
`neededSignatures must be between 1 and the total number of signers (${signers.length})`,
neededSignatures
)
}
Expand Down
10 changes: 10 additions & 0 deletions src/components/SignerPanel/ActionPathsContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const RADIO_ITEM_TITLE_LENGTH = 30
class ActionPathsContent extends React.Component {
static propTypes = {
direct: PropTypes.bool.isRequired,
external: PropTypes.bool,
Schwartz10 marked this conversation as resolved.
Show resolved Hide resolved
intent: PropTypes.object.isRequired,
dao: PropTypes.string.isRequired,
onSign: PropTypes.func.isRequired,
Expand Down Expand Up @@ -175,6 +176,7 @@ class ActionPathsContent extends React.Component {
const {
intent,
direct,
external,
paths,
pretransaction,
signingEnabled,
Expand Down Expand Up @@ -222,6 +224,14 @@ class ActionPathsContent extends React.Component {
</Info.Action>
</div>
)}
{external && (
<div css="margin-top: 20px">
<Info.Alert title="Warning">
This is an attempt to execute a transaction on an external
contract. Please take necessary security precautions.
</Info.Alert>
Schwartz10 marked this conversation as resolved.
Show resolved Hide resolved
</div>
)}
<SignerButton onClick={this.handleSign} disabled={!signingEnabled}>
Create transaction
</SignerButton>
Expand Down
5 changes: 4 additions & 1 deletion src/components/SignerPanel/ConfirmTransaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import ImpossibleContent from './ImpossibleContent'
const ConfirmTransaction = ({
direct,
intent,
external,
dao,
onClose,
onSign,
Expand All @@ -20,9 +21,10 @@ const ConfirmTransaction = ({

return possible ? (
<ActionPathsContent
intent={intent}
direct={direct}
dao={dao}
external={external}
intent={intent}
onSign={onSign}
paths={paths}
pretransaction={pretransaction}
Expand All @@ -37,6 +39,7 @@ const ConfirmTransaction = ({
ConfirmTransaction.propTypes = {
direct: PropTypes.bool.isRequired,
intent: PropTypes.object.isRequired,
external: PropTypes.bool,
Schwartz10 marked this conversation as resolved.
Show resolved Hide resolved
dao: PropTypes.string,
onClose: PropTypes.func.isRequired,
onSign: PropTypes.func.isRequired,
Expand Down
3 changes: 3 additions & 0 deletions src/components/SignerPanel/SignerPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ class SignerPanel extends React.PureComponent {

return {
intent: (transaction && this.transactionIntent(bag)) || {},
external: transaction.external,
sohkai marked this conversation as resolved.
Show resolved Hide resolved
directPath: decoratedPaths.length === 1,
actionPaths: decoratedPaths.length ? [decoratedPaths] : [],
pretransaction: (transaction && transaction.pretransaction) || null,
Expand Down Expand Up @@ -297,6 +298,7 @@ class SignerPanel extends React.PureComponent {
actionPaths,
pretransaction,
status,
external,
} = this.state

const isTransaction = isTxSignerStatus(status)
Expand Down Expand Up @@ -344,6 +346,7 @@ class SignerPanel extends React.PureComponent {
<ConfirmTransaction
dao={dao}
direct={directPath}
external={external}
intent={intent}
onClose={this.handleSignerClose}
onSign={this.handleSign}
Expand Down