Skip to content

Commit

Permalink
Merge pull request #2186 from ecadlabs/2172-rpc-lima
Browse files Browse the repository at this point in the history
fix(rpc): add missing properties related to lima
  • Loading branch information
roxaneletourneau authored Dec 2, 2022
2 parents c898804 + f32a52d commit 8922de6
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 73 deletions.
16 changes: 8 additions & 8 deletions integration-tests/rpc-get-protocol-constants.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ CONFIGS().forEach(({ lib, protocol, rpc }) => {
});

it('Verify that rpc.getConstants successfully fetches Proto9 constants at level 1480000', async (done) => {
const constants: ConstantsResponseProto009 & ConstantsResponseCommon = await Tezos.rpc.getConstants({ block: "1480000" });
const constants: ConstantsResponseProto009 = await Tezos.rpc.getConstants({ block: "1480000" });

expect(constants).toEqual({
proof_of_work_nonce_size: 8,
Expand Down Expand Up @@ -367,7 +367,7 @@ CONFIGS().forEach(({ lib, protocol, rpc }) => {
});

it('Verify that rpc.getConstants successfully fetches Proto10 constants at level 1589492', async (done) => {
const constants: ConstantsResponseProto010 & ConstantsResponseCommon = await Tezos.rpc.getConstants({ block: "1589492" });
const constants: ConstantsResponseProto010 = await Tezos.rpc.getConstants({ block: "1589492" });

expect(constants).toEqual({
proof_of_work_nonce_size: 8,
Expand Down Expand Up @@ -409,7 +409,7 @@ CONFIGS().forEach(({ lib, protocol, rpc }) => {
});

it('successfully fetches Proto11 constants at level 1932041', async (done) => {
const constants: ConstantsResponseProto011 & ConstantsResponseCommon = await Tezos.rpc.getConstants({ block: "1932041" });
const constants: ConstantsResponseProto011 = await Tezos.rpc.getConstants({ block: "1932041" });

expect(constants).toEqual({
proof_of_work_nonce_size: 8,
Expand Down Expand Up @@ -455,7 +455,7 @@ CONFIGS().forEach(({ lib, protocol, rpc }) => {
});

it('successfully fetches Proto12 constants at level 2354016', async (done) => {
const constants: ConstantsResponseProto012 & ConstantsResponseCommon = await Tezos.rpc.getConstants({ block: "2354016" });
const constants: ConstantsResponseProto012 = await Tezos.rpc.getConstants({ block: "2354016" });

expect(constants).toEqual({
proof_of_work_nonce_size: 8,
Expand Down Expand Up @@ -511,7 +511,7 @@ CONFIGS().forEach(({ lib, protocol, rpc }) => {
});

it('successfully fetches Proto13 constants at level 2656071', async (done) => {
const constants: ConstantsResponseProto013 & ConstantsResponseCommon = await Tezos.rpc.getConstants({ block: "2656071" });
const constants: ConstantsResponseProto013 = await Tezos.rpc.getConstants({ block: "2656071" });

expect(constants).toEqual({
proof_of_work_nonce_size: 8,
Expand Down Expand Up @@ -593,7 +593,7 @@ CONFIGS().forEach(({ lib, protocol, rpc }) => {

limanet(`successfully fetches all constants for limanet using ${rpc}`, async (done) => {
Tezos.setRpcProvider(rpc);
const constants: ConstantsResponseProto015 & ConstantsResponseCommon = await Tezos.rpc.getConstants();
const constants: ConstantsResponseProto015 = await Tezos.rpc.getConstants();

expect(constants).toEqual({
proof_of_work_nonce_size: 8,
Expand Down Expand Up @@ -698,7 +698,7 @@ CONFIGS().forEach(({ lib, protocol, rpc }) => {

kathmandunet(`successfully fetches all constants for kathmandunet using ${rpc}`, async (done) => {
Tezos.setRpcProvider(rpc);
const constants: ConstantsResponseProto014 & ConstantsResponseCommon = await Tezos.rpc.getConstants();
const constants: ConstantsResponseProto014 = await Tezos.rpc.getConstants();
expect(constants).toEqual({
proof_of_work_nonce_size: 8,
nonce_length: 32,
Expand Down Expand Up @@ -792,7 +792,7 @@ CONFIGS().forEach(({ lib, protocol, rpc }) => {

alpha(`successfully fetches all constants for mondaynet using ${rpc}`, async (done) => {
Tezos.setRpcProvider(rpc);
const constants: ConstantsResponseProto014 & ConstantsResponseCommon = await Tezos.rpc.getConstants();
const constants: ConstantsResponseProto015 = await Tezos.rpc.getConstants();

expect(constants).toEqual({
proof_of_work_nonce_size: 8,
Expand Down
42 changes: 29 additions & 13 deletions packages/taquito-rpc/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ export interface OperationContentsTxRollupRejection {
message_result_path: string[];
previous_message_result: TxRollupPreviousMessageResult;
previous_message_result_path: string[];
proof: TxRollupProof;
proof: TxRollupProof | string;
}

export interface OperationContentsTxRollupDispatchTickets {
Expand Down Expand Up @@ -509,12 +509,14 @@ export interface OperationContentsAndResultMetadataExtended {
delegate: string;
slots?: number[];
endorsement_power?: number;
consensus_key?: string;
}

export interface OperationContentsAndResultMetadataPreEndorsement {
balance_updates?: OperationMetadataBalanceUpdates[];
delegate: string;
preendorsement_power: number;
consensus_key?: string;
}

export interface OperationContentsAndResultMetadataReveal {
Expand Down Expand Up @@ -839,7 +841,7 @@ export interface OperationContentsAndResultTxRollupRejection {
message_result_path: string[];
previous_message_result: TxRollupPreviousMessageResult;
previous_message_result_path: string[];
proof: TxRollupProof;
proof: TxRollupProof | string;
metadata: OperationContentsAndResultMetadataTxRollupRejection;
}

Expand Down Expand Up @@ -970,20 +972,15 @@ export type BakingRightsArgumentsDelegate = string | string[];
export type BakingRightsArgumentsCycle = number | number[];
export type BakingRightsArgumentsLevel = number | number[];

export type BakingRightsQueryArguments =
| BakingRightsQueryArgumentsProto12
| BakingRightsQueryArgumentsBase;
export type BakingRightsQueryArguments = BakingRightsQueryArgumentsBase;

export interface BakingRightsQueryArgumentsProto12
extends Omit<BakingRightsQueryArgumentsBase, 'max_priority'> {
max_round?: string;
}
export interface BakingRightsQueryArgumentsBase {
level?: BakingRightsArgumentsLevel;
cycle?: BakingRightsArgumentsCycle;
delegate?: BakingRightsArgumentsDelegate;
consensus_key?: string;
max_priority?: number;
max_round?: string;
all?: null;
}

Expand Down Expand Up @@ -1340,9 +1337,9 @@ export interface TicketUpdates {
updates: {
account: string;
amount: string;
}[]
}[];
}
export type TicketReceipt = TicketUpdates
export type TicketReceipt = TicketUpdates;

export interface OperationResultTransaction {
status: OperationResultStatusEnum;
Expand Down Expand Up @@ -1584,8 +1581,24 @@ export interface ConstantsResponseCommon {

export type Ratio = { numerator: number; denominator: number };

export interface ConstantsResponseProto015 extends ConstantsResponseProto014 {
export interface ConstantsResponseProto015
extends Omit<
ConstantsResponseProto014,
| 'max_wrapped_proof_binary_size'
| 'tokens_per_roll'
| 'liquidity_baking_sunset_level'
| 'sc_rollup_max_available_messages'
> {
minimal_stake: BigNumber;
sc_max_wrapped_proof_binary_size: number;
sc_rollup_message_size_limit: number;
sc_rollup_max_number_of_messages_per_commitment_period: number;
sc_rollup_number_of_sections_in_dissection: number;
sc_rollup_timeout_period_in_blocks: number;
sc_rollup_max_number_of_cemented_commitments: number;
zk_rollup_enable: number;
zk_rollup_origination_size: number;
zk_rollup_min_pending_to_process: number;
}

export interface DalParametric {
Expand All @@ -1594,6 +1607,9 @@ export interface DalParametric {
number_of_shards: number;
endorsement_lag: number;
availability_threshold: number;
slot_size?: number;
redundancy_factor?: number;
page_size?: number;
}

export interface ConstantsResponseProto014 extends ConstantsResponseProto013 {
Expand Down Expand Up @@ -1721,7 +1737,7 @@ export interface ConstantsResponseProto003
max_proposals_per_delegate?: number;
}

export interface ConstantsResponseProto001And002 {
export interface ConstantsResponseProto001And002 extends ConstantsResponseCommon {
max_revelations_per_block?: number;
origination_burn?: string;
block_reward?: BigNumber;
Expand Down
Loading

0 comments on commit 8922de6

Please sign in to comment.