stargate: Refactor registry initialisation in SigningStargateClient
This commit is contained in:
parent
4270e325b5
commit
027f76ce74
@ -40,6 +40,17 @@ const { TxRaw } = cosmos.tx.v1beta1;
|
||||
const defaultGasPrice = GasPrice.fromString("0.025ucosm");
|
||||
const defaultGasLimits: GasLimits<CosmosFeeTable> = { send: 80000 };
|
||||
|
||||
function createDefaultRegistry(): Registry {
|
||||
return new Registry([
|
||||
["/cosmos.bank.v1beta1.MsgMultiSend", MsgMultiSend],
|
||||
["/cosmos.staking.v1beta1.MsgBeginRedelegate", MsgBeginRedelegate],
|
||||
["/cosmos.staking.v1beta1.MsgCreateValidator", MsgCreateValidator],
|
||||
["/cosmos.staking.v1beta1.MsgDelegate", MsgDelegate],
|
||||
["/cosmos.staking.v1beta1.MsgEditValidator", MsgEditValidator],
|
||||
["/cosmos.staking.v1beta1.MsgUndelegate", MsgUndelegate],
|
||||
]);
|
||||
}
|
||||
|
||||
/** Use for testing only */
|
||||
export interface PrivateSigningStargateClient {
|
||||
readonly fees: CosmosFeeTable;
|
||||
@ -76,14 +87,7 @@ export class SigningStargateClient extends StargateClient {
|
||||
) {
|
||||
super(tmClient);
|
||||
const {
|
||||
registry = new Registry([
|
||||
["/cosmos.bank.v1beta1.MsgMultiSend", MsgMultiSend],
|
||||
["/cosmos.staking.v1beta1.MsgBeginRedelegate", MsgBeginRedelegate],
|
||||
["/cosmos.staking.v1beta1.MsgCreateValidator", MsgCreateValidator],
|
||||
["/cosmos.staking.v1beta1.MsgDelegate", MsgDelegate],
|
||||
["/cosmos.staking.v1beta1.MsgEditValidator", MsgEditValidator],
|
||||
["/cosmos.staking.v1beta1.MsgUndelegate", MsgUndelegate],
|
||||
]),
|
||||
registry = createDefaultRegistry(),
|
||||
aminoTypes = new AminoTypes({ prefix: options.prefix }),
|
||||
gasPrice = defaultGasPrice,
|
||||
gasLimits = defaultGasLimits,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user