Skip to content

Commit

Permalink
Merge pull request #50 from dominant-strategies/locations-and-trie-ex…
Browse files Browse the repository at this point in the history
…pansion

Locations and trie expansion
  • Loading branch information
Denis2626 authored Mar 14, 2024
2 parents 8744106 + d50d4c2 commit d06edd1
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ output/**
**/*.swp
**/*.tgz
dist/*.gz
/*.env
/*.env
.idea/**
6 changes: 6 additions & 0 deletions lib.esm/providers/abstract-provider.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@ export type PerformActionRequest = {
} | {
method: "getTransactionResult";
hash: string;
} | {
method: "getRunningLocations";
} | {
method: "getProtocolTrieExpansionCount";
};
/**
* Options for configuring some internal aspects of an [[AbstractProvider]].
Expand Down Expand Up @@ -348,6 +352,8 @@ export declare class AbstractProvider implements Provider {
*/
_getTransactionRequest(_request: TransactionRequest): PerformActionTransaction | Promise<PerformActionTransaction>;
getNetwork(): Promise<Network>;
getRunningLocations(): Promise<number[][]>;
getProtocolTrieExpansionCount(): Promise<number>;
getFeeData(): Promise<FeeData>;
estimateGas(_tx: TransactionRequest): Promise<bigint>;
call(_tx: TransactionRequest): Promise<string>;
Expand Down
2 changes: 1 addition & 1 deletion lib.esm/providers/abstract-provider.d.ts.map

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions lib.esm/providers/abstract-provider.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib.esm/providers/abstract-provider.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib.esm/providers/provider-jsonrpc.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions lib.esm/providers/provider-jsonrpc.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib.esm/providers/provider-jsonrpc.js.map

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions src.ts/providers/abstract-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,10 @@ export type PerformActionRequest = {
} | {
method: "getTransactionResult",
hash: string
} | {
method: "getRunningLocations"
} | {
method: "getProtocolTrieExpansionCount"
};

type _PerformAccountRequest = {
Expand Down Expand Up @@ -901,6 +905,16 @@ export class AbstractProvider implements Provider {
return expected.clone();
}

async getRunningLocations(): Promise<number[][]> {
return await this.#perform({ method: "getRunningLocations" });


}

async getProtocolTrieExpansionCount(): Promise<number> {
return await this.#perform({ method: "getProtocolTrieExpansionCount" });
}

async getFeeData(): Promise<FeeData> {
const network = await this.getNetwork();
const getFeeDataFunc = async () => {
Expand Down
14 changes: 14 additions & 0 deletions src.ts/providers/provider-jsonrpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -919,6 +919,20 @@ export abstract class JsonRpcApiProvider extends AbstractProvider {
};
}

case "getRunningLocations": {
return {
method: "quai_listRunningChains",
args: []
}
}

case "getProtocolTrieExpansionCount": {
return {
method: "quai_getProtocolExpansionNumber",
args: []
}
}

case "getLogs":
if (req.filter && req.filter.address != null) {
if (Array.isArray(req.filter.address)) {
Expand Down

0 comments on commit d06edd1

Please sign in to comment.