Skip to content

Commit 57a8709

Browse files
committed
chore: rectify intersection types
1 parent e66caf2 commit 57a8709

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

src/types/api/rpcspec_0_6/components.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,9 @@ export type BLOCK_BODY_WITH_TX_HASHES = {
151151
};
152152

153153
export type BLOCK_BODY_WITH_TXS = {
154-
transactions: {
155-
transaction: TXN;
154+
transactions: (TXN & {
156155
transaction_hash: TXN_HASH;
157-
}[];
156+
})[];
158157
};
159158

160159
export type BLOCK_HEADER = {
@@ -648,8 +647,7 @@ export type L1_HANDLER_TXN_TRACE = {
648647
export type NESTED_CALL = FUNCTION_INVOCATION;
649648

650649
// Represents a function invocation along with its execution details.
651-
export type FUNCTION_INVOCATION = {
652-
function_call: FUNCTION_CALL;
650+
export type FUNCTION_INVOCATION = FUNCTION_CALL & {
653651
caller_address: string;
654652
class_hash: string;
655653
entry_point_type: ENTRY_POINT_TYPE;

src/types/api/rpcspec_0_7/components.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,9 @@ export type BLOCK_BODY_WITH_TX_HASHES = {
151151
};
152152

153153
export type BLOCK_BODY_WITH_TXS = {
154-
transactions: {
155-
transaction: TXN; // TODO: double check if intersection
154+
transactions: (TXN & {
156155
transaction_hash: TXN_HASH;
157-
}[];
156+
})[];
158157
};
159158

160159
export type BLOCK_BODY_WITH_RECEIPTS = {
@@ -678,8 +677,7 @@ export type L1_HANDLER_TXN_TRACE = {
678677
export type NESTED_CALL = FUNCTION_INVOCATION;
679678

680679
// Represents a function invocation along with its execution details.
681-
export type FUNCTION_INVOCATION = {
682-
function_call: FUNCTION_CALL; // TODO: double check if this should be an intersection
680+
export type FUNCTION_INVOCATION = FUNCTION_CALL & {
683681
caller_address: string;
684682
class_hash: string;
685683
entry_point_type: ENTRY_POINT_TYPE;

0 commit comments

Comments
 (0)