Skip to content

Commit 871d2ae

Browse files
authored
Merge pull request #7 from kaleido-io/events
Refactor FFCAPI to a local API interace, and FFTM to a utility package
2 parents 9ab5b7a + b9bae85 commit 871d2ae

File tree

147 files changed

+14698
-4947
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+14698
-4947
lines changed

.github/workflows/docker_main.yml

-43
This file was deleted.

.github/workflows/docker_release.yml

-37
This file was deleted.

.github/workflows/go.yml

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ jobs:
2121
go-version: 1.17
2222

2323
- name: Build and Test
24+
env:
25+
TEST_FLAGS: -v
2426
run: make
2527

2628
- name: Upload coverage

.golangci.yml

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ linters-settings:
88
enabled-checks: []
99
disabled-checks:
1010
- regexpMust
11+
gosec:
12+
excludes:
13+
- G402
1114
goheader:
1215
values:
1316
regexp:

.vscode/settings.json

+40-1
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,26 @@
55
"go.lintTool": "golangci-lint",
66
"cSpell.words": [
77
"APIID",
8+
"apitypes",
9+
"badurl",
10+
"blocklistener",
811
"ccache",
12+
"confirmationsmocks",
913
"dataexchange",
1014
"Debugf",
1115
"devdocs",
1216
"Devel",
17+
"distmode",
18+
"Dont",
19+
"ehtype",
20+
"estype",
1321
"ethconnect",
22+
"ethtypes",
23+
"eventsmocks",
24+
"eventstream",
25+
"eventstreams",
1426
"fabconnect",
27+
"ffapi",
1528
"ffcapi",
1629
"ffcapimocks",
1730
"ffcore",
@@ -26,24 +39,43 @@
2639
"ffresty",
2740
"ffstruct",
2841
"fftm",
42+
"fftmrequest",
2943
"fftypes",
3044
"finalizers",
45+
"getkin",
3146
"GJSON",
47+
"goleveldb",
48+
"httpserver",
3249
"hyperledger",
50+
"idempotence",
3351
"Infof",
3452
"IPFS",
53+
"jsonmap",
54+
"Kaleido",
55+
"leveldb",
56+
"loadbalanced",
57+
"logrus",
3558
"mtxs",
3659
"NATS",
3760
"Nowarn",
3861
"oapispec",
62+
"oklog",
63+
"openapi",
3964
"optype",
65+
"persistencemocks",
66+
"pluggable",
4067
"policyengine",
68+
"policyenginemocks",
69+
"policyengines",
70+
"policyloop",
4171
"protocolid",
72+
"restapi",
4273
"resty",
4374
"santhosh",
4475
"secp",
4576
"sigs",
4677
"stretchr",
78+
"syndtr",
4779
"sysmessaging",
4880
"tekuri",
4981
"tmconfig",
@@ -52,13 +84,20 @@
5284
"txcommon",
5385
"txcommonmocks",
5486
"txid",
87+
"txns",
5588
"txtype",
5689
"unflushed",
90+
"unmarshalled",
91+
"unmarshalling",
5792
"upgrader",
93+
"upsert",
5894
"upserts",
5995
"Warnf",
96+
"whconfig",
97+
"workloaddistribution",
6098
"wsclient",
61-
"wsconfig"
99+
"wsconfig",
100+
"wsmocks"
62101
],
63102
"go.testTimeout": "10s"
64103
}

Dockerfile

-12
This file was deleted.

Makefile

+16-19
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
VGO=go
2-
GOFILES := $(shell find cmd internal pkg -name '*.go' -print)
2+
GOFILES := $(shell find internal pkg -name '*.go' -print)
33
GOBIN := $(shell $(VGO) env GOPATH)/bin
44
LINT := $(GOBIN)/golangci-lint
55
MOCKERY := $(GOBIN)/mockery
@@ -12,43 +12,40 @@ GOGC=30
1212

1313
all: build test go-mod-tidy
1414
test: deps lint
15-
$(VGO) test ./internal/... ./cmd/... -cover -coverprofile=coverage.txt -covermode=atomic -timeout=30s
15+
$(VGO) test ./internal/... ./pkg/... -cover -coverprofile=coverage.txt -covermode=atomic -timeout=30s ${TEST_FLAGS}
1616
coverage.html:
1717
$(VGO) tool cover -html=coverage.txt
1818
coverage: test coverage.html
1919
lint: ${LINT}
2020
GOGC=20 $(LINT) run -v --timeout 5m
21-
ffcapi:
22-
$(eval FFCAPI_PATH := $(shell $(VGO) list -f '{{.Dir}}' github.com/hyperledger/firefly-common/pkg/ffcapi))
23-
21+
2422
${MOCKERY}:
2523
$(VGO) install github.com/vektra/mockery/cmd/mockery@latest
2624
${LINT}:
27-
$(VGO) install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
25+
$(VGO) install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.47.0
2826

2927

3028
define makemock
3129
mocks: mocks-$(strip $(1))-$(strip $(2))
32-
mocks-$(strip $(1))-$(strip $(2)): ${MOCKERY} ffcapi
30+
mocks-$(strip $(1))-$(strip $(2)): ${MOCKERY}
3331
${MOCKERY} --case underscore --dir $(1) --name $(2) --outpkg $(3) --output mocks/$(strip $(3))
3432
endef
3533

36-
$(eval $(call makemock, $${FFCAPI_PATH}, API, ffcapimocks))
37-
$(eval $(call makemock, pkg/policyengine, PolicyEngine, policyenginemocks))
38-
$(eval $(call makemock, internal/confirmations, Manager, confirmationsmocks))
39-
$(eval $(call makemock, internal/manager, Manager, managermocks))
34+
$(eval $(call makemock, pkg/ffcapi, API, ffcapimocks))
35+
$(eval $(call makemock, pkg/policyengine, PolicyEngine, policyenginemocks))
36+
$(eval $(call makemock, internal/confirmations, Manager, confirmationsmocks))
37+
$(eval $(call makemock, internal/persistence, Persistence, persistencemocks))
38+
$(eval $(call makemock, internal/ws, WebSocketChannels, wsmocks))
39+
$(eval $(call makemock, internal/events, Stream, eventsmocks))
4040

41-
firefly-transaction-manager: ${GOFILES}
42-
$(VGO) build -o ./firefly-transaction-manager -ldflags "-X main.buildDate=`date -u +\"%Y-%m-%dT%H:%M:%SZ\"` -X main.buildVersion=$(BUILD_VERSION)" -tags=prod -tags=prod -v ./fftm
4341
go-mod-tidy: .ALWAYS
4442
$(VGO) mod tidy
45-
build: firefly-transaction-manager
43+
build: test
4644
.ALWAYS: ;
4745
clean:
4846
$(VGO) clean
4947
deps:
50-
$(VGO) get ./fftm
51-
docs:
52-
$(VGO) test ./cmd -timeout=10s -tags docs
53-
docker:
54-
docker build --build-arg BUILD_VERSION=${BUILD_VERSION} ${DOCKER_ARGS} -t hyperledger/firefly-transaction-manager .
48+
$(VGO) get ./internal/... ./pkg/...
49+
$(VGO) get -t ./internal/... ./pkg/...
50+
reference:
51+
$(VGO) test ./pkg/fftm -timeout=10s -tags docs

cmd/fftm.go

-102
This file was deleted.

0 commit comments

Comments
 (0)