Merge pull request #509 from cosmos/494-codec-rc2

Update codecs to v0.40.0-rc2
This commit is contained in:
Will Clark 2020-11-04 13:05:24 +01:00 committed by GitHub
commit 8fa28b2d0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 4740 additions and 4530 deletions

View File

@ -42,7 +42,7 @@
"coverage": "nyc --reporter=text --reporter=lcov yarn test --quiet",
"pack-web": "yarn build-or-skip && webpack --mode development --config webpack.web.config.js",
"preget-proto": "rm -rf proto",
"get-proto": "REF=v0.40.0-rc0 ./scripts/get-proto.sh",
"get-proto": "REF=v0.40.0-rc2 ./scripts/get-proto.sh",
"predefine-proto": "./scripts/predefine-proto.sh",
"define-proto": "./scripts/define-proto.sh",
"postdefine-proto": "prettier --write \"src/codec/generated/codecimpl.*\""

View File

@ -360,6 +360,85 @@ export namespace cosmos {
public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.bank.v1beta1.Metadata;
}
/** Represents a Msg */
class Msg extends $protobuf.rpc.Service {
/**
* Constructs a new Msg service.
* @param rpcImpl RPC implementation
* @param [requestDelimited=false] Whether requests are length-delimited
* @param [responseDelimited=false] Whether responses are length-delimited
*/
constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean);
/**
* Creates new Msg service using the specified rpc implementation.
* @param rpcImpl RPC implementation
* @param [requestDelimited=false] Whether requests are length-delimited
* @param [responseDelimited=false] Whether responses are length-delimited
* @returns RPC service. Useful where requests and/or responses are streamed.
*/
public static create(
rpcImpl: $protobuf.RPCImpl,
requestDelimited?: boolean,
responseDelimited?: boolean,
): Msg;
/**
* Calls Send.
* @param request MsgSend message or plain object
* @param callback Node-style callback called with the error, if any, and MsgSendResponse
*/
public send(
request: cosmos.bank.v1beta1.IMsgSend,
callback: cosmos.bank.v1beta1.Msg.SendCallback,
): void;
/**
* Calls Send.
* @param request MsgSend message or plain object
* @returns Promise
*/
public send(request: cosmos.bank.v1beta1.IMsgSend): Promise<cosmos.bank.v1beta1.MsgSendResponse>;
/**
* Calls MultiSend.
* @param request MsgMultiSend message or plain object
* @param callback Node-style callback called with the error, if any, and MsgMultiSendResponse
*/
public multiSend(
request: cosmos.bank.v1beta1.IMsgMultiSend,
callback: cosmos.bank.v1beta1.Msg.MultiSendCallback,
): void;
/**
* Calls MultiSend.
* @param request MsgMultiSend message or plain object
* @returns Promise
*/
public multiSend(
request: cosmos.bank.v1beta1.IMsgMultiSend,
): Promise<cosmos.bank.v1beta1.MsgMultiSendResponse>;
}
namespace Msg {
/**
* Callback as used by {@link cosmos.bank.v1beta1.Msg#send}.
* @param error Error, if any
* @param [response] MsgSendResponse
*/
type SendCallback = (error: Error | null, response?: cosmos.bank.v1beta1.MsgSendResponse) => void;
/**
* Callback as used by {@link cosmos.bank.v1beta1.Msg#multiSend}.
* @param error Error, if any
* @param [response] MsgMultiSendResponse
*/
type MultiSendCallback = (
error: Error | null,
response?: cosmos.bank.v1beta1.MsgMultiSendResponse,
) => void;
}
/** Properties of a MsgSend. */
interface IMsgSend {
/** MsgSend fromAddress */
@ -415,6 +494,48 @@ export namespace cosmos {
public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.bank.v1beta1.MsgSend;
}
/** Properties of a MsgSendResponse. */
interface IMsgSendResponse {}
/** Represents a MsgSendResponse. */
class MsgSendResponse implements IMsgSendResponse {
/**
* Constructs a new MsgSendResponse.
* @param [p] Properties to set
*/
constructor(p?: cosmos.bank.v1beta1.IMsgSendResponse);
/**
* Creates a new MsgSendResponse instance using the specified properties.
* @param [properties] Properties to set
* @returns MsgSendResponse instance
*/
public static create(
properties?: cosmos.bank.v1beta1.IMsgSendResponse,
): cosmos.bank.v1beta1.MsgSendResponse;
/**
* Encodes the specified MsgSendResponse message. Does not implicitly {@link cosmos.bank.v1beta1.MsgSendResponse.verify|verify} messages.
* @param m MsgSendResponse message or plain object to encode
* @param [w] Writer to encode to
* @returns Writer
*/
public static encode(m: cosmos.bank.v1beta1.IMsgSendResponse, w?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes a MsgSendResponse message from the specified reader or buffer.
* @param r Reader or buffer to decode from
* @param [l] Message length if known beforehand
* @returns MsgSendResponse
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(
r: $protobuf.Reader | Uint8Array,
l?: number,
): cosmos.bank.v1beta1.MsgSendResponse;
}
/** Properties of a MsgMultiSend. */
interface IMsgMultiSend {
/** MsgMultiSend inputs */
@ -465,6 +586,51 @@ export namespace cosmos {
*/
public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.bank.v1beta1.MsgMultiSend;
}
/** Properties of a MsgMultiSendResponse. */
interface IMsgMultiSendResponse {}
/** Represents a MsgMultiSendResponse. */
class MsgMultiSendResponse implements IMsgMultiSendResponse {
/**
* Constructs a new MsgMultiSendResponse.
* @param [p] Properties to set
*/
constructor(p?: cosmos.bank.v1beta1.IMsgMultiSendResponse);
/**
* Creates a new MsgMultiSendResponse instance using the specified properties.
* @param [properties] Properties to set
* @returns MsgMultiSendResponse instance
*/
public static create(
properties?: cosmos.bank.v1beta1.IMsgMultiSendResponse,
): cosmos.bank.v1beta1.MsgMultiSendResponse;
/**
* Encodes the specified MsgMultiSendResponse message. Does not implicitly {@link cosmos.bank.v1beta1.MsgMultiSendResponse.verify|verify} messages.
* @param m MsgMultiSendResponse message or plain object to encode
* @param [w] Writer to encode to
* @returns Writer
*/
public static encode(
m: cosmos.bank.v1beta1.IMsgMultiSendResponse,
w?: $protobuf.Writer,
): $protobuf.Writer;
/**
* Decodes a MsgMultiSendResponse message from the specified reader or buffer.
* @param r Reader or buffer to decode from
* @param [l] Message length if known beforehand
* @returns MsgMultiSendResponse
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(
r: $protobuf.Reader | Uint8Array,
l?: number,
): cosmos.bank.v1beta1.MsgMultiSendResponse;
}
}
}

View File

@ -327,6 +327,42 @@ exports.cosmos = $root.cosmos = (() => {
};
return Metadata;
})();
v1beta1.Msg = (function () {
function Msg(rpcImpl, requestDelimited, responseDelimited) {
$protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);
}
(Msg.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Msg;
Msg.create = function create(rpcImpl, requestDelimited, responseDelimited) {
return new this(rpcImpl, requestDelimited, responseDelimited);
};
Object.defineProperty(
(Msg.prototype.send = function send(request, callback) {
return this.rpcCall(
send,
$root.cosmos.bank.v1beta1.MsgSend,
$root.cosmos.bank.v1beta1.MsgSendResponse,
request,
callback,
);
}),
"name",
{ value: "Send" },
);
Object.defineProperty(
(Msg.prototype.multiSend = function multiSend(request, callback) {
return this.rpcCall(
multiSend,
$root.cosmos.bank.v1beta1.MsgMultiSend,
$root.cosmos.bank.v1beta1.MsgMultiSendResponse,
request,
callback,
);
}),
"name",
{ value: "MultiSend" },
);
return Msg;
})();
v1beta1.MsgSend = (function () {
function MsgSend(p) {
this.amount = [];
@ -378,6 +414,35 @@ exports.cosmos = $root.cosmos = (() => {
};
return MsgSend;
})();
v1beta1.MsgSendResponse = (function () {
function MsgSendResponse(p) {
if (p)
for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
if (p[ks[i]] != null) this[ks[i]] = p[ks[i]];
}
MsgSendResponse.create = function create(properties) {
return new MsgSendResponse(properties);
};
MsgSendResponse.encode = function encode(m, w) {
if (!w) w = $Writer.create();
return w;
};
MsgSendResponse.decode = function decode(r, l) {
if (!(r instanceof $Reader)) r = $Reader.create(r);
var c = l === undefined ? r.len : r.pos + l,
m = new $root.cosmos.bank.v1beta1.MsgSendResponse();
while (r.pos < c) {
var t = r.uint32();
switch (t >>> 3) {
default:
r.skipType(t & 7);
break;
}
}
return m;
};
return MsgSendResponse;
})();
v1beta1.MsgMultiSend = (function () {
function MsgMultiSend(p) {
this.inputs = [];
@ -427,6 +492,35 @@ exports.cosmos = $root.cosmos = (() => {
};
return MsgMultiSend;
})();
v1beta1.MsgMultiSendResponse = (function () {
function MsgMultiSendResponse(p) {
if (p)
for (var ks = Object.keys(p), i = 0; i < ks.length; ++i)
if (p[ks[i]] != null) this[ks[i]] = p[ks[i]];
}
MsgMultiSendResponse.create = function create(properties) {
return new MsgMultiSendResponse(properties);
};
MsgMultiSendResponse.encode = function encode(m, w) {
if (!w) w = $Writer.create();
return w;
};
MsgMultiSendResponse.decode = function decode(r, l) {
if (!(r instanceof $Reader)) r = $Reader.create(r);
var c = l === undefined ? r.len : r.pos + l,
m = new $root.cosmos.bank.v1beta1.MsgMultiSendResponse();
while (r.pos < c) {
var t = r.uint32();
switch (t >>> 3) {
default:
r.skipType(t & 7);
break;
}
}
return m;
};
return MsgMultiSendResponse;
})();
return v1beta1;
})();
return bank;

View File

@ -360,6 +360,85 @@ export namespace cosmos {
public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.bank.v1beta1.Metadata;
}
/** Represents a Msg */
class Msg extends $protobuf.rpc.Service {
/**
* Constructs a new Msg service.
* @param rpcImpl RPC implementation
* @param [requestDelimited=false] Whether requests are length-delimited
* @param [responseDelimited=false] Whether responses are length-delimited
*/
constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean);
/**
* Creates new Msg service using the specified rpc implementation.
* @param rpcImpl RPC implementation
* @param [requestDelimited=false] Whether requests are length-delimited
* @param [responseDelimited=false] Whether responses are length-delimited
* @returns RPC service. Useful where requests and/or responses are streamed.
*/
public static create(
rpcImpl: $protobuf.RPCImpl,
requestDelimited?: boolean,
responseDelimited?: boolean,
): Msg;
/**
* Calls Send.
* @param request MsgSend message or plain object
* @param callback Node-style callback called with the error, if any, and MsgSendResponse
*/
public send(
request: cosmos.bank.v1beta1.IMsgSend,
callback: cosmos.bank.v1beta1.Msg.SendCallback,
): void;
/**
* Calls Send.
* @param request MsgSend message or plain object
* @returns Promise
*/
public send(request: cosmos.bank.v1beta1.IMsgSend): Promise<cosmos.bank.v1beta1.MsgSendResponse>;
/**
* Calls MultiSend.
* @param request MsgMultiSend message or plain object
* @param callback Node-style callback called with the error, if any, and MsgMultiSendResponse
*/
public multiSend(
request: cosmos.bank.v1beta1.IMsgMultiSend,
callback: cosmos.bank.v1beta1.Msg.MultiSendCallback,
): void;
/**
* Calls MultiSend.
* @param request MsgMultiSend message or plain object
* @returns Promise
*/
public multiSend(
request: cosmos.bank.v1beta1.IMsgMultiSend,
): Promise<cosmos.bank.v1beta1.MsgMultiSendResponse>;
}
namespace Msg {
/**
* Callback as used by {@link cosmos.bank.v1beta1.Msg#send}.
* @param error Error, if any
* @param [response] MsgSendResponse
*/
type SendCallback = (error: Error | null, response?: cosmos.bank.v1beta1.MsgSendResponse) => void;
/**
* Callback as used by {@link cosmos.bank.v1beta1.Msg#multiSend}.
* @param error Error, if any
* @param [response] MsgMultiSendResponse
*/
type MultiSendCallback = (
error: Error | null,
response?: cosmos.bank.v1beta1.MsgMultiSendResponse,
) => void;
}
/** Properties of a MsgSend. */
interface IMsgSend {
/** MsgSend fromAddress */
@ -415,6 +494,48 @@ export namespace cosmos {
public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.bank.v1beta1.MsgSend;
}
/** Properties of a MsgSendResponse. */
interface IMsgSendResponse {}
/** Represents a MsgSendResponse. */
class MsgSendResponse implements IMsgSendResponse {
/**
* Constructs a new MsgSendResponse.
* @param [p] Properties to set
*/
constructor(p?: cosmos.bank.v1beta1.IMsgSendResponse);
/**
* Creates a new MsgSendResponse instance using the specified properties.
* @param [properties] Properties to set
* @returns MsgSendResponse instance
*/
public static create(
properties?: cosmos.bank.v1beta1.IMsgSendResponse,
): cosmos.bank.v1beta1.MsgSendResponse;
/**
* Encodes the specified MsgSendResponse message. Does not implicitly {@link cosmos.bank.v1beta1.MsgSendResponse.verify|verify} messages.
* @param m MsgSendResponse message or plain object to encode
* @param [w] Writer to encode to
* @returns Writer
*/
public static encode(m: cosmos.bank.v1beta1.IMsgSendResponse, w?: $protobuf.Writer): $protobuf.Writer;
/**
* Decodes a MsgSendResponse message from the specified reader or buffer.
* @param r Reader or buffer to decode from
* @param [l] Message length if known beforehand
* @returns MsgSendResponse
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(
r: $protobuf.Reader | Uint8Array,
l?: number,
): cosmos.bank.v1beta1.MsgSendResponse;
}
/** Properties of a MsgMultiSend. */
interface IMsgMultiSend {
/** MsgMultiSend inputs */
@ -465,6 +586,51 @@ export namespace cosmos {
*/
public static decode(r: $protobuf.Reader | Uint8Array, l?: number): cosmos.bank.v1beta1.MsgMultiSend;
}
/** Properties of a MsgMultiSendResponse. */
interface IMsgMultiSendResponse {}
/** Represents a MsgMultiSendResponse. */
class MsgMultiSendResponse implements IMsgMultiSendResponse {
/**
* Constructs a new MsgMultiSendResponse.
* @param [p] Properties to set
*/
constructor(p?: cosmos.bank.v1beta1.IMsgMultiSendResponse);
/**
* Creates a new MsgMultiSendResponse instance using the specified properties.
* @param [properties] Properties to set
* @returns MsgMultiSendResponse instance
*/
public static create(
properties?: cosmos.bank.v1beta1.IMsgMultiSendResponse,
): cosmos.bank.v1beta1.MsgMultiSendResponse;
/**
* Encodes the specified MsgMultiSendResponse message. Does not implicitly {@link cosmos.bank.v1beta1.MsgMultiSendResponse.verify|verify} messages.
* @param m MsgMultiSendResponse message or plain object to encode
* @param [w] Writer to encode to
* @returns Writer
*/
public static encode(
m: cosmos.bank.v1beta1.IMsgMultiSendResponse,
w?: $protobuf.Writer,
): $protobuf.Writer;
/**
* Decodes a MsgMultiSendResponse message from the specified reader or buffer.
* @param r Reader or buffer to decode from
* @param [l] Message length if known beforehand
* @returns MsgMultiSendResponse
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
public static decode(
r: $protobuf.Reader | Uint8Array,
l?: number,
): cosmos.bank.v1beta1.MsgMultiSendResponse;
}
}
}

View File

@ -41,7 +41,7 @@
"coverage": "nyc --reporter=text --reporter=lcov yarn test --quiet",
"pack-web": "yarn build-or-skip && webpack --mode development --config webpack.web.config.js",
"preget-proto": "rm -rf proto",
"get-proto": "REF=v0.40.0-rc0 ./scripts/get-proto.sh",
"get-proto": "REF=v0.40.0-rc2 ./scripts/get-proto.sh",
"predefine-proto": "./scripts/predefine-proto.sh",
"define-proto": "./scripts/define-proto.sh",
"postdefine-proto": "prettier --write \"src/codec/generated/codecimpl.*\""

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -101,13 +101,13 @@ describe("IbcExtension", () => {
});
});
describe("unrelayedAcks", () => {
describe("unreceivedAcks", () => {
it("can be called", async () => {
pending("Fails with 'Query failed with (1): internal'. Make it work.");
pendingWithoutSimapp();
const [client, tmClient] = await makeClientWithIbc(simapp.tendermintUrl);
const response = await client.ibc.unverified.unrelayedAcks("foo", "bar", [0, 1]);
const response = await client.ibc.unverified.unreceivedAcks("foo", "bar", [0, 1]);
expect(response).toBeTruthy(); // TODO: implement checks
tmClient.disconnect();

View File

@ -49,11 +49,11 @@ export interface IbcExtension {
channelId: string,
packetCommitmentSequences: readonly number[],
) => Promise<ibc.core.channel.v1.IQueryUnreceivedPacketsResponse>;
readonly unrelayedAcks: (
readonly unreceivedAcks: (
portId: string,
channelId: string,
packetCommitmentSequences: readonly number[],
) => Promise<ibc.core.channel.v1.IQueryUnrelayedAcksResponse>;
) => Promise<ibc.core.channel.v1.IQueryUnreceivedAcksResponse>;
readonly nextSequenceReceive: (
portId: string,
channelId: string,
@ -174,15 +174,11 @@ export function setupIbcExtension(base: QueryClient): IbcExtension {
});
return toObject(response);
},
unrelayedAcks: async (
portId: string,
channelId: string,
packetCommitmentSequences: readonly number[],
) => {
const response = await channelQuerySerice.unrelayedAcks({
unreceivedAcks: async (portId: string, channelId: string, packetAckSequences: readonly number[]) => {
const response = await channelQuerySerice.unreceivedAcks({
portId: portId,
channelId: channelId,
packetCommitmentSequences: packetCommitmentSequences.map((s) => Long.fromNumber(s)),
packetAckSequences: packetAckSequences.map((s) => Long.fromNumber(s)),
});
return toObject(response);
},

File diff suppressed because it is too large Load Diff

View File

@ -38,11 +38,11 @@ export interface IbcExtension {
channelId: string,
packetCommitmentSequences: readonly number[],
) => Promise<ibc.core.channel.v1.IQueryUnreceivedPacketsResponse>;
readonly unrelayedAcks: (
readonly unreceivedAcks: (
portId: string,
channelId: string,
packetCommitmentSequences: readonly number[],
) => Promise<ibc.core.channel.v1.IQueryUnrelayedAcksResponse>;
) => Promise<ibc.core.channel.v1.IQueryUnreceivedAcksResponse>;
readonly nextSequenceReceive: (
portId: string,
channelId: string,