File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @terran-one/cosmwasm-vm-js" ,
3
- "version" : " 0.2.14 " ,
3
+ "version" : " 0.2.15 " ,
4
4
"license" : " MIT" ,
5
5
"author" : " TerranOne" ,
6
6
"main" : " dist/index.js" ,
Original file line number Diff line number Diff line change @@ -2,8 +2,10 @@ export interface IQuerier {
2
2
query_raw ( request : Uint8Array , gas_limit : number /* Uint64 */ ) : Uint8Array ;
3
3
}
4
4
5
- export class BasicQuerier implements IQuerier {
6
-
5
+ /** Basic implementation of `IQuerier` with standardized `query_raw`
6
+ * which delegates to a new, abstract `handleQuery` method.
7
+ */
8
+ export abstract class QuerierBase implements IQuerier {
7
9
// eslint-disable-next-line @typescript-eslint/no-unused-vars
8
10
query_raw ( request : Uint8Array , gas_limit : number ) : Uint8Array {
9
11
const queryRequest = parseQuery ( request ) ;
@@ -13,7 +15,13 @@ export class BasicQuerier implements IQuerier {
13
15
14
16
return objectToUint8Array ( { ok : { ok : objectToBase64 ( this . handleQuery ( queryRequest ) ) } } ) ;
15
17
}
18
+
19
+ /** Handle a specific JSON query message. */
20
+ abstract handleQuery ( queryRequest : any ) : any ;
21
+ }
16
22
23
+ /** Basic implementation which does not actually implement `handleQuery`. Intended for testing. */
24
+ export class BasicQuerier extends QuerierBase {
17
25
handleQuery ( queryRequest : any ) : any {
18
26
throw new Error ( `Unimplemented - subclass BasicQuerier and provide handleQuery() implementation.` )
19
27
}
You can’t perform that action at this time.
0 commit comments