mirror of
https://github.com/cosmos/cosmjs.git
synced 2025-03-11 14:09:15 +00:00
PR fixes.
This commit is contained in:
parent
6e98cbb6cf
commit
0a27b16d3c
@ -162,17 +162,6 @@ function createDeliverTxResponseErrorMessage(result: DeliverTxResponse): string
|
|||||||
return `Error when broadcasting tx ${result.transactionHash} at height ${result.height}. Code: ${result.code}; Raw log: ${result.rawLog}`;
|
return `Error when broadcasting tx ${result.transactionHash} at height ${result.height}. Code: ${result.code}; Raw log: ${result.rawLog}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function createDefaultRegistry(): Registry {
|
|
||||||
return new Registry([...defaultStargateTypes, ...wasmTypes]);
|
|
||||||
}
|
|
||||||
|
|
||||||
function createDefaultAminoTypes(): AminoTypes {
|
|
||||||
return new AminoTypes({
|
|
||||||
...createDefaultAminoConverters(),
|
|
||||||
...createWasmAminoConverters(),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface SigningCosmWasmClientOptions {
|
export interface SigningCosmWasmClientOptions {
|
||||||
readonly registry?: Registry;
|
readonly registry?: Registry;
|
||||||
readonly aminoTypes?: AminoTypes;
|
readonly aminoTypes?: AminoTypes;
|
||||||
@ -240,8 +229,14 @@ export class SigningCosmWasmClient extends CosmWasmClient {
|
|||||||
) {
|
) {
|
||||||
super(tmClient);
|
super(tmClient);
|
||||||
const {
|
const {
|
||||||
registry = createDefaultRegistry(),
|
registry = new Registry([
|
||||||
aminoTypes = createDefaultAminoTypes(),
|
...defaultStargateTypes,
|
||||||
|
...wasmTypes
|
||||||
|
]),
|
||||||
|
aminoTypes = new AminoTypes({
|
||||||
|
...createDefaultAminoConverters(),
|
||||||
|
...createWasmAminoConverters(),
|
||||||
|
}),
|
||||||
} = options;
|
} = options;
|
||||||
this.registry = registry;
|
this.registry = registry;
|
||||||
this.aminoTypes = aminoTypes;
|
this.aminoTypes = aminoTypes;
|
||||||
|
@ -123,6 +123,7 @@ export {
|
|||||||
SearchTxQuery,
|
SearchTxQuery,
|
||||||
} from "./search";
|
} from "./search";
|
||||||
export {
|
export {
|
||||||
|
createDefaultAminoConverters,
|
||||||
defaultRegistryTypes,
|
defaultRegistryTypes,
|
||||||
SignerData,
|
SignerData,
|
||||||
SigningStargateClient,
|
SigningStargateClient,
|
||||||
|
@ -64,10 +64,6 @@ export const defaultRegistryTypes: ReadonlyArray<[string, GeneratedType]> = [
|
|||||||
...vestingTypes,
|
...vestingTypes,
|
||||||
];
|
];
|
||||||
|
|
||||||
function createDefaultRegistry(): Registry {
|
|
||||||
return new Registry(defaultRegistryTypes);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Signing information for a single signer that is not included in the transaction.
|
* Signing information for a single signer that is not included in the transaction.
|
||||||
*
|
*
|
||||||
@ -105,10 +101,6 @@ export function createDefaultAminoConverters(): AminoConverters {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function createDefaultAminoTypes(): AminoTypes {
|
|
||||||
return new AminoTypes(createDefaultAminoConverters())
|
|
||||||
}
|
|
||||||
|
|
||||||
export class SigningStargateClient extends StargateClient {
|
export class SigningStargateClient extends StargateClient {
|
||||||
public readonly registry: Registry;
|
public readonly registry: Registry;
|
||||||
public readonly broadcastTimeoutMs: number | undefined;
|
public readonly broadcastTimeoutMs: number | undefined;
|
||||||
@ -168,8 +160,8 @@ export class SigningStargateClient extends StargateClient {
|
|||||||
) {
|
) {
|
||||||
super(tmClient, options);
|
super(tmClient, options);
|
||||||
const {
|
const {
|
||||||
registry = createDefaultRegistry(),
|
registry = new Registry(defaultRegistryTypes),
|
||||||
aminoTypes = createDefaultAminoTypes()
|
aminoTypes = new AminoTypes(createDefaultAminoConverters())
|
||||||
} = options;
|
} = options;
|
||||||
this.registry = registry;
|
this.registry = registry;
|
||||||
this.aminoTypes = aminoTypes;
|
this.aminoTypes = aminoTypes;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user