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

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
- 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]>
  • Loading branch information
Silas Davis committed Jan 25, 2021
1 parent 7595456 commit 1baa672
Show file tree
Hide file tree
Showing 11 changed files with 491 additions and 505 deletions.
6 changes: 3 additions & 3 deletions .github/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.13-alpine3.11
FROM golang:1.15-alpine3.13
MAINTAINER Monax <[email protected]>

ENV DOCKER_VERSION "17.12.1-ce"
Expand All @@ -21,9 +21,9 @@ RUN apk add --update --no-cache \
docker \
libffi-dev \
openssl-dev \
python-dev \
python3-dev \
py-pip
RUN pip install docker-compose
RUN pip3 install docker-compose
# get docker client
WORKDIR /usr/bin
RUN curl -sS -L https://download.docker.com/linux/static/stable/x86_64/docker-$DOCKER_VERSION.tgz | tar xz --strip-components 1 docker/docker
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: docker-compose run burrow make test_integration_vent
- run: make test_integration_vent_postgres

docker:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '8.x'
node-version: '14.x'
- uses: actions/download-artifact@master
with:
name: burrow
Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '8.x'
node-version: '14.x'
- uses: actions/download-artifact@master
with:
name: burrow
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# For solc binary
FROM ethereum/solc:0.5.12 as solc-builder
# We use a multistage build to avoid bloating our deployment image with build dependencies
FROM golang:1.13-alpine3.11 as builder
FROM golang:1.15-alpine3.12 as builder

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

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ REPO := $(shell pwd)

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

CI_IMAGE="hyperledger/burrow:ci"
export CI_IMAGE=hyperledger/burrow:ci-2

VERSION := $(shell scripts/version.sh)
# Gets implicit default GOPATH if not set
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ services:
- 5432

burrow:
build: .github
image: ${CI_IMAGE}
environment:
DB_URL: "postgres://postgres@db:5432/postgres?sslmode=disable"
GO111MODULE: "on"
Expand Down
25 changes: 15 additions & 10 deletions js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,26 @@
"test": "./test.sh 'src/test/**/*.test.ts'"
},
"dependencies": {
"@grpc/grpc-js": "^1.0.2",
"@grpc/grpc-js": "^1.2.4",
"@types/ethereumjs-abi": "^0.6.3",
"bn.js": "^5.1.1",
"bn.js": "^5.1.3",
"ethereumjs-abi": "^0.6.8",
"google-protobuf": "^3.11.4",
"sha3": "^2.1.1",
"google-protobuf": "^3.14.0",
"sha3": "^2.1.3",
"solc": "^0.6.1",
"ts-node": "^8.6.2",
"typescript": "^3.7.4"
"ts-node": "^9.1.1",
"typescript": "^4.1.3"
},
"devDependencies": {
"@types/mocha": "^7.0.2",
"grpc-tools": "^1.8.1",
"grpc_tools_node_protoc_ts": "^3.0.0",
"mocha": "^7.1.1"
"@types/mocha": "^8.2.0",
"grpc-tools": "^1.10.0",
"grpc_tools_node_protoc_ts": "^5.1.0",
"mocha": "^8.2.1"
},
"mocha": {
"bail": true,
"exit": true,
"timeout": 60000
},
"homepage": "https://github.com/hyperledger/burrow/",
"keywords": [
Expand Down
14 changes: 7 additions & 7 deletions js/src/lib/events.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { IExecutionEventsClient } from '../../proto/rpcevents_grpc_pb';
import { BlocksRequest, BlockRange, Bound, EventsResponse } from '../../proto/rpcevents_pb';
import { LogEvent } from '../../proto/exec_pb';
import { Error } from './burrow';
import {IExecutionEventsClient} from '../../proto/rpcevents_grpc_pb';
import {BlocksRequest, BlockRange, Bound, EventsResponse} from '../../proto/rpcevents_pb';
import {LogEvent} from '../../proto/exec_pb';
import {Error} from './burrow';
import * as grpc from '@grpc/grpc-js';

export type EventStream = grpc.ClientReadableStream<EventsResponse>;

export class Events {

constructor(private burrow: IExecutionEventsClient) {}
constructor(private burrow: IExecutionEventsClient) {
}

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

Expand Down
17 changes: 11 additions & 6 deletions js/src/test/81.test.ts → js/src/test/event-listen.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {burrow, compile} from '../test';
describe('Event listening', function () {

it('listens to an event from a contract', async () => {
const source = `
const source = `
pragma solidity >=0.0.0;
contract Contract {
event Pay(
Expand All @@ -31,11 +31,12 @@ describe('Event listening', function () {
}
`

const {abi, code} = compile(source, 'Contract')
const contract: any = await burrow.contracts.deploy(abi, code)
const {abi, code} = compile(source, 'Contract')
const contract: any = await burrow.contracts.deploy(abi, code)
const promise = new Promise<void>((resolve, reject) => {
const stream = contract.Pay((error, result) => {
if (error) {
throw error;
reject(error);
} else {
const actual = Object.assign(
{},
Expand All @@ -61,10 +62,14 @@ describe('Event listening', function () {
)

stream.cancel()
resolve()
}
});

contract.announce()
})

await contract.announce()

return promise
})
});

Loading

0 comments on commit 1baa672

Please sign in to comment.