Skip to content

Commit

Permalink
style: address comment to keep type names uppercase
Browse files Browse the repository at this point in the history
  • Loading branch information
hui-an-yang committed Feb 2, 2023
1 parent fd68d8b commit abde3f6
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 20 deletions.
8 changes: 4 additions & 4 deletions packages/taquito-contracts-library/src/rpc-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ import {
UnparsingMode,
VotesListingsResponse,
VotingPeriodBlockResult,
ticketTokenParams,
allTicketBalancesResponse,
TicketTokenParams,
AllTicketBalances,
} from '@taquito/rpc';
import { ContractsLibrary } from './taquito-contracts-library';

Expand Down Expand Up @@ -310,15 +310,15 @@ export class RpcWrapperContractsLibrary implements RpcClientInterface {
}
async getTicketBalance(
contract: string,
ticket: ticketTokenParams,
ticket: TicketTokenParams,
{ block }: RPCOptions = defaultRPCOptions
): Promise<string> {
return this.rpc.getTicketBalance(contract, ticket, { block });
}
async getAllTicketBalances(
contract: string,
{ block }: RPCOptions = defaultRPCOptions
): Promise<allTicketBalancesResponse> {
): Promise<AllTicketBalances> {
return this.rpc.getAllTicketBalances(contract, { block });
}
}
8 changes: 4 additions & 4 deletions packages/taquito-rpc/src/rpc-client-interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ import {
VotesListingsResponse,
VotingInfoResponse,
VotingPeriodBlockResult,
ticketTokenParams,
allTicketBalancesResponse,
TicketTokenParams,
AllTicketBalances,
} from './types';

export interface RPCOptions {
Expand Down Expand Up @@ -123,10 +123,10 @@ export interface RpcClientInterface {
getStoragePaidSpace(contract: string, options?: RPCOptions): Promise<string>;
getTicketBalance(
contract: string,
ticket: ticketTokenParams,
ticket: TicketTokenParams,
options?: RPCOptions
): Promise<string>;
getAllTicketBalances(contract: string, options?: RPCOptions): Promise<allTicketBalancesResponse>;
getAllTicketBalances(contract: string, options?: RPCOptions): Promise<AllTicketBalances>;
}

export enum RPCMethodName {
Expand Down
8 changes: 4 additions & 4 deletions packages/taquito-rpc/src/rpc-client-modules/rpc-cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ import {
UnparsingMode,
VotesListingsResponse,
VotingPeriodBlockResult,
ticketTokenParams,
allTicketBalancesResponse,
TicketTokenParams,
AllTicketBalances,
} from '../types';

import {
Expand Down Expand Up @@ -1182,7 +1182,7 @@ export class RpcClientCache implements RpcClientInterface {
*/
async getTicketBalance(
contract: string,
ticket: ticketTokenParams,
ticket: TicketTokenParams,
{ block }: RPCOptions = defaultRPCOptions
): Promise<string> {
const key = this.formatCacheKey(
Expand Down Expand Up @@ -1210,7 +1210,7 @@ export class RpcClientCache implements RpcClientInterface {
async getAllTicketBalances(
contract: string,
{ block }: RPCOptions = defaultRPCOptions
): Promise<allTicketBalancesResponse> {
): Promise<AllTicketBalances> {
const key = this.formatCacheKey(
this.rpcClient.getRpcUrl(),
RPCMethodName.GET_ALL_TICKET_BALANCES,
Expand Down
10 changes: 5 additions & 5 deletions packages/taquito-rpc/src/taquito-rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ import {
VotingPeriodBlockResult,
TxRollupStateResponse,
TxRollupInboxResponse,
ticketTokenParams,
allTicketBalancesResponse,
TicketTokenParams,
AllTicketBalances,
} from './types';
import { castToBigNumber } from './utils/utils';
import {
Expand Down Expand Up @@ -1140,7 +1140,7 @@ export class RpcClient implements RpcClientInterface {
*/
async getTicketBalance(
contract: string,
ticket: ticketTokenParams,
ticket: TicketTokenParams,
{ block }: { block: string } = defaultRPCOptions
): Promise<string> {
return this.httpBackend.createRequest<string>(
Expand All @@ -1164,8 +1164,8 @@ export class RpcClient implements RpcClientInterface {
async getAllTicketBalances(
contract: string,
{ block }: { block: string } = defaultRPCOptions
): Promise<allTicketBalancesResponse> {
return this.httpBackend.createRequest<allTicketBalancesResponse>({
): Promise<AllTicketBalances> {
return this.httpBackend.createRequest<AllTicketBalances>({
url: this.createURL(
`/chains/${this.chain}/blocks/${block}/context/contracts/${contract}/all_ticket_balances`
),
Expand Down
7 changes: 4 additions & 3 deletions packages/taquito-rpc/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1148,19 +1148,20 @@ export interface PackDataParams {
gas?: BigNumber;
}

export interface ticketTokenParams {
export interface TicketTokenParams {
ticketer: string;
content_type: MichelsonV1Expression;
content: MichelsonV1Expression;
}

export interface allTicketBalancesResponse {
export interface TicketBalance {
ticketer: string;
content_type: MichelsonV1Expression;
content: MichelsonV1Expression;
amount: string;
}
[];

export type AllTicketBalances = TicketBalance[];

export type HexString = string;

Expand Down

0 comments on commit abde3f6

Please sign in to comment.