forked from iotexproject/iotex-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ioctl/ws): sync latest w3bstream contract abis and generate go c…
…ode (iotexproject#4279)
- Loading branch information
Showing
14 changed files
with
11,684 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
.DEFAULT_GOAL := update | ||
|
||
.PHONY: update | ||
update: clean fetch generate_abi generate_go | ||
|
||
.PHONY: fetch | ||
fetch: | ||
@echo "#### clone sprout develop branch..." | ||
@mkdir sprout | ||
@cd sprout && git init --quiet | ||
@cd sprout && git remote add origin [email protected]:machinefi/sprout.git | ||
@cd sprout && git config core.sparsecheckout true | ||
@cd sprout && echo "smartcontracts" >> .git/info/sparse-checkout | ||
@cd sprout && git pull origin develop --depth=1 --quiet | ||
@echo DONE | ||
|
||
|
||
CONTRACTS=('FleetManagement' 'ProjectRegistrar' 'W3bstreamProject' 'W3bstreamRouter' 'W3bstreamProver') | ||
|
||
.PHONY: generate_abi | ||
generate_abi: | ||
@echo "#### generate abis from latest contracts..." | ||
@cd sprout/smartcontracts && yarn install > /dev/null 2>&1 | ||
@cd sprout/smartcontracts/contracts && for file in 'FleetManagement' 'ProjectRegistrar' 'W3bstreamProject' 'W3bstreamRouter' 'W3bstreamProver' ; \ | ||
do \ | ||
solc --include-path ../node_modules/ --base-path . --optimize --abi --overwrite --pretty-json -o . $$file.sol > /dev/null 2>&1 ; \ | ||
if [ -e $$file.abi ]; then \ | ||
mv $$file.abi ../../../abis/$$file.json; \ | ||
fi \ | ||
done | ||
@echo DONE | ||
|
||
.PHONY: generate_go | ||
generate_go: | ||
@echo "#### generate go code by abis" | ||
@go generate . | ||
@echo DONE | ||
|
||
.PHONY: clean | ||
clean: | ||
@rm -rf sprout | ||
|
Oops, something went wrong.