Skip to content
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

Cudos dev #81

Open
wants to merge 26 commits into
base: cudos-master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
4737c97
CUDOS-2088 / Fix inject withdraw reward type
SpaghettiOverload Jan 17, 2023
9643c61
update next.config.js to enable client-side debug
SpaghettiOverload Jan 17, 2023
d991014
Merge pull request #79 from CudoVentures/CUDOS-2088-/-Fix-inject-with…
SpaghettiOverload Jan 19, 2023
ba7875b
CUDOS-2076 missing Msgs - Addressbook
SpaghettiOverload Jan 23, 2023
935dafd
fix lint errors
SpaghettiOverload Jan 23, 2023
f76bd30
CUDOS-2076 missing Msgs - Marketplace
SpaghettiOverload Jan 25, 2023
c50b4ea
fix lint errors
SpaghettiOverload Jan 25, 2023
9e2ec6f
update test snapshot
SpaghettiOverload Jan 25, 2023
7a079f0
Merge pull request #80 from CudoVentures/CUDOS-2076-Implement-missing…
mlukanova Jan 31, 2023
f341a03
CUDOS-2367-show-app-version-in-footer
SpaghettiOverload Mar 20, 2023
ea26f30
CUDOS-2523-fix-market-cap
SpaghettiOverload May 19, 2023
77e87c3
update calculation
SpaghettiOverload May 19, 2023
36e5ffe
address lint errors
SpaghettiOverload May 19, 2023
47af840
resolve test errors
SpaghettiOverload May 19, 2023
7578310
Merge pull request #82 from CudoVentures/CUDOS-2523-fix-market-cap
SpaghettiOverload May 19, 2023
ccaa64f
add conditional msg decoding to MsgExecuteContract
SpaghettiOverload Jul 5, 2023
e217c42
Merge pull request #83 from CudoVentures/msg-decoding-to-MsgExecuteCo…
mlukanova Jul 5, 2023
562a2af
CUDOS-2603-fix-cw-20-contract-identifying
SpaghettiOverload Aug 29, 2023
81e3427
fix: lint errors
SpaghettiOverload Aug 31, 2023
e2c2326
Merge pull request #84 from CudoVentures/CUDOS-2603-fix-cw-20-contrac…
mlukanova Aug 31, 2023
a5ff8bd
update: docker-compose with deployment version
SpaghettiOverload Oct 17, 2023
6d5fbe0
update dockerfiles
SpaghettiOverload Oct 17, 2023
511a55b
CUDOS-2617-fix-Contract-Transactions-Ordering
SpaghettiOverload Oct 25, 2023
f89b990
CUDOS-2627-display ETH addr, Send & Cancel ToEth
SpaghettiOverload Nov 2, 2023
7bfff94
CUDOS-2624-legacy, new proposals display, linter
SpaghettiOverload Nov 2, 2023
a80765a
CUDOS-2651 general group txs msgs recognition
SpaghettiOverload Nov 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env-dev
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ PORT=3000
NEXT_PUBLIC_URL=http://localhost:3000
NEXT_PUBLIC_WS_CHAIN_URL=ws://localhost:26657/websocket
NEXT_PUBLIC_CHAIN_STATUS=testnet
NEXT_PUBLIC_APP_DEPLOYMENT_VERSION='v1.2.3'
1 change: 1 addition & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ PORT=3000
NEXT_PUBLIC_URL=http://localhost:3000
NEXT_PUBLIC_RPC_WEBSOCKET=http://localhost:26657/websocket
NEXT_PUBLIC_CHAIN_TYPE=testnet
NEXT_PUBLIC_APP_DEPLOYMENT_VERSION='v1.2.3'
2 changes: 2 additions & 0 deletions Dockerfile-dev → Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ ARG NEXT_PUBLIC_GRAPHQL_WS
ARG NEXT_PUBLIC_URL
ARG NEXT_PUBLIC_WS_CHAIN_URL
ARG NEXT_PUBLIC_CHAIN_STATUS
ARG NEXT_PUBLIC_APP_DEPLOYMENT_VERSION
ARG NODE_ENV
ARG PORT=3000

Expand All @@ -33,6 +34,7 @@ ENV NEXT_PUBLIC_GRAPHQL_WS ${NEXT_PUBLIC_GRAPHQL_WS}
ENV NEXT_PUBLIC_URL ${NEXT_PUBLIC_URL}
ENV NEXT_PUBLIC_WS_CHAIN_URL ${NEXT_PUBLIC_WS_CHAIN_URL}
ENV NEXT_PUBLIC_CHAIN_STATUS ${NEXT_PUBLIC_CHAIN_STATUS}
ENV NEXT_PUBLIC_APP_DEPLOYMENT_VERSION ${NEXT_PUBLIC_APP_DEPLOYMENT_VERSION}
ENV NODE_ENV ${NODE_ENV}
ENV PORT ${PORT}
ENV NODE_OPTIONS="--max-old-space-size=8192"
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile-prod → Dockerfile.prod
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ ARG NEXT_PUBLIC_WS_CHAIN_URL
ARG NEXT_PUBLIC_RPC_WEBSOCKET
ARG NEXT_PUBLIC_CHAIN_STATUS
ARG NEXT_PUBLIC_CHAIN_TYPE
ARG NEXT_PUBLIC_APP_DEPLOYMENT_VERSION
ARG NODE_ENV
ARG PORT=3000

Expand All @@ -38,6 +39,7 @@ ENV NEXT_PUBLIC_WS_CHAIN_URL ${NEXT_PUBLIC_WS_CHAIN_URL}
ENV NEXT_PUBLIC_RPC_WEBSOCKET ${NEXT_PUBLIC_RPC_WEBSOCKET}
ENV NEXT_PUBLIC_CHAIN_STATUS ${NEXT_PUBLIC_CHAIN_STATUS}
ENV NEXT_PUBLIC_CHAIN_TYPE ${NEXT_PUBLIC_CHAIN_TYPE}
ENV NEXT_PUBLIC_APP_DEPLOYMENT_VERSION ${NEXT_PUBLIC_APP_DEPLOYMENT_VERSION}
ENV NODE_ENV ${NODE_ENV}
ENV PORT ${PORT}
ENV NODE_OPTIONS="--max-old-space-size=8192"
Expand Down
3 changes: 2 additions & 1 deletion docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ services:
container_name: explorer-v2
build:
context: .
dockerfile: Dockerfile-dev
dockerfile: Dockerfile.dev
args:
NEXT_PUBLIC_GRAPHQL_URL: ${NEXT_PUBLIC_GRAPHQL_URL}
NEXT_PUBLIC_GRAPHQL_WS: ${NEXT_PUBLIC_GRAPHQL_WS}
NEXT_PUBLIC_URL: ${NEXT_PUBLIC_URL}
NEXT_PUBLIC_WS_CHAIN_URL: ${NEXT_PUBLIC_WS_CHAIN_URL}
NEXT_PUBLIC_CHAIN_STATUS: ${NEXT_PUBLIC_CHAIN_STATUS}
NEXT_PUBLIC_APP_DEPLOYMENT_VERSION: ${NEXT_PUBLIC_APP_DEPLOYMENT_VERSION}
NODE_ENV: ${NODE_ENV}
PORT: ${PORT}
restart: always
Expand Down
3 changes: 2 additions & 1 deletion docker-compose-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ services:
container_name: explorer-v2
build:
context: .
dockerfile: Dockerfile-prod
dockerfile: Dockerfile.prod
args:
NEXT_PUBLIC_GRAPHQL_URL: ${NEXT_PUBLIC_GRAPHQL_URL}
NEXT_PUBLIC_GRAPHQL_WS: ${NEXT_PUBLIC_GRAPHQL_WS}
NEXT_PUBLIC_URL: ${NEXT_PUBLIC_URL}
NEXT_PUBLIC_WS_CHAIN_URL: ${NEXT_PUBLIC_WS_CHAIN_URL}
NEXT_PUBLIC_CHAIN_STATUS: ${NEXT_PUBLIC_CHAIN_STATUS}
NEXT_PUBLIC_APP_DEPLOYMENT_VERSION: ${NEXT_PUBLIC_APP_DEPLOYMENT_VERSION}
NODE_ENV: ${NODE_ENV}
PORT: ${PORT}
restart: always
Expand Down
1 change: 1 addition & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const nextTranslate = require('next-translate');

module.exports = nextTranslate({
poweredByHeader: false,
productionBrowserSourceMaps: true,
webpack: (config) => {
config.module.rules.push({
test: /\.svg$/,
Expand Down
1 change: 1 addition & 0 deletions public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
"errorDetails": "If you have time please report it to our github at <0>{{issue}}</0> with the url that caused the error.",
"errorHome": "Click here to go back home",
"maintainBy": "Maintained By <0>{{name}}</0>",
"appVersion": "App version: <0>{{appVersion}}</0>",
"txListFormat": "Transactions Format",
"compact": "Compact",
"detailed": "Detailed",
Expand Down
19 changes: 18 additions & 1 deletion public/locales/en/message_contents.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,22 @@
"txMigrateContract": "<0>{{admin}}</0> migrated contract <1>{{contract}}</1> to <1>{{newCodeId}}</1>",
"txUpdateContractAdmin": "<0>{{admin}}</0> updated contract <1>{{contract}}</1> admin to <2>{{newAdmin}}</2>",
"txClearContractAdmin": "<0>{{admin}}</0> cleared admin on contract <1>{{contract}}</1>",
"MsgSendToCosmosClaim": "<0>{{ethSender}}</0> sent <1>{{amount}}</1> to <2>{{receiver}}</2>"
"MsgSendToCosmosClaim": "<0>{{ethSender}}</0> sent <1>{{amount}}</1> to <2>{{receiver}}</2>",
"MsgSendToEth": "<0>{{sender}}</0> sent <1>{{amount}}</1> to <2>{{ethDest}}</2>",
"MsgCancelSendToEth": "<0>{{sender}}</0> cancelled Send to ETH TX with ID: <1>{{id}}</1>",
"txCreateAddress": "<0>{{creator}}</0> created an addressbook record with the following details - <1></1>",
"txUpdateAddress": "<0>{{creator}}</0> updated an addressbook record. New details - <1></1>",
"txDeleteAddress": "<0>{{creator}}</0> deleted the following addressbook record - <1></1>",
"txCreateCollection": "<0>{{creator}}</0> created '<3>{{collectionId}}</3>' collection. <1></1><2></2>",
"txPublishCollection": "<0>{{creator}}</0> published '<3>{{collectionId}}</3>' collection. <1></1><2></2>",
"txUpdateRoyalties": "<0>{{creator}}</0> updated royalties for collection with ID: '<3>{{collectionId}}</3>' <1></1><2></2>",
"txVerifyCollection": "Marketplace admin: <1>{{admin}}</1> verified collection with ID: <2>{{collectionId}}</2> created by: <0>{{creator}}</0>",
"txUnverifyCollection": "Marketplace admin: <1>{{admin}}</1> unverified collection with ID: <2>{{collectionId}}</2> created by: <0>{{creator}}</0>",
"txAddAdmin": "<0>{{creator}}</0> added <1>{{address}}</1> as marketplace admin",
"txRemoveAdmin": "<0>{{creator}}</0> removed <1>{{address}}</1> from marketplace admins",
"txMintNft": "<0>{{creator}}</0> minted an NFT to <1>{{recipient}}</1> <2></2>",
"txPublishNft": "<0>{{creator}}</0> published for sale NFT with ID: <3>{{tokenId}}</3> from collection ID: <2>{{denomId}}</2> for <1>{{price}}</1>",
"txRemoveNft": "<0>{{creator}}</0> removed from sale NFT with ID: <1>{{id}}</1>",
"txUpdatePrice": "<0>{{creator}}</0> updated the price of NFT with ID: <2>{{id}}</2>. New price: <1>{{price}}</1>",
"txBuyNft": "<0>{{buyer}}</0> purchased NFT with ID: <3>{{id}}</3> from <1>{{seller}}</1> for <2>{{price}}</2>"
}
33 changes: 32 additions & 1 deletion public/locales/en/message_labels.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,36 @@
"txMigrateContract": "Migrate Contract",
"txUpdateContractAdmin": "Update Contract Admin",
"txClearContractAdmin": "Clear Contract Admin",
"MsgSendToCosmosClaim": "Gravity Bridge - Ethereum to Cosmos"
"MsgSendToCosmosClaim": "Gravity Bridge - Ethereum to Cosmos",
"MsgCancelSendToEth": "Gravity Bridge - Cancel Send To Eth",
"MsgSendToEth": "Gravity Bridge - Cosmos to Ethereum",
"txCreateAddress": "New Address Book Record",
"txUpdateAddress": "Update Address Book Record",
"txDeleteAddress": "Delete Address Book Record",
"txCreateCollection": "Create NFT Collection",
"txPublishCollection": "Publish NFT Collection",
"txUpdateRoyalties": "Update NFT Collection Royalties",
"txVerifyCollection": "Verify NFT Collection",
"txUnverifyCollection": "Unverify NFT Collection",
"txAddAdmin": "Add Marketplace Admin",
"txRemoveAdmin": "Remove Marketplace Admin",
"txMintNft": "Mint NFT",
"txPublishNft": "Publish NFT for sale",
"txRemoveNft": "Remove NFT from sale",
"txUpdatePrice": "Update NFT price",
"txBuyNft": "Buy NFT",
"MsgCreateGroup":"Create Group",
"MsgCreateGroupPolicy":"Create Group Policy",
"MsgCreateGroupWithPolicy":"Create Group with Policy",
"MsgExec":"Execute Group Proposal",
"MsgLeaveGroup":"Leave Group",
"MsgSubmitProposal":"Submit Group Proposal",
"MsgUpdateGroupAdmin":"Update Group Admin",
"MsgUpdateGroupMembers":"Update Group Members",
"MsgUpdateGroupMetadata":"Update Group Metadata",
"MsgUpdateGroupPolicyAdmin":"Update Group Policy Admin",
"MsgUpdateGroupPolicyDecisionPolicy":"Update Group Decision Policy",
"MsgUpdateGroupPolicyMetadata":"Update Group Policy Metadata",
"MsgVote":"Group Proposal Vote",
"MsgWithdrawProposal":"Withdraw Proposal"
}
15 changes: 15 additions & 0 deletions src/components/addressbook_details/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react';
import { AddressBookDetailsValue } from '@src/models/msg/types';
import StyledTypographyPair from '../styled_typography_pair';

const AddressBookDetails = ({ content }: { content: AddressBookDetailsValue }) => {
return (
<>
{content.network ? <StyledTypographyPair text="Network:" content={content.network} /> : null}
{content.label ? <StyledTypographyPair text="Label:" content={content.label} /> : null}
{content.value ? <StyledTypographyPair text="Value:" content={content.value} /> : null}
</>
);
};

export default AddressBookDetails;
5 changes: 5 additions & 0 deletions src/components/addressbook_details/styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export const addressBookDetails = {
gap: '10px',
width: '100%',
display: 'flex',
};
2 changes: 1 addition & 1 deletion src/components/footer/__snapshots__/index.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ exports[`component: layout/footer matches snapshot 1`] = `
<p
className="MuiTypography-root footer__closing--text MuiTypography-body1"
>
common:maintainBy
common:appVersion
</p>
</div>
</div>
Expand Down
16 changes: 15 additions & 1 deletion src/components/footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ const Footer: React.FC<{className?: string}> = ({ className }) => {
{' '}
{year}
</Typography>
<Typography className="footer__closing--text">
{/* <Typography className="footer__closing--text">
<Trans
i18nKey="common:maintainBy"
components={[
Expand All @@ -158,6 +158,20 @@ const Footer: React.FC<{className?: string}> = ({ className }) => {
name: generalConfig.maintainer.name,
}}
/>
</Typography> */}
<Typography className="footer__closing--text">
<Trans
i18nKey="common:appVersion"
components={[
(
// eslint-disable-next-line
<a target="_blank" rel="noreferrer" href={`https://github.com/CudoVentures/big-dipper-2.0-cosmos/releases/tag/${process.env.NEXT_PUBLIC_APP_DEPLOYMENT_VERSION}`} />
),
]}
values={{
appVersion: process.env.NEXT_PUBLIC_APP_DEPLOYMENT_VERSION,
}}
/>
</Typography>
</div>
</div>
Expand Down
6 changes: 6 additions & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ import AvatarNameListMsg from './avatar_name_list_msg';
import {
ContractOverview, ContractMessages, ContractMessagesList, SingleContractMessageMobile,
} from './cosmwasm';
import AddressBookDetails from './addressbook_details';
import RoyaltiesDetails from './royalties_details';
import NftDetails from './nft_details';

export {
Layout,
Expand Down Expand Up @@ -71,4 +74,7 @@ export {
ContractMessages,
ContractMessagesList,
SingleContractMessageMobile,
AddressBookDetails,
RoyaltiesDetails,
NftDetails,
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`screen: TransactionDetails/MsgCreateAddress matches snapshot 1`] = `
<p
className="MuiTypography-root MuiTypography-body1"
>
message_contents:txCreateAddress
</p>
`;
45 changes: 45 additions & 0 deletions src/components/msg/addressbook/create_address/index.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import React from 'react';
import { RecoilRoot } from 'recoil';
import renderer from 'react-test-renderer';
import { MockTheme } from '@tests/utils';
import { MsgCreateAddress } from '@models';
import CreateAddress from '.';

// ==================================
// mocks
// ==================================

jest.mock('@components', () => ({
Name: (props) => <div id="Name" {...props} />,
}));

// ==================================
// unit tests
// ==================================
describe('screen: TransactionDetails/MsgCreateAddress', () => {
it('matches snapshot', () => {
const message = new MsgCreateAddress({
category: 'addressbook',
type: 'MsgCreateAddress',
creator: 'creatorAddress',
network: 'testNetwork',
label: 'testLabel',
value: 'testValue',
});
const component = renderer.create(
<RecoilRoot>
<MockTheme>
<CreateAddress
message={message}
/>
</MockTheme>
</RecoilRoot>,
);
const tree = component.toJSON();
expect(tree).toMatchSnapshot();
});

afterEach(() => {
jest.clearAllMocks();
});
});
42 changes: 42 additions & 0 deletions src/components/msg/addressbook/create_address/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import React from 'react';
import Trans from 'next-translate/Trans';
import { Typography } from '@material-ui/core';
import {
Name,
AddressBookDetails,
} from '@components';
import { MsgCreateAddress } from '@models';

const CreateAddress = (props: {
message: MsgCreateAddress;
}) => {
const { message } = props;
const { creator } = message;

return (
<Typography>
<Trans
i18nKey="message_contents:txCreateAddress"
components={[
(
<Name
address={creator}
name={creator}
/>
),
(
<AddressBookDetails
content={{
network: message.network,
label: message.label,
value: message.value,
}}
/>
),
]}
/>
</Typography>
);
};

export default CreateAddress;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`screen: TransactionDetails/MsgDeleteAddress matches snapshot 1`] = `
<p
className="MuiTypography-root MuiTypography-body1"
>
message_contents:txDeleteAddress
</p>
`;
45 changes: 45 additions & 0 deletions src/components/msg/addressbook/delete_address/index.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import React from 'react';
import { RecoilRoot } from 'recoil';
import renderer from 'react-test-renderer';
import { MockTheme } from '@tests/utils';
import { MsgDeleteAddress } from '@models';
import CreateAddress from '.';

// ==================================
// mocks
// ==================================

jest.mock('@components', () => ({
Name: (props) => <div id="Name" {...props} />,
}));

// ==================================
// unit tests
// ==================================
describe('screen: TransactionDetails/MsgDeleteAddress', () => {
it('matches snapshot', () => {
const message = new MsgDeleteAddress({
category: 'addressbook',
type: 'MsgDeleteAddress',
creator: 'creatorAddress',
network: 'testNetwork',
label: 'testLabel',
value: 'testValue',
});
const component = renderer.create(
<RecoilRoot>
<MockTheme>
<CreateAddress
message={message}
/>
</MockTheme>
</RecoilRoot>,
);
const tree = component.toJSON();
expect(tree).toMatchSnapshot();
});

afterEach(() => {
jest.clearAllMocks();
});
});
Loading
Loading