Skip to content
This repository was archived by the owner on May 13, 2022. It is now read-only.

Commit 1baa672

Browse files
author
Silas Davis
committed
Fix CI
- Upgrade images - Fix 81.test.ts which was failing silently via async mishandling - Bump JS versions - Use python3 in docker image to keep pip happy - Actually fix app03 (only took about 3 years :)) Signed-off-by: Silas Davis <[email protected]>
1 parent 7595456 commit 1baa672

File tree

11 files changed

+491
-505
lines changed

11 files changed

+491
-505
lines changed

.github/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.13-alpine3.11
1+
FROM golang:1.15-alpine3.13
22
MAINTAINER Monax <[email protected]>
33

44
ENV DOCKER_VERSION "17.12.1-ce"
@@ -21,9 +21,9 @@ RUN apk add --update --no-cache \
2121
docker \
2222
libffi-dev \
2323
openssl-dev \
24-
python-dev \
24+
python3-dev \
2525
py-pip
26-
RUN pip install docker-compose
26+
RUN pip3 install docker-compose
2727
# get docker client
2828
WORKDIR /usr/bin
2929
RUN curl -sS -L https://download.docker.com/linux/static/stable/x86_64/docker-$DOCKER_VERSION.tgz | tar xz --strip-components 1 docker/docker

.github/workflows/test.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
runs-on: ubuntu-latest
3737
steps:
3838
- uses: actions/checkout@v2
39-
- run: docker-compose run burrow make test_integration_vent
39+
- run: make test_integration_vent_postgres
4040

4141
docker:
4242
runs-on: ubuntu-latest
@@ -68,7 +68,7 @@ jobs:
6868
- uses: actions/checkout@v2
6969
- uses: actions/setup-node@v1
7070
with:
71-
node-version: '8.x'
71+
node-version: '14.x'
7272
- uses: actions/download-artifact@master
7373
with:
7474
name: burrow
@@ -116,7 +116,7 @@ jobs:
116116
- uses: actions/checkout@v2
117117
- uses: actions/setup-node@v1
118118
with:
119-
node-version: '8.x'
119+
node-version: '14.x'
120120
- uses: actions/download-artifact@master
121121
with:
122122
name: burrow

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# For solc binary
22
FROM ethereum/solc:0.5.12 as solc-builder
33
# We use a multistage build to avoid bloating our deployment image with build dependencies
4-
FROM golang:1.13-alpine3.11 as builder
4+
FROM golang:1.15-alpine3.12 as builder
55

66
RUN apk add --no-cache --update git bash make musl-dev gcc libc6-compat
77

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ REPO := $(shell pwd)
1515

1616
# Our own Go files containing the compiled bytecode of solidity files as a constant
1717

18-
CI_IMAGE="hyperledger/burrow:ci"
18+
export CI_IMAGE=hyperledger/burrow:ci-2
1919

2020
VERSION := $(shell scripts/version.sh)
2121
# Gets implicit default GOPATH if not set

docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ services:
88
- 5432
99

1010
burrow:
11-
build: .github
11+
image: ${CI_IMAGE}
1212
environment:
1313
DB_URL: "postgres://postgres@db:5432/postgres?sslmode=disable"
1414
GO111MODULE: "on"

js/package.json

+15-10
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,26 @@
1818
"test": "./test.sh 'src/test/**/*.test.ts'"
1919
},
2020
"dependencies": {
21-
"@grpc/grpc-js": "^1.0.2",
21+
"@grpc/grpc-js": "^1.2.4",
2222
"@types/ethereumjs-abi": "^0.6.3",
23-
"bn.js": "^5.1.1",
23+
"bn.js": "^5.1.3",
2424
"ethereumjs-abi": "^0.6.8",
25-
"google-protobuf": "^3.11.4",
26-
"sha3": "^2.1.1",
25+
"google-protobuf": "^3.14.0",
26+
"sha3": "^2.1.3",
2727
"solc": "^0.6.1",
28-
"ts-node": "^8.6.2",
29-
"typescript": "^3.7.4"
28+
"ts-node": "^9.1.1",
29+
"typescript": "^4.1.3"
3030
},
3131
"devDependencies": {
32-
"@types/mocha": "^7.0.2",
33-
"grpc-tools": "^1.8.1",
34-
"grpc_tools_node_protoc_ts": "^3.0.0",
35-
"mocha": "^7.1.1"
32+
"@types/mocha": "^8.2.0",
33+
"grpc-tools": "^1.10.0",
34+
"grpc_tools_node_protoc_ts": "^5.1.0",
35+
"mocha": "^8.2.1"
36+
},
37+
"mocha": {
38+
"bail": true,
39+
"exit": true,
40+
"timeout": 60000
3641
},
3742
"homepage": "https://github.com/hyperledger/burrow/",
3843
"keywords": [

js/src/lib/events.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
import { IExecutionEventsClient } from '../../proto/rpcevents_grpc_pb';
2-
import { BlocksRequest, BlockRange, Bound, EventsResponse } from '../../proto/rpcevents_pb';
3-
import { LogEvent } from '../../proto/exec_pb';
4-
import { Error } from './burrow';
1+
import {IExecutionEventsClient} from '../../proto/rpcevents_grpc_pb';
2+
import {BlocksRequest, BlockRange, Bound, EventsResponse} from '../../proto/rpcevents_pb';
3+
import {LogEvent} from '../../proto/exec_pb';
4+
import {Error} from './burrow';
55
import * as grpc from '@grpc/grpc-js';
66

77
export type EventStream = grpc.ClientReadableStream<EventsResponse>;
88

99
export class Events {
1010

11-
constructor(private burrow: IExecutionEventsClient) {}
11+
constructor(private burrow: IExecutionEventsClient) {
12+
}
1213

1314
listen(query: string, callback: (err: Error, log: LogEvent) => void): EventStream {
1415
const start = new Bound();
@@ -32,8 +33,7 @@ export class Events {
3233
callback(null, event.getLog());
3334
});
3435
});
35-
stream.on('error', (err: Error) =>
36-
err.code === grpc.status.CANCELLED ? callback(null, null) : callback(err, null));
36+
stream.on('error', (err: Error) => err.code === grpc.status.CANCELLED || callback(err, null));
3737
return stream;
3838
}
3939

js/src/test/81.test.ts renamed to js/src/test/event-listen.test.ts

+11-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {burrow, compile} from '../test';
44
describe('Event listening', function () {
55

66
it('listens to an event from a contract', async () => {
7-
const source = `
7+
const source = `
88
pragma solidity >=0.0.0;
99
contract Contract {
1010
event Pay(
@@ -31,11 +31,12 @@ describe('Event listening', function () {
3131
}
3232
`
3333

34-
const {abi, code} = compile(source, 'Contract')
35-
const contract: any = await burrow.contracts.deploy(abi, code)
34+
const {abi, code} = compile(source, 'Contract')
35+
const contract: any = await burrow.contracts.deploy(abi, code)
36+
const promise = new Promise<void>((resolve, reject) => {
3637
const stream = contract.Pay((error, result) => {
3738
if (error) {
38-
throw error;
39+
reject(error);
3940
} else {
4041
const actual = Object.assign(
4142
{},
@@ -61,10 +62,14 @@ describe('Event listening', function () {
6162
)
6263

6364
stream.cancel()
65+
resolve()
6466
}
6567
});
66-
67-
contract.announce()
6868
})
69+
70+
await contract.announce()
71+
72+
return promise
73+
})
6974
});
7075

0 commit comments

Comments
 (0)