WA-238 Fixing error of safes 1+ owners and threshold 1 when sending txs
This commit is contained in:
parent
a7076b9a1a
commit
cfdbc8a761
|
@ -94,7 +94,8 @@ export const createTransaction = async (
|
|||
const valueInWei = web3.toWei(txValue, 'ether')
|
||||
const CALL = 0
|
||||
|
||||
if (hasOneOwner(safe)) {
|
||||
const thresholdIsOne = safe.get('confirmations') === 1
|
||||
if (hasOneOwner(safe) || thresholdIsOne) {
|
||||
const txReceipt = await gnosisSafe.execTransactionIfApproved(txDestination, valueInWei, '0x', CALL, nonce, { from: user, gas: '5000000' })
|
||||
const executedConfirmations: List<Confirmation> = buildExecutedConfirmationFrom(safe.get('owners'), user)
|
||||
return storeTransaction(txName, nonce, txDestination, txValue, user, executedConfirmations, txReceipt.tx, safeAddress, safe.get('confirmations'))
|
||||
|
|
|
@ -21,6 +21,7 @@ const styles = {
|
|||
|
||||
type Props = Open & WithStyles & {
|
||||
confirmations: List<Confirmation>,
|
||||
threshold: number,
|
||||
}
|
||||
|
||||
const GnoConfirmation = ({ owner, status, hash }: ConfirmationProps) => {
|
||||
|
@ -45,11 +46,8 @@ const GnoConfirmation = ({ owner, status, hash }: ConfirmationProps) => {
|
|||
}
|
||||
|
||||
const Confirmaitons = openHoc(({
|
||||
open, toggle, confirmations,
|
||||
}: Props) => {
|
||||
const threshold = confirmations.count()
|
||||
|
||||
return (
|
||||
open, toggle, confirmations, threshold,
|
||||
}: Props) => (
|
||||
<React.Fragment>
|
||||
<ListItem onClick={toggle}>
|
||||
<Avatar>
|
||||
|
@ -73,7 +71,6 @@ const Confirmaitons = openHoc(({
|
|||
</List>
|
||||
</Collapse>
|
||||
</React.Fragment>
|
||||
)
|
||||
})
|
||||
))
|
||||
|
||||
export default withStyles(styles)(Confirmaitons)
|
||||
|
|
|
@ -15,6 +15,7 @@ type Props = {
|
|||
safeName: string,
|
||||
confirmations: ImmutableList<Confirmation>,
|
||||
destination: string,
|
||||
threshold: number,
|
||||
}
|
||||
|
||||
const listStyle = {
|
||||
|
@ -24,7 +25,7 @@ const listStyle = {
|
|||
class Collapsed extends React.PureComponent<Props, {}> {
|
||||
render() {
|
||||
const {
|
||||
confirmations, destination, safeName,
|
||||
confirmations, destination, safeName, threshold,
|
||||
} = this.props
|
||||
|
||||
return (
|
||||
|
@ -35,7 +36,7 @@ class Collapsed extends React.PureComponent<Props, {}> {
|
|||
<Avatar><Group /></Avatar>
|
||||
<ListItemText primary={safeName} secondary="Safe Name" />
|
||||
</ListItem>
|
||||
<Confirmations confirmations={confirmations} />
|
||||
<Confirmations confirmations={confirmations} threshold={threshold} />
|
||||
<ListItem>
|
||||
<Avatar><MailOutline /></Avatar>
|
||||
<ListItemText primary="Destination" secondary={destination} />
|
||||
|
|
|
@ -82,6 +82,7 @@ class GnoTransaction extends React.PureComponent<Props, {}> {
|
|||
safeName={safeName}
|
||||
confirmations={transaction.get('confirmations')}
|
||||
destination={transaction.get('destination')}
|
||||
threshold={transaction.get('threshold')}
|
||||
/> }
|
||||
<Hairline />
|
||||
</React.Fragment>
|
||||
|
|
Loading…
Reference in New Issue