Skip to content

Commit f1dbbd2

Browse files
committed
Bump dependencies, fix code accordingly
1 parent eecf5e1 commit f1dbbd2

File tree

4 files changed

+172
-147
lines changed

4 files changed

+172
-147
lines changed

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,20 @@
4040
"postdefine-proto": "prettier --write \"src/codec/**/*.ts\""
4141
},
4242
"dependencies": {
43-
"@cosmjs/amino": "0.30.1",
44-
"@cosmjs/crypto": "0.30.1",
45-
"@cosmjs/encoding": "0.30.1",
46-
"@cosmjs/json-rpc": "^0.30.1",
47-
"@cosmjs/math": "0.30.1",
48-
"@cosmjs/proto-signing": "0.30.1",
49-
"@cosmjs/stargate": "0.30.1",
50-
"@cosmjs/tendermint-rpc": "0.30.1",
51-
"@cosmjs/utils": "0.30.1",
52-
"@ledgerhq/hw-app-cosmos": "^6.28.1",
53-
"@ledgerhq/hw-transport": "^6.28.4",
43+
"@cosmjs/amino": "0.31.0",
44+
"@cosmjs/crypto": "0.31.0",
45+
"@cosmjs/encoding": "0.31.0",
46+
"@cosmjs/json-rpc": "^0.31.0",
47+
"@cosmjs/math": "0.31.0",
48+
"@cosmjs/proto-signing": "0.31.0",
49+
"@cosmjs/stargate": "0.31.0",
50+
"@cosmjs/tendermint-rpc": "0.31.0",
51+
"@cosmjs/utils": "0.31.0",
52+
"@ledgerhq/hw-app-cosmos": "^6.28.2",
53+
"@ledgerhq/hw-transport": "^6.28.5",
5454
"@types/crypto-js": "^4.1.1",
5555
"@types/ledgerhq__hw-transport": "^4.21.4",
56-
"@types/uuid": "^9.0.0",
56+
"@types/uuid": "^9.0.2",
5757
"crypto-browserify": "^3.12.0",
5858
"crypto-js": "^4.1.1",
5959
"long": "^4.0.0",

src/extensions/ibc.ts

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -426,36 +426,36 @@ export function setupIbcExtension(base: QueryClient): IbcExtension {
426426
},
427427
verified: {
428428
channel: {
429-
channel: async (portId: string, channelId: string) => {
430-
// keeper: https://github.com/cosmos/cosmos-sdk/blob/3bafd8255a502e5a9cee07391cf8261538245dfd/x/ibc/04-channel/keeper/keeper.go#L55-L65
431-
// key: https://github.com/cosmos/cosmos-sdk/blob/ef0a7344af345882729598bc2958a21143930a6b/x/ibc/24-host/keys.go#L117-L120
432-
const key = toAscii(`channelEnds/ports/${portId}/channels/${channelId}`);
433-
const responseData = await base.queryVerified('ibc', key);
434-
return responseData.length ? Channel.decode(responseData) : null;
435-
},
436-
packetCommitment: async (portId: string, channelId: string, sequence: number) => {
437-
// keeper: https://github.com/cosmos/cosmos-sdk/blob/3bafd8255a502e5a9cee07391cf8261538245dfd/x/ibc/04-channel/keeper/keeper.go#L128-L133
438-
// key: https://github.com/cosmos/cosmos-sdk/blob/ef0a7344af345882729598bc2958a21143930a6b/x/ibc/24-host/keys.go#L183-L185
439-
const key = toAscii(`commitments/ports/${portId}/channels/${channelId}/packets/${sequence}`);
440-
const responseData = await base.queryVerified('ibc', key);
441-
// keeper code doesn't parse, but returns raw
442-
return responseData;
443-
},
444-
packetAcknowledgement: async (portId: string, channelId: string, sequence: number) => {
445-
// keeper: https://github.com/cosmos/cosmos-sdk/blob/3bafd8255a502e5a9cee07391cf8261538245dfd/x/ibc/04-channel/keeper/keeper.go#L159-L166
446-
// key: https://github.com/cosmos/cosmos-sdk/blob/ef0a7344af345882729598bc2958a21143930a6b/x/ibc/24-host/keys.go#L153-L156
447-
const key = toAscii(`acks/ports/${portId}/channels/${channelId}/acknowledgements/${sequence}`);
448-
const responseData = await base.queryVerified('ibc', key);
449-
// keeper code doesn't parse, but returns raw
450-
return responseData;
451-
},
452-
nextSequenceReceive: async (portId: string, channelId: string) => {
453-
// keeper: https://github.com/cosmos/cosmos-sdk/blob/3bafd8255a502e5a9cee07391cf8261538245dfd/x/ibc/04-channel/keeper/keeper.go#L92-L101
454-
// key: https://github.com/cosmos/cosmos-sdk/blob/ef0a7344af345882729598bc2958a21143930a6b/x/ibc/24-host/keys.go#L133-L136
455-
const key = toAscii(`seqAcks/ports/${portId}/channels/${channelId}/nextSequenceAck`);
456-
const responseData = await base.queryVerified('ibc', key);
457-
return responseData.length ? Uint64.fromBytes(responseData).toNumber() : null;
458-
},
429+
channel: async (portId: string, channelId: string) => {
430+
// keeper: https://github.com/cosmos/cosmos-sdk/blob/3bafd8255a502e5a9cee07391cf8261538245dfd/x/ibc/04-channel/keeper/keeper.go#L55-L65
431+
// key: https://github.com/cosmos/cosmos-sdk/blob/ef0a7344af345882729598bc2958a21143930a6b/x/ibc/24-host/keys.go#L117-L120
432+
const key = toAscii(`channelEnds/ports/${portId}/channels/${channelId}`);
433+
const { value } = await base.queryStoreVerified("ibc", key);
434+
return value.length ? Channel.decode(value) : null;
435+
},
436+
packetCommitment: async (portId: string, channelId: string, sequence: number) => {
437+
// keeper: https://github.com/cosmos/cosmos-sdk/blob/3bafd8255a502e5a9cee07391cf8261538245dfd/x/ibc/04-channel/keeper/keeper.go#L128-L133
438+
// key: https://github.com/cosmos/cosmos-sdk/blob/ef0a7344af345882729598bc2958a21143930a6b/x/ibc/24-host/keys.go#L183-L185
439+
const key = toAscii(`commitments/ports/${portId}/channels/${channelId}/packets/${sequence}`);
440+
const { value } = await base.queryStoreVerified("ibc", key);
441+
// keeper code doesn't parse, but returns raw
442+
return value;
443+
},
444+
packetAcknowledgement: async (portId: string, channelId: string, sequence: number) => {
445+
// keeper: https://github.com/cosmos/cosmos-sdk/blob/3bafd8255a502e5a9cee07391cf8261538245dfd/x/ibc/04-channel/keeper/keeper.go#L159-L166
446+
// key: https://github.com/cosmos/cosmos-sdk/blob/ef0a7344af345882729598bc2958a21143930a6b/x/ibc/24-host/keys.go#L153-L156
447+
const key = toAscii(`acks/ports/${portId}/channels/${channelId}/acknowledgements/${sequence}`);
448+
const { value } = await base.queryStoreVerified("ibc", key);
449+
// keeper code doesn't parse, but returns raw
450+
return value;
451+
},
452+
nextSequenceReceive: async (portId: string, channelId: string) => {
453+
// keeper: https://github.com/cosmos/cosmos-sdk/blob/3bafd8255a502e5a9cee07391cf8261538245dfd/x/ibc/04-channel/keeper/keeper.go#L92-L101
454+
// key: https://github.com/cosmos/cosmos-sdk/blob/ef0a7344af345882729598bc2958a21143930a6b/x/ibc/24-host/keys.go#L133-L136
455+
const key = toAscii(`seqAcks/ports/${portId}/channels/${channelId}/nextSequenceAck`);
456+
const { value } = await base.queryStoreVerified("ibc", key);
457+
return value.length ? Uint64.fromBytes(value).toNumber() : null;
458+
},
459459
},
460460
},
461461
},

src/extensions/utils.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ export interface ProtobufRpcClient {
1010

1111
export function createProtobufRpcClient(base: QueryClient): ProtobufRpcClient {
1212
return {
13-
request: (service: string, method: string, data: Uint8Array): Promise<Uint8Array> => {
13+
request: async (service: string, method: string, data: Uint8Array): Promise<Uint8Array> => {
1414
const path = `/${service}/${method}`;
15-
return base.queryUnverified(path, data);
16-
},
15+
const response = await base.queryAbci(path, data, undefined);
16+
return response.value;
17+
},
1718
};
1819
}
1920

0 commit comments

Comments
 (0)