Skip to content

Commit

Permalink
fix: types
Browse files Browse the repository at this point in the history
  • Loading branch information
janek26 committed Oct 29, 2021
1 parent 6032adb commit fe484ab
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
12 changes: 9 additions & 3 deletions __tests__/starknet.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ const compiledArgentAccount = parse(

describe('starknet endpoints', () => {
describe('feeder gateway endpoints', () => {
test('getContractAddresses()', () => {
return expect(getContractAddresses()).resolves.not.toThrow();
test('getContractAddresses()', async () => {
const { GpsStatementVerifier, Starknet } = await getContractAddresses();
expect(typeof GpsStatementVerifier).toBe('string');
expect(typeof Starknet).toBe('string');
});
test('getBlock()', () => {
return expect(getBlock(870)).resolves.not.toThrow();
Expand Down Expand Up @@ -61,7 +63,11 @@ describe('starknet endpoints', () => {
getTransactionStatus('0x2086ff26645fb0e31a3e252302f3cb1e7612c60389102e5473dfc89758a3aa9')
).resolves.not.toThrow();
});
test('getTransaction()', () => {
test('getTransaction()', async () => {
const x = await getTransaction(
'0x2086ff26645fb0e31a3e252302f3cb1e7612c60389102e5473dfc89758a3aa9'
);
console.log(x);
return expect(
getTransaction('0x2086ff26645fb0e31a3e252302f3cb1e7612c60389102e5473dfc89758a3aa9')
).resolves.not.toThrow();
Expand Down
12 changes: 6 additions & 6 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ export type GetBlockResponse = {
state_root: string;
block_id: number;
transactions: {
[txid: string]: Transaction;
[txHash: string]: Transaction;
};
timestamp: number;
transaction_receipts: {
[txid: string]: {
[txHash: string]: {
block_id: number;
transaction_id: number;
transaction_hash: string;
l2_to_l1_messages: {
to_address: string;
payload: string[];
Expand All @@ -90,12 +90,12 @@ export type GetTransactionStatusResponse = {
};

export type GetTransactionResponse = {
transaction_index: number;
status: Status;
transaction: Transaction;
block_id: number;
block_number: number;
status: Status;
transaction_id: number;
transaction_index: number;
transaction_hash: string;
};

export type AddTransactionResponse = {
Expand Down

0 comments on commit fe484ab

Please sign in to comment.