(Fix) Wrong owners name assignment on Safe Load (#2020)
* pad with zeroes so sorting works properly * fix @ts-eslint warnings
This commit is contained in:
parent
34a8bcc259
commit
188175d690
|
@ -1,13 +1,16 @@
|
||||||
|
import { LoadFormValues } from 'src/routes/load/container/Load'
|
||||||
|
import { CreateSafeValues } from 'src/routes/open/utils/safeDataExtractor'
|
||||||
|
|
||||||
export const FIELD_NAME = 'name'
|
export const FIELD_NAME = 'name'
|
||||||
export const FIELD_CONFIRMATIONS = 'confirmations'
|
export const FIELD_CONFIRMATIONS = 'confirmations'
|
||||||
export const FIELD_OWNERS = 'owners'
|
export const FIELD_OWNERS = 'owners'
|
||||||
export const FIELD_SAFE_NAME = 'safeName'
|
export const FIELD_SAFE_NAME = 'safeName'
|
||||||
export const FIELD_CREATION_PROXY_SALT = 'safeCreationSalt'
|
export const FIELD_CREATION_PROXY_SALT = 'safeCreationSalt'
|
||||||
|
|
||||||
export const getOwnerNameBy = (index: number): string => `owner${index}Name`
|
export const getOwnerNameBy = (index: number): string => `owner${index.toString().padStart(4, '0')}Name`
|
||||||
export const getOwnerAddressBy = (index: number): string => `owner${index}Address`
|
export const getOwnerAddressBy = (index: number): string => `owner${index.toString().padStart(4, '0')}Address`
|
||||||
|
|
||||||
export const getNumOwnersFrom = (values) => {
|
export const getNumOwnersFrom = (values: CreateSafeValues | LoadFormValues): number => {
|
||||||
const accounts = Object.keys(values)
|
const accounts = Object.keys(values)
|
||||||
.sort()
|
.sort()
|
||||||
.filter((key) => {
|
.filter((key) => {
|
||||||
|
|
Loading…
Reference in New Issue