Skip to content

Commit

Permalink
Update Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
nagdahimanshu committed Jun 21, 2024
1 parent e72e67b commit 138b163
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ PKGS=$(shell go list ./... | grep -v "/vendor/")
BLUE = \033[1;34m
GREEN = \033[1;32m
COLOR_END = \033[0;39m
BINDING_OUTPUT_DIR=$(realpath ./internal/bindings)

build: build-frontend build-backend

Expand All @@ -20,6 +21,15 @@ build-frontend: # Builds the frontned application
run: # Runs the application, use `make run FLAGS="--help"`
@./bin/${APP_NAME} ${FLAGS}

generate-binding:
@echo "$(BLUE)Generating abi file... $(COLOR_END)"
solc --abi $(ERC20_TOKEN_FILE_PATH) -o $(BINDING_OUTPUT_DIR)
@echo "$(GREEN)ABI file generated successfully$(COLOR_END)"
@echo "$(BLUE)Generating go binding for the ERC20 token smart contarct... $(COLOR_END)"
@echo "$(shell pwd)"
abigen --abi=$(shell find $(BINDING_OUTPUT_DIR) -type f -name '*.abi') --pkg=bindings --out=$(BINDING_OUTPUT_DIR)/erc20.go
@echo "$(GREEN)Go binding generated successfully$(COLOR_END)"

test: # Runs tests
@echo "Test packages"
@go test -race -shuffle=on -coverprofile=coverage.out -cover $(PKGS)
Expand Down

0 comments on commit 138b163

Please sign in to comment.