Skip to content

Commit

Permalink
rename to "coVaults" (#1079)
Browse files Browse the repository at this point in the history
  • Loading branch information
levity committed Jun 24, 2022
1 parent e25afc1 commit b717236
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 22 deletions.
8 changes: 5 additions & 3 deletions api/hasura/actions/_handlers/createVault.ts
Expand Up @@ -36,7 +36,7 @@ async function handler(req: VercelRequest, res: VercelResponse) {

if (!isOrgAdmin)
throw new UnauthorizedError(
`Error on Vault Creation: Address ${hasuraAddress} is not an admin` +
`Error during coVault Creation: Address ${hasuraAddress} is not an admin` +
` of org ${org_id}`
);

Expand All @@ -47,7 +47,7 @@ async function handler(req: VercelRequest, res: VercelResponse) {

if (!vaultExists)
throw new UnprocessableError(
`Vault with address ${vault_address} not registered`
`No coVault with address ${vault_address} exists`
);

const vault = contracts.getVault(vault_address);
Expand Down Expand Up @@ -90,7 +90,9 @@ async function handler(req: VercelRequest, res: VercelResponse) {
);

if (!result?.id)
throw new InternalServerError(`No Vault Id returned for ${vault_address}`);
throw new InternalServerError(
`No coVault ID returned for ${vault_address}`
);
res.status(200).json(result);
}

Expand Down
6 changes: 3 additions & 3 deletions cypress/integration/createVault.ts
Expand Up @@ -28,10 +28,10 @@ context('Coordinape', () => {
cy.login();
cy.contains('Ended Epoch With Gifts', { timeout: 120000 }).click();
cy.wait(1000);
cy.contains('Add Vault').click();
cy.contains('Add coVault').click();
cy.get('[role=dialog]').contains('USDC').click();
cy.contains('Create Vault').click();
cy.contains('USDC Vault', { timeout: 120000 });
cy.contains('Create coVault').click();
cy.contains('USDC coVault', { timeout: 120000 });

// Deposit USDC into the vault
cy.contains('Deposit').click();
Expand Down
2 changes: 1 addition & 1 deletion src/components/MainLayout/MainHeader.tsx
Expand Up @@ -26,7 +26,7 @@ import { shortenAddress } from 'utils';

const mainLinks = [
[paths.circles, 'Overview'],
isFeatureEnabled('vaults') && [paths.vaults, 'Vaults'],
isFeatureEnabled('vaults') && [paths.vaults, 'coVaults'],
].filter(x => x) as [string, string][];

export const MainHeader = () => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/OverviewMenu/OverviewMenu.tsx
Expand Up @@ -35,7 +35,7 @@ type QueryResult = Awaited<ReturnType<typeof getOverviewMenuData>>;

const mainLinks = [
[paths.circles, 'Overview'],
isFeatureEnabled('vaults') && [paths.vaults, 'Vaults'],
isFeatureEnabled('vaults') && [paths.vaults, 'coVaults'],
].filter(x => x) as [string, string][];

export const OverviewMenu = () => {
Expand All @@ -58,7 +58,7 @@ export const OverviewMenu = () => {
const overviewMenuTriggerText = inCircle
? currentCircle
: location.pathname.includes(paths.vaults)
? 'Vaults'
? 'coVaults'
: 'Overview';
const overviewMenuTrigger = (
<Link
Expand Down
5 changes: 4 additions & 1 deletion src/lib/vaults/tokens.ts
Expand Up @@ -21,7 +21,10 @@ export const getTokenAddress = (
const address = hasSimpleToken(vault)
? vault.simple_token_address
: vault.token_address;
assert(address && address !== ZERO_ADDRESS, 'Vault is missing token address');
assert(
address && address !== ZERO_ADDRESS,
'coVault is missing token address'
);
return address;
};

Expand Down
2 changes: 1 addition & 1 deletion src/pages/AdminPage/AdminUserModal.tsx
Expand Up @@ -164,7 +164,7 @@ export const AdminUserModal = ({
onChange={() => {}}
label="Fixed Payment Amount"
disabled={true}
placeholder="Vault owner must set asset type first"
placeholder="coVault owner must set asset type first"
/>
)}
<pre>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/DistributionsPage/AllocationsTable.tsx
Expand Up @@ -33,7 +33,7 @@ export const AllocationsTable = ({
{ title: 'ETH' },
{ title: `${tokenName || 'GIVE'} Received` },
{ title: '% of Epoch' },
{ title: 'Vault Funds Allocated' },
{ title: 'Funds Allocated' },
]}
data={users}
startingSortIndex={2}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/DistributionsPage/DistributionForm.tsx
Expand Up @@ -114,7 +114,7 @@ export function DistributionForm({
textAlign: 'center',
}}
>
Select Vault
Select coVault
</Box>
<Controller
name="selectedVaultId"
Expand All @@ -127,7 +127,7 @@ export function DistributionForm({
<>
<Select
value={value || ''}
label="Vault"
label="coVault"
error={!!error}
disabled={submitting}
onChange={({ target: { value } }) => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/VaultsPage/CreateForm.test.tsx
Expand Up @@ -20,7 +20,7 @@ test('select an asset', async () => {
});
await screen.findByText('DAI');
fireEvent.click(screen.getByText('DAI'));
const submitButton = screen.getByText('Create Vault') as HTMLButtonElement;
const submitButton = screen.getByText('Create coVault') as HTMLButtonElement;
await waitFor(() => expect(submitButton.disabled).toBeFalsy());
});

Expand Down
6 changes: 3 additions & 3 deletions src/pages/VaultsPage/CreateForm.tsx
Expand Up @@ -135,10 +135,10 @@ export const CreateForm = ({
}}
>
<Text font="source" size="large" semibold css={{ mb: '$sm' }}>
Select a Vault Asset
Select a coVault Asset
</Text>
<Text font="source" size="medium">
Vaults allow you to fund your circles with the asset of your choice.
coVaults allow you to fund your circles with the asset of your choice.
</Text>
<Box css={{ display: 'flex', gap: '$sm', my: '$lg' }}>
{contracts.getAvailableTokens().map(symbol => (
Expand Down Expand Up @@ -181,7 +181,7 @@ export const CreateForm = ({
css={{ mt: '$lg', width: '100%' }}
disabled={!isValid}
>
Create Vault
Create coVault
</Button>
{!isEmpty(errors) && (
<Text color="alert" css={{ mt: '$sm' }}>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/VaultsPage/VaultRow.tsx
Expand Up @@ -49,7 +49,7 @@ export function VaultRow({
css={{ display: 'flex', alignItems: 'center', gap: '$md', mb: '$md' }}
>
<Text h3 css={{ flexGrow: 1 }}>
{vault.symbol || '...'} Vault
{vault.symbol || '...'} coVault
</Text>
<Button
color="primary"
Expand Down
6 changes: 3 additions & 3 deletions src/pages/VaultsPage/VaultsPage.tsx
Expand Up @@ -59,7 +59,7 @@ const VaultsPage = () => {
</Box>
<Box css={{ display: 'flex' }}>
<Text h2 css={{ flexGrow: 1 }}>
Vaults
coVaults
</Text>
{isAdmin && (
<Button
Expand All @@ -68,7 +68,7 @@ const VaultsPage = () => {
size="small"
onClick={() => setModal('create')}
>
Add Vault
Add coVault
</Button>
)}
</Box>
Expand All @@ -88,7 +88,7 @@ const VaultsPage = () => {
</Panel>
)}
{modal === 'create' && currentOrg && (
<Modal onClose={closeModal} title="Create a New Vault">
<Modal onClose={closeModal} title="Create a New coVault">
<CreateForm onSuccess={closeModal} orgId={currentOrg.id} />
</Modal>
)}
Expand Down

1 comment on commit b717236

@vercel
Copy link

@vercel vercel bot commented on b717236 Jun 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.