-
Notifications
You must be signed in to change notification settings - Fork 102
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
Fix flow bugs #91
Fix flow bugs #91
Changes from 4 commits
6e26101
e818040
eefd019
c078f9b
df4b50c
d0c26b9
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 |
---|---|---|
|
@@ -32,7 +32,7 @@ const { MAX_ALLOWED_UNUSED_ADDRESSES } = config.wallets; | |
|
||
export function isValidAdaAddress(address: string): Promise<boolean> { | ||
try { | ||
const result = getResultOrFail(Wallet.checkAddress(getAddressInHex(address))); | ||
const result: boolean = getResultOrFail(Wallet.checkAddress(getAddressInHex(address))); | ||
return Promise.resolve(result); | ||
} catch (validateAddressError) { | ||
Logger.error('adaAddress::isValidAdaAddress error: ' + | ||
|
@@ -94,8 +94,9 @@ export async function createAdaAddress( | |
): Promise<AdaAddress> { | ||
const filteredAddresses = await getAdaAddressesByType(addressType); | ||
const addressIndex = filteredAddresses.length; | ||
const [address] = getResultOrFail( | ||
Wallet.generateAddresses(cryptoAccount, addressType, [addressIndex])); | ||
const [address]: Array<string> = getResultOrFail( | ||
Wallet.generateAddresses(cryptoAccount, addressType, [addressIndex]) | ||
); | ||
return toAdaAddress(cryptoAccount.account, addressType, addressIndex, address); | ||
} | ||
|
||
|
@@ -112,8 +113,8 @@ export async function saveAsAdaAddresses( | |
addresses: Array<string>, | ||
addressType: AddressType | ||
): Promise<void> { | ||
const mappedAddresses: Array<AdaAddress> = addresses.map((hash, index) => | ||
const mappedAddresses: Array<AdaAddress> = addresses.map((hash, index) => ( | ||
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. I’m curious. I think it shouldn’t be necessary to add those 2 extra 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. The rule in Javascript is you can have a The I think this makes sense. It's the same reason linters for various languages complain when you have an 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. In general though 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.
|
||
toAdaAddress(cryptoAccount.account, addressType, index, hash) | ||
); | ||
)); | ||
return saveAddresses(mappedAddresses, addressType); | ||
} |
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.
This is because the version of eslint we use is super recent so it can support a higher version of babel than we support for our actual codebase. Notably, it includes some change that requires you to change the order decorators are associated in your class. To disable this feature on linting (to match the version we are actually compiling with) I had to add this very cryptic extra field.
You can see the occasional Github issue come up related to this topic: babel/babel-eslint#662