fix `valueInWei` so its always a string

This commit is contained in:
fernandomg 2020-07-14 16:01:00 -03:00
parent 92cb386cc7
commit 1fb191b7ae
9 changed files with 10 additions and 10 deletions

View File

@ -15,7 +15,7 @@ export const upgradeSafeToLatestVersion = async (safeAddress, createTransaction)
createTransaction({ createTransaction({
safeAddress, safeAddress,
to: MULTI_SEND_ADDRESS, to: MULTI_SEND_ADDRESS,
valueInWei: 0, valueInWei: '0',
txData: encodeMultiSendCallData, txData: encodeMultiSendCallData,
notifiedTransaction: 'STANDARD_TX', notifiedTransaction: 'STANDARD_TX',
enqueueSnackbar: () => {}, enqueueSnackbar: () => {},

View File

@ -37,7 +37,7 @@ const sendTransactions = (dispatch, safeAddress, txs, enqueueSnackbar, closeSnac
createTransaction({ createTransaction({
safeAddress, safeAddress,
to: multiSendAddress, to: multiSendAddress,
valueInWei: 0, valueInWei: '0',
txData: encodeMultiSendCallData, txData: encodeMultiSendCallData,
notifiedTransaction: 'STANDARD_TX', notifiedTransaction: 'STANDARD_TX',
enqueueSnackbar, enqueueSnackbar,

View File

@ -34,7 +34,7 @@ export const sendAddOwner = async (values, safeAddress, ownersOld, enqueueSnackb
createTransaction({ createTransaction({
safeAddress, safeAddress,
to: safeAddress, to: safeAddress,
valueInWei: 0, valueInWei: '0',
txData, txData,
notifiedTransaction: TX_NOTIFICATION_TYPES.SETTINGS_CHANGE_TX, notifiedTransaction: TX_NOTIFICATION_TYPES.SETTINGS_CHANGE_TX,
enqueueSnackbar, enqueueSnackbar,

View File

@ -53,7 +53,7 @@ export const sendRemoveOwner = async (
createTransaction({ createTransaction({
safeAddress, safeAddress,
to: safeAddress, to: safeAddress,
valueInWei: 0, valueInWei: '0',
txData, txData,
notifiedTransaction: TX_NOTIFICATION_TYPES.SETTINGS_CHANGE_TX, notifiedTransaction: TX_NOTIFICATION_TYPES.SETTINGS_CHANGE_TX,
enqueueSnackbar, enqueueSnackbar,

View File

@ -47,7 +47,7 @@ export const sendReplaceOwner = async (
createTransaction({ createTransaction({
safeAddress, safeAddress,
to: safeAddress, to: safeAddress,
valueInWei: 0, valueInWei: '0',
txData, txData,
notifiedTransaction: TX_NOTIFICATION_TYPES.SETTINGS_CHANGE_TX, notifiedTransaction: TX_NOTIFICATION_TYPES.SETTINGS_CHANGE_TX,
enqueueSnackbar, enqueueSnackbar,

View File

@ -43,7 +43,7 @@ const ThresholdSettings = ({ classes, closeSnackbar, enqueueSnackbar }) => {
createTransaction({ createTransaction({
safeAddress, safeAddress,
to: safeAddress, to: safeAddress,
valueInWei: 0, valueInWei: '0',
txData, txData,
notifiedTransaction: TX_NOTIFICATION_TYPES.SETTINGS_CHANGE_TX, notifiedTransaction: TX_NOTIFICATION_TYPES.SETTINGS_CHANGE_TX,
enqueueSnackbar, enqueueSnackbar,

View File

@ -53,7 +53,7 @@ const RejectTxModal = ({ classes, closeSnackbar, enqueueSnackbar, isOpen, onClos
createTransaction({ createTransaction({
safeAddress, safeAddress,
to: safeAddress, to: safeAddress,
valueInWei: 0, valueInWei: '0',
notifiedTransaction: TX_NOTIFICATION_TYPES.CANCELLATION_TX, notifiedTransaction: TX_NOTIFICATION_TYPES.CANCELLATION_TX,
enqueueSnackbar, enqueueSnackbar,
closeSnackbar, closeSnackbar,

View File

@ -91,7 +91,7 @@ interface CreateTransaction extends WithSnackbarProps {
to: string to: string
txData?: string txData?: string
txNonce?: number | string txNonce?: number | string
valueInWei: number | string valueInWei: string
} }
const createTransaction = ({ const createTransaction = ({
@ -187,7 +187,7 @@ const createTransaction = ({
const txToMock: TxToMock = { const txToMock: TxToMock = {
...txArgs, ...txArgs,
confirmations: [], // this is used to determine if a tx is pending or not. See `calculateTransactionStatus` helper confirmations: [], // this is used to determine if a tx is pending or not. See `calculateTransactionStatus` helper
value: `${txArgs.valueInWei}`, value: txArgs.valueInWei,
safeTxHash: generateSafeTxHash(safeAddress, txArgs), safeTxHash: generateSafeTxHash(safeAddress, txArgs),
} }
const mockedTx = await mockTransaction(txToMock, safeAddress, state) const mockedTx = await mockTransaction(txToMock, safeAddress, state)

View File

@ -93,5 +93,5 @@ export type TxArgs = {
sender?: string sender?: string
sigs: string sigs: string
to: string to: string
valueInWei: number | string valueInWei: string
} }