forked from Electron-Labs/yui-ibc-solidity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
74 lines (63 loc) · 1.54 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
NETWORK ?= development
TRUFFLE ?= npx truffle
ABIGEN ?= abigen
.PHONY: yrly
yrly:
go build -o build/yrly ./relayer
.PHONY: config
config:
export CONF_TPL="./pkg/consts/contract.go:./scripts/template/contract.go.tpl" && $(TRUFFLE) exec ./scripts/confgen.js --network=$(NETWORK)
.PHONY: abi
abi:
ifdef SOURCE
$(eval TARGET := $(shell echo ${SOURCE} | tr A-Z a-z))
@mkdir -p ./build/abi ./pkg/contract
@mkdir -p ./pkg/contract/$(TARGET)
@cat ./build/contracts/${SOURCE}.json | jq ".abi" > ./build/abi/${SOURCE}.abi
$(ABIGEN) --abi ./build/abi/${SOURCE}.abi --pkg $(TARGET) --out ./pkg/contract/$(TARGET)/$(TARGET).go
else
@echo "'SOURCE={SOURCE}' is required"
endif
.PHONY: proto
proto:
ifndef SOLPB_DIR
$(error SOLPB_DIR is not specified)
else
protoc --go_out=. \
-I./proto \
-I./third_party/proto \
-I$(SOLPB_DIR)/protobuf-solidity/src/protoc/include \
./proto/**/*.proto
endif
.PHONY: test
test:
go test -v ./tests/... -count=1
.PHONY: setup
setup:
./scripts/setup.sh development
.PHONY: setup-e2e
setup-e2e:
./scripts/setup.sh testtwochainz
.PHONY: down
down:
./scripts/setup.sh down
.PHONY: proto-gen
proto-gen:
@echo "Generating Protobuf files"
ifndef SOLPB_DIR
$(error SOLPB_DIR is not specified)
else
docker run \
-v $(CURDIR):/workspace \
-v $(SOLPB_DIR):/solpb \
-e SOLPB_DIR=/solpb \
--workdir /workspace \
tendermintdev/sdk-proto-gen:v0.3 \
sh ./scripts/protocgen.sh
endif
.PHONY: integration-test
integration-test:
go test -v ./tests/integration/... -count=1
.PHONY: e2e-test
e2e-test:
go test -v ./tests/e2e/... -count=1