mirror of
https://github.com/cosmos/cosmjs.git
synced 2025-03-10 21:49:15 +00:00
Beautify code
This commit is contained in:
parent
aa1dd9ab8d
commit
0596e4a4f1
@ -29,7 +29,7 @@ describe("AminoTypes", () => {
|
||||
wasmByteCode: fromBase64("WUVMTE9XIFNVQk1BUklORQ=="),
|
||||
instantiatePermission: undefined,
|
||||
};
|
||||
const aminoMsg = new AminoTypes({ ...createWasmAminoConverters() }).toAmino({
|
||||
const aminoMsg = new AminoTypes(createWasmAminoConverters()).toAmino({
|
||||
typeUrl: "/cosmwasm.wasm.v1.MsgStoreCode",
|
||||
value: msg,
|
||||
});
|
||||
@ -54,7 +54,7 @@ describe("AminoTypes", () => {
|
||||
funds: coins(1234, "ucosm"),
|
||||
admin: "cosmos10dyr9899g6t0pelew4nvf4j5c3jcgv0r73qga5",
|
||||
};
|
||||
const aminoMsg = new AminoTypes({ ...createWasmAminoConverters() }).toAmino({
|
||||
const aminoMsg = new AminoTypes(createWasmAminoConverters()).toAmino({
|
||||
typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract",
|
||||
value: msg,
|
||||
});
|
||||
@ -82,7 +82,7 @@ describe("AminoTypes", () => {
|
||||
funds: coins(1234, "ucosm"),
|
||||
admin: "",
|
||||
};
|
||||
const aminoMsg = new AminoTypes({ ...createWasmAminoConverters() }).toAmino({
|
||||
const aminoMsg = new AminoTypes(createWasmAminoConverters()).toAmino({
|
||||
typeUrl: "/cosmwasm.wasm.v1.MsgInstantiateContract",
|
||||
value: msg,
|
||||
});
|
||||
@ -107,7 +107,7 @@ describe("AminoTypes", () => {
|
||||
newAdmin: "cosmos10dyr9899g6t0pelew4nvf4j5c3jcgv0r73qga5",
|
||||
contract: "cosmos1xy4yqngt0nlkdcenxymg8tenrghmek4nmqm28k",
|
||||
};
|
||||
const aminoMsg = new AminoTypes({ ...createWasmAminoConverters() }).toAmino({
|
||||
const aminoMsg = new AminoTypes(createWasmAminoConverters()).toAmino({
|
||||
typeUrl: "/cosmwasm.wasm.v1.MsgUpdateAdmin",
|
||||
value: msg,
|
||||
});
|
||||
@ -127,7 +127,7 @@ describe("AminoTypes", () => {
|
||||
sender: "cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6",
|
||||
contract: "cosmos1xy4yqngt0nlkdcenxymg8tenrghmek4nmqm28k",
|
||||
};
|
||||
const aminoMsg = new AminoTypes({ ...createWasmAminoConverters() }).toAmino({
|
||||
const aminoMsg = new AminoTypes(createWasmAminoConverters()).toAmino({
|
||||
typeUrl: "/cosmwasm.wasm.v1.MsgClearAdmin",
|
||||
value: msg,
|
||||
});
|
||||
@ -148,7 +148,7 @@ describe("AminoTypes", () => {
|
||||
msg: toUtf8(`{"foo":"bar"}`),
|
||||
funds: coins(1234, "ucosm"),
|
||||
};
|
||||
const aminoMsg = new AminoTypes({ ...createWasmAminoConverters() }).toAmino({
|
||||
const aminoMsg = new AminoTypes(createWasmAminoConverters()).toAmino({
|
||||
typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract",
|
||||
value: msg,
|
||||
});
|
||||
@ -171,7 +171,7 @@ describe("AminoTypes", () => {
|
||||
codeId: Long.fromString("98765"),
|
||||
msg: toUtf8(`{"foo":"bar"}`),
|
||||
};
|
||||
const aminoMsg = new AminoTypes({ ...createWasmAminoConverters() }).toAmino({
|
||||
const aminoMsg = new AminoTypes(createWasmAminoConverters()).toAmino({
|
||||
typeUrl: "/cosmwasm.wasm.v1.MsgMigrateContract",
|
||||
value: msg,
|
||||
});
|
||||
@ -197,7 +197,7 @@ describe("AminoTypes", () => {
|
||||
wasm_byte_code: "WUVMTE9XIFNVQk1BUklORQ==",
|
||||
},
|
||||
};
|
||||
const msg = new AminoTypes({ ...createWasmAminoConverters() }).fromAmino(aminoMsg);
|
||||
const msg = new AminoTypes(createWasmAminoConverters()).fromAmino(aminoMsg);
|
||||
const expectedValue: MsgStoreCode = {
|
||||
sender: "cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6",
|
||||
wasmByteCode: fromBase64("WUVMTE9XIFNVQk1BUklORQ=="),
|
||||
@ -223,7 +223,7 @@ describe("AminoTypes", () => {
|
||||
admin: "cosmos10dyr9899g6t0pelew4nvf4j5c3jcgv0r73qga5",
|
||||
},
|
||||
};
|
||||
const msg = new AminoTypes({ ...createWasmAminoConverters() }).fromAmino(aminoMsg);
|
||||
const msg = new AminoTypes(createWasmAminoConverters()).fromAmino(aminoMsg);
|
||||
const expectedValue: MsgInstantiateContract = {
|
||||
sender: "cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6",
|
||||
codeId: Long.fromString("12345"),
|
||||
@ -250,7 +250,7 @@ describe("AminoTypes", () => {
|
||||
funds: coins(1234, "ucosm"),
|
||||
},
|
||||
};
|
||||
const msg = new AminoTypes({ ...createWasmAminoConverters() }).fromAmino(aminoMsg);
|
||||
const msg = new AminoTypes(createWasmAminoConverters()).fromAmino(aminoMsg);
|
||||
const expectedValue: MsgInstantiateContract = {
|
||||
sender: "cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6",
|
||||
codeId: Long.fromString("12345"),
|
||||
@ -275,7 +275,7 @@ describe("AminoTypes", () => {
|
||||
contract: "cosmos1xy4yqngt0nlkdcenxymg8tenrghmek4nmqm28k",
|
||||
},
|
||||
};
|
||||
const msg = new AminoTypes({ ...createWasmAminoConverters() }).fromAmino(aminoMsg);
|
||||
const msg = new AminoTypes(createWasmAminoConverters()).fromAmino(aminoMsg);
|
||||
const expectedValue: MsgUpdateAdmin = {
|
||||
sender: "cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6",
|
||||
newAdmin: "cosmos10dyr9899g6t0pelew4nvf4j5c3jcgv0r73qga5",
|
||||
@ -295,7 +295,7 @@ describe("AminoTypes", () => {
|
||||
contract: "cosmos1xy4yqngt0nlkdcenxymg8tenrghmek4nmqm28k",
|
||||
},
|
||||
};
|
||||
const msg = new AminoTypes({ ...createWasmAminoConverters() }).fromAmino(aminoMsg);
|
||||
const msg = new AminoTypes(createWasmAminoConverters()).fromAmino(aminoMsg);
|
||||
const expectedValue: MsgClearAdmin = {
|
||||
sender: "cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6",
|
||||
contract: "cosmos1xy4yqngt0nlkdcenxymg8tenrghmek4nmqm28k",
|
||||
@ -316,7 +316,7 @@ describe("AminoTypes", () => {
|
||||
funds: coins(1234, "ucosm"),
|
||||
},
|
||||
};
|
||||
const msg = new AminoTypes({ ...createWasmAminoConverters() }).fromAmino(aminoMsg);
|
||||
const msg = new AminoTypes(createWasmAminoConverters()).fromAmino(aminoMsg);
|
||||
const expectedValue: MsgExecuteContract = {
|
||||
sender: "cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6",
|
||||
contract: "cosmos1xy4yqngt0nlkdcenxymg8tenrghmek4nmqm28k",
|
||||
@ -339,7 +339,7 @@ describe("AminoTypes", () => {
|
||||
msg: { foo: "bar" },
|
||||
},
|
||||
};
|
||||
const msg = new AminoTypes({ ...createWasmAminoConverters() }).fromAmino(aminoMsg);
|
||||
const msg = new AminoTypes(createWasmAminoConverters()).fromAmino(aminoMsg);
|
||||
const expectedValue: MsgMigrateContract = {
|
||||
sender: "cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6",
|
||||
contract: "cosmos1xy4yqngt0nlkdcenxymg8tenrghmek4nmqm28k",
|
||||
|
@ -130,7 +130,7 @@ describe("AminoTypes", () => {
|
||||
|
||||
it("throws for unknown type url", () => {
|
||||
expect(() =>
|
||||
new AminoTypes({ ...createBankAminoConverters() }).toAmino({
|
||||
new AminoTypes(createBankAminoConverters()).toAmino({
|
||||
typeUrl: "/xxx.Unknown",
|
||||
value: { foo: "bar" },
|
||||
}),
|
||||
@ -205,7 +205,7 @@ describe("AminoTypes", () => {
|
||||
|
||||
it("throws for unknown type url", () => {
|
||||
expect(() =>
|
||||
new AminoTypes({ ...createBankAminoConverters() }).fromAmino({
|
||||
new AminoTypes(createBankAminoConverters()).fromAmino({
|
||||
type: "cosmos-sdk/MsgUnknown",
|
||||
value: { foo: "bar" },
|
||||
}),
|
||||
|
Loading…
x
Reference in New Issue
Block a user