Skip to content
This repository has been archived by the owner on Sep 22, 2021. It is now read-only.

Commit

Permalink
Added tip support (#942)
Browse files Browse the repository at this point in the history
* Added tip schema

* Tip being added to prisma

* added chain db watcher and frontend

* Added tip proposal

* Added Tip to frontend

* Added tip section

* Added finder

* Added chain db watcher for tip

* remove who

* Added types in refetch

* Added endorse sidebar

* Added tip type for new proposal emai;

* fix

* Update chain-db-watcher/README.md

Co-authored-by: Thibaut Sardan <[email protected]>

* Update chain-db-watcher/README.md

Co-authored-by: Thibaut Sardan <[email protected]>

* chain db open serve modifications for tip

* removed endorsements

* removed datamodel

* yarn generate

* removed endorsements

* fix

* fix

* sidebar component

* fix

* removed code

* fix graphql codegen

* correct tip reason

* allow numbers

* Added time to block

* added status update for tips

* create tip status

* showing only opened status

* codegen

* fix

* added tip closes

* fix finder

* show only open ones

* Hasura migration to v2 and squash (#950)

* squash and migrate to v2

* remove useless users mention

* remove first useless proposals table creation

* delete consecutive add drop column proposal_id

* delete consecutive add drop creation and modification_date

* delete consecutive add drop on reply

* delete consecutive add drop on public.reactions

* delete consecutive add drop on public.post_votes

* delete consecutive add drop on public.post.poll_id and public.post.has_poll

* delete consecutive add drop updated at public.poll and poll_votes

* fix tons of nits to make migration sucessful

* fix wrong uppercase

* remove auto-migration (not-working) and update readme

* delete migration_backup and add cron_triggers.yaml

* ugly hack

* proper closing and closed display

* Added check for closing

* added more check

* fix

* fix

* Change status name

* tip openend

* Update chain-db-watcher/src/sync/index.ts

Co-authored-by: Thibaut Sardan <[email protected]>

* Update chain-db-watcher/src/sync/queries/chain-db.queries.ts

Co-authored-by: Thibaut Sardan <[email protected]>

* Update front-end/src/screens/Tips/index.tsx

* Update front-end/src/screens/Tips/index.tsx

* Update front-end/src/components/Listings/TipListing.tsx

* Update front-end/src/screens/Tips/index.tsx

* Update chain-db-watcher/src/queries.ts

* closing shouldnot show negative days

Co-authored-by: Thibaut Sardan <[email protected]>
Co-authored-by: thib <[email protected]>
  • Loading branch information
3 people authored Jul 9, 2020
1 parent f7228c1 commit 69530bf
Show file tree
Hide file tree
Showing 802 changed files with 17,547 additions and 16,148 deletions.
2 changes: 2 additions & 0 deletions auth-server/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export interface OnchainLinkType {
onchain_motion_id?: number;
onchain_proposal_id?: number;
onchain_referendum_id?: number;
onchain_tip_id?: number;
onchain_treasury_proposal_id?: number;
}

Expand Down Expand Up @@ -238,6 +239,7 @@ export interface VerifyEmailArgs {
export enum PostTypeEnum {
POST = 'post',
PROPOSAL = 'proposal',
TIP = 'tip',
TREASURY = 'treasury',
MOTION = 'motion',
REFERENDUM = 'referendum',
Expand Down
4 changes: 4 additions & 0 deletions auth-server/src/utils/getPostId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export default (type: PostType, onchainLink: OnchainLinkType): number => {
onchain_motion_id,
onchain_proposal_id,
onchain_referendum_id,
onchain_tip_id,
onchain_treasury_proposal_id
} = onchainLink;

Expand All @@ -31,6 +32,9 @@ export default (type: PostType, onchainLink: OnchainLinkType): number => {
case PostTypeEnum.REFERENDUM:
id = onchain_referendum_id;
break;
case PostTypeEnum.TIP:
id = onchain_tip_id;
break;
default:
break;
}
Expand Down
5 changes: 5 additions & 0 deletions auth-server/src/utils/getPostType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,16 @@ export default (onchainLink: OnchainLinkType): PostType => {
onchain_motion_id,
onchain_proposal_id,
onchain_referendum_id,
onchain_tip_id,
onchain_treasury_proposal_id
} = onchainLink;

let type = PostTypeEnum.POST;

if (onchain_tip_id === 0 || onchain_tip_id) {
type = PostTypeEnum.TIP;
}

if (onchain_proposal_id === 0 || onchain_proposal_id) {
type = PostTypeEnum.PROPOSAL;
}
Expand Down
19 changes: 19 additions & 0 deletions chain-db-open-server/prisma/datamodel.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,22 @@ type TreasuryStatus {
status: String!
uniqueStatus: String! @unique
}

type Tip {
id: Int! @id(strategy: SEQUENCE) @sequence(name: "TIP_SEQUENCE" initialValue:1 allocationSize:1)
hash: String!
reason: String!
who: String!
finder: String
finderFee: String
closes: Int
tipStatus: [TipStatus]! @relation(name: "TipStatusFromTip")
}

type TipStatus {
id: ID! @id
blockNumber: BlockNumber! @relation(name: "TipStatusAtBlockNumber", link: INLINE)
tip: Tip! @relation(name: "TipStatusFromTip", link: INLINE)
status: String!
uniqueStatus: String! @unique
}
Loading

0 comments on commit 69530bf

Please sign in to comment.