Update queries and tests for updated docker image

This commit is contained in:
Ethan Frey 2020-01-30 19:44:11 +01:00
parent 81e5cf5af5
commit c915d6f2a7
2 changed files with 14 additions and 6 deletions

View File

@ -214,7 +214,9 @@ describe("CosmWasmConnection", () => {
if (isFailedTransaction(getResponse)) {
throw new Error("Expected transaction to succeed");
}
expect(getResponse.log).toMatch(/success/i);
// we get a json response in the log for each msg, multiple events is good (transfer succeeded)
const log = JSON.parse(getResponse.log!)[0];
expect(log.events.length).toBe(2);
const { transaction, signatures } = getResponse;
if (!isSendTransaction(transaction)) {
throw new Error("Expected send transaction");
@ -282,7 +284,9 @@ describe("CosmWasmConnection", () => {
if (isFailedTransaction(idResult)) {
throw new Error("Expected transaction to succeed");
}
expect(idResult.log).toMatch(/success/i);
const idlog = JSON.parse(idResult.log!)[0];
expect(idlog.events.length).toBe(2);
const { transaction: idTransaction } = idResult;
if (!isSendTransaction(idTransaction)) {
throw new Error("Expected send transaction");
@ -304,7 +308,9 @@ describe("CosmWasmConnection", () => {
if (isFailedTransaction(senderAddressResult)) {
throw new Error("Expected transaction to succeed");
}
expect(senderAddressResult.log).toMatch(/success/i);
const senderLog = JSON.parse(senderAddressResult.log!)[0];
expect(senderLog.events.length).toBe(2);
const { transaction: senderAddressTransaction } = senderAddressResult;
if (!isSendTransaction(senderAddressTransaction)) {
throw new Error("Expected send transaction");
@ -350,7 +356,9 @@ describe("CosmWasmConnection", () => {
if (isFailedTransaction(heightResult)) {
throw new Error("Expected transaction to succeed");
}
expect(heightResult.log).toMatch(/success/i);
const heightLog = JSON.parse(heightResult.log!)[0];
expect(heightLog.events.length).toBe(2);
const { transaction: heightTransaction } = heightResult;
if (!isSendTransaction(heightTransaction)) {
throw new Error("Expected send transaction");

View File

@ -126,8 +126,8 @@ export class CosmWasmConnection implements BlockchainConnection {
}
public async height(): Promise<number> {
const { block_meta } = await this.restClient.blocksLatest();
return block_meta.header.height;
const { block } = await this.restClient.blocksLatest();
return block.header.height;
}
public async getToken(searchTicker: TokenTicker): Promise<Token | undefined> {