Skip to content

Commit

Permalink
fix: import and export types
Browse files Browse the repository at this point in the history
  • Loading branch information
shuffledex committed Jul 31, 2020
1 parent d29f037 commit 2758f5f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 29 deletions.
15 changes: 6 additions & 9 deletions src/Governance.ts
Expand Up @@ -4,20 +4,17 @@ import { ApolloQueryResult } from 'apollo-client';
import BigNumber from 'bignumber.js';

import { Identity, Proposal } from '~/api/entities';
import { ProposalState } from '~/api/entities/Proposal/types';
import {
ProposalOrderByInput,
ProposalState,
ProposalTimeFrames,
} from '~/api/entities/Proposal/types';
import { createProposal, CreateProposalParams } from '~/api/procedures';
import { PolymeshError, TransactionQueue } from '~/base';
import { Context } from '~/context';
import { proposals } from '~/middleware/queries';
import { Query } from '~/middleware/types';
import {
Ensured,
ErrorCode,
ProposalOrderByInput,
ProposalTimeFrames,
SubCallback,
UnsubCallback,
} from '~/types';
import { Ensured, ErrorCode, SubCallback, UnsubCallback } from '~/types';
import { balanceToBigNumber, identityIdToString, u32ToBigNumber, valueToDid } from '~/utils';

/**
Expand Down
30 changes: 15 additions & 15 deletions src/api/entities/Proposal/types.ts
@@ -1,11 +1,11 @@
import BigNumber from 'bignumber.js';

import { Identity } from '~/api/entities';
import { ProposalState } from '~/middleware/types';

export interface Proposal {
call: Call;
metadata: Metadata;
state: ProposalState;
export interface CallArguments {
name: string;
value: string;
}

export interface Call {
Expand All @@ -15,11 +15,6 @@ export interface Call {
module: string;
}

export interface CallArguments {
name: string;
value: string;
}

export interface Metadata {
proposer: Identity;
createdAt: Date;
Expand All @@ -33,16 +28,21 @@ export interface Metadata {
totalVotes: number;
}

export interface Proposal {
call: Call;
metadata: Metadata;
state: ProposalState;
}

export interface ProposalVote {
identity: Identity;
vote: boolean;
weight: BigNumber;
}

export enum ProposalState {
Pending = 'Pending',
Cancelled = 'Cancelled',
Killed = 'Killed',
Rejected = 'Rejected',
Referendum = 'Referendum',
export interface ProposalTimeFrames {
duration: number;
coolOff: number;
}

export { ProposalOrderByInput, ProposalState } from '~/middleware/types';
5 changes: 0 additions & 5 deletions src/types/index.ts
Expand Up @@ -372,11 +372,6 @@ export enum LinkType {
NoData = 'NoData',
}

export interface ProposalTimeFrames {
duration: number;
coolOff: number;
}

export { TxTags } from 'polymesh-types/types';
export * from '~/api/entities/types';
export * from '~/base/types';
Expand Down

0 comments on commit 2758f5f

Please sign in to comment.