-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: remove unused components and add tests (#139)
* chore: remove unused components and add tests * fix: linting issues
- Loading branch information
1 parent
0f8d406
commit 4bb94f2
Showing
22 changed files
with
130 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
const Config = require('@vechain/repo-config'); | ||
|
||
module.exports = Config.EslintReact; | ||
module.exports = { | ||
...Config.EslintReact, | ||
ignorePatterns: [...Config.EslintReact.ignorePatterns, '*.test.ts', 'test/**'] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
1 change: 1 addition & 0 deletions
1
packages/dapp-kit-react/src/Components/ConnectButtonWithModal/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './ConnectButtonWithModal'; |
11 changes: 0 additions & 11 deletions
11
...t-react/src/Components/ConnectWalletButtonWithModal/Components/ConnectButtonWithModal.tsx
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
...ponents/ConnectWalletButtonWithModal/Components/Wrapped/ConnectModalWithButtonWrapped.tsx
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
packages/dapp-kit-react/src/Components/ConnectWalletButtonWithModal/ConnectWalletButton.tsx
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
packages/dapp-kit-react/src/Components/ConnectWalletButtonWithModal/index.ts
This file was deleted.
Oops, something went wrong.
47 changes: 0 additions & 47 deletions
47
packages/dapp-kit-react/src/Components/ConnectWalletModal/ConnectWalletModal.tsx
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
packages/dapp-kit-react/src/Components/ConnectWalletModal/index.ts
This file was deleted.
Oops, something went wrong.
44 changes: 0 additions & 44 deletions
44
packages/dapp-kit-react/src/Components/SelectWalletModal/SelectWalletModal.tsx
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
packages/dapp-kit-react/src/Components/SelectWalletModal/index.ts
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
packages/dapp-kit-react/src/Components/VechainDappConnectKit/index.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
export * from './ConnectWalletButtonWithModal'; | ||
export * from './ConnectWalletModal'; | ||
export * from './SelectWalletModal'; | ||
export * from './VechainDappConnectKit'; | ||
export * from './ConnectButtonWithModal'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/// <reference types="@vechain/connex" /> | ||
import { blake2b256, Certificate, HDNode, secp256k1 } from 'thor-devkit'; | ||
|
||
const mnemonicWords = | ||
'denial kitchen pet squirrel other broom bar gas better priority spoil cross'; | ||
|
||
const hdNode = HDNode.fromMnemonic(mnemonicWords.split(' ')); | ||
|
||
const firstAccount = hdNode.derive(0); | ||
|
||
const privateKey: Buffer = firstAccount.privateKey!; | ||
const address = firstAccount.address; | ||
|
||
const mockedConnexSigner: Connex.Signer = { | ||
signTx() { | ||
return Promise.resolve({ txid: '0x1234', signer: address }); | ||
}, | ||
|
||
signCert(msg) { | ||
const certificate: Certificate = { | ||
domain: ' localhost:3000', | ||
timestamp: 12341234, | ||
signer: address, | ||
payload: msg.payload, | ||
purpose: msg.purpose, | ||
}; | ||
|
||
const signature = secp256k1.sign( | ||
blake2b256(Certificate.encode(certificate)), | ||
privateKey, | ||
); | ||
|
||
return Promise.resolve({ | ||
annex: { | ||
domain: certificate.domain, | ||
timestamp: certificate.timestamp, | ||
signer: certificate.signer, | ||
}, | ||
signature: `0x${signature.toString('hex')}`, | ||
}); | ||
}, | ||
}; | ||
|
||
export { mockedConnexSigner, hdNode, mnemonicWords, privateKey, address }; |
13 changes: 2 additions & 11 deletions
13
packages/dapp-kit-react/test/helpers/react-test-helpers.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,11 @@ | ||
import { | ||
ConnectWalletModal, | ||
DAppKitProvider, | ||
SelectWalletModal, | ||
VechainDappConnectKit, | ||
ConnectWalletButtonWithModal, | ||
} from '../../src'; | ||
import { ConnectButtonWithModal, DAppKitProvider } from '../../src'; | ||
import { ThemeProvider } from '../../src/provider/ThemeProvider'; | ||
|
||
export const wrapper = ({ children }: { children?: React.ReactNode }) => ( | ||
<DAppKitProvider nodeUrl="https://testnet.vechain.org"> | ||
<ThemeProvider> | ||
{children} | ||
<VechainDappConnectKit /> | ||
<ConnectWalletButtonWithModal /> | ||
<SelectWalletModal isOpen={false} /> | ||
<ConnectWalletModal isOpen={false} /> | ||
<ConnectButtonWithModal /> | ||
</ThemeProvider> | ||
</DAppKitProvider> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.