-
Notifications
You must be signed in to change notification settings - Fork 2
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
chore: wallet-service monorepo [part 2] - CI #99
Conversation
…efore processing it
73eb29d
to
215ef98
Compare
215ef98
to
40d8510
Compare
40d8510
to
9864bc7
Compare
@@ -843,7 +843,7 @@ describe('address and wallet related tests', () => { | |||
for (const [index, address] of addressesInfo.addresses.entries()) { | |||
expect(ADDRESSES[index]).toBe(address); | |||
} | |||
} ); | |||
}, 15000); |
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.
It times out with less than 15s
|
||
it('transaction already in the database should throw', async () => { | ||
const context = { | ||
event: { | ||
event: { | ||
data: { | ||
hash: 'hashValue', | ||
}, | ||
id: 'idValue', | ||
}, | ||
}, | ||
}; | ||
|
||
const mockTransaction = { tx_id: 'hashValue' }; | ||
(getTransactionById as jest.Mock).mockResolvedValue(mockTransaction); | ||
|
||
await expect(handleVertexAccepted(context as any, {} as any)).rejects.toThrow('Transaction hashValue already in the database, this should never happen'); | ||
}); |
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 condition was removed on the reliable-integrations part 2 PR, this test was failing
@@ -35,7 +35,7 @@ | |||
"typescript": "^4.9.5" | |||
}, | |||
"dependencies": { | |||
"@hathor/wallet-lib": "^1.0.2", | |||
"@hathor/wallet-lib": "^0.39.0", |
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.
We should update the wallet-lib on another PR for both the daemon and the wallet-service
@@ -7,6 +7,7 @@ | |||
|
|||
import { BinaryToTextEncoding, createHash } from 'crypto'; | |||
|
|||
import { Logger } from 'winston'; |
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.
Not sure why this happened, but the build was failing because of this missing dependency
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.
I believe its used as an argument type, maybe the LSP does not count type annotations as usage of the import.
bitcore.Networks.add({ | ||
...network.bitcoreNetwork, | ||
networkMagic: network.bitcoreNetwork.networkMagic.readUInt32BE(), | ||
}); | ||
|
||
export const getXPrivKeyFromSeed = ( | ||
seed: string, | ||
options: { | ||
passphrase?: string, | ||
networkName?: string | ||
} = {}): bitcore.HDPrivateKey => { | ||
const methodOptions = Object.assign({passphrase: '', networkName: 'mainnet'}, options); | ||
const { passphrase, networkName } = methodOptions; | ||
|
||
const network = new Network(networkName); | ||
const code = new Mnemonic(seed); | ||
return code.toHDPrivateKey(passphrase, network.bitcoreNetwork); | ||
}; |
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.
I had to create my own getXPrivKeyFromSeed
because the lib was having issues with its own bitcore-mnemonic dependency
I also had to add Hathor's network manually to be able to use the wallet-lib methods
@@ -181,7 +182,7 @@ test('GET /addresses', async () => { | |||
expect(result.statusCode).toBe(STATUS_CODE_TABLE[ApiError.INVALID_PAYLOAD]); | |||
expect(returnBody.details).toHaveLength(1); | |||
expect(returnBody.details[0].message) | |||
.toMatchInlineSnapshot('"\\"index\\" must be greater than or equal to 0"'); | |||
.toMatchInlineSnapshot('"\"index\" must be greater than or equal to 0"'); |
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.
Had to update all inline snapshots after jest update
@@ -7,6 +7,7 @@ | |||
|
|||
import { BinaryToTextEncoding, createHash } from 'crypto'; | |||
|
|||
import { Logger } from 'winston'; |
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.
I believe its used as an argument type, maybe the LSP does not count type annotations as usage of the import.
b680990
to
b8863bb
Compare
Acceptance Criteria
Security Checklist