Skip to content

Commit

Permalink
Fix ut (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
zjg555543 authored Nov 8, 2024
1 parent ddf18d0 commit 8cb579d
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 30 deletions.
42 changes: 21 additions & 21 deletions .github/workflows/test-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,24 @@ jobs:
name: code-coverage-report
path: test/coverage.out

sonar-cloud:
needs: test-unit
name: SonarCloud
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Download code coverage results
uses: actions/download-artifact@v3
with:
name: code-coverage-report

- name: Analyze with SonarCloud
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# sonar-cloud:
# needs: test-unit
# name: SonarCloud
# runs-on: ubuntu-latest
# steps:
# - name: Checkout Code
# uses: actions/checkout@v3
# with:
# submodules: recursive
# fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
#
# - name: Download code coverage results
# uses: actions/download-artifact@v3
# with:
# name: code-coverage-report
#
# - name: Analyze with SonarCloud
# uses: sonarsource/sonarcloud-github-action@master
# env:
# GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN }}
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ RUN make build
# CONTAINER FOR RUNNING BINARY
FROM alpine:3.16.0

COPY --from=build /go/src/github.com/0xPolygon/cdk-data-availability/dist/cdk-data-availability /app/cdk-data-availability
COPY --from=build /go/src/github.com/0xPolygon/cdk-data-availability/dist/xlayer-data-availability /app/xlayer-data-availability

EXPOSE 8444

CMD ["/bin/sh", "-c", "/app/cdk-data-availability run"]
CMD ["/bin/sh", "-c", "/app/xlayer-data-availability run"]
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ GOBASE := $(shell pwd)
GOBIN := $(GOBASE)/dist
GOOS := $(shell uname -s | tr '[:upper:]' '[:lower:]')
GOENVVARS := GOBIN=$(GOBIN) CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(ARCH)
GOBINARY := cdk-data-availability
GOBINARY := xlayer-data-availability
GOCMD := $(GOBASE)/cmd

LDFLAGS += -X 'github.com/0xPolygon/cdk-data-availability.Version=$(VERSION)'
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# CDK Data Availability
# X Layer CDK Data Availability

### Data Availability Layer for CDK Validium

The cdk-data-availability project is a specialized Data Availability Node (DA Node) that is part of Polygon's CDK (Chain Development Kit) Validium.
The xlayer-data-availability project is a specialized Data Availability Node (DA Node) that is part of Polygon's CDK (Chain Development Kit) Validium.

## Overview of Validium

Expand Down
2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"github.com/urfave/cli/v2"
)

const appName = "cdk-data-availability"
const appName = "xlayer-data-availability"

var (
configFileFlag = cli.StringFlag{
Expand Down
5 changes: 3 additions & 2 deletions services/datacom/datacom.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ func (d *Endpoints) signSequence(signedSequence types.SignedSequenceInterface) (
if err != nil || d.isEmptyAddress(sender) {
return "0x0", rpc.NewRPCError(rpc.DefaultErrorCode, "failed to verify sender")
}
log.Infof("SignSequence, signedSequence sender: %v, sequencerTracker:%v, permitApiAddress:%s", sender.String(), d.sequencerTracker.GetAddr().String(), d.permitApiAddress.String())
if sender != d.sequencerTracker.GetAddr() && sender != d.permitApiAddress {
log.Infof("SignSequence, signedSequence sender: %v, sequencerTracker:%v, permitApiAddress:%s",
sender.String(), d.sequencerTracker.GetAddr().String(), d.permitApiAddress.String())
if sender != d.sequencerTracker.GetAddr() && sender != d.permitApiAddress {
return "0x0", rpc.NewRPCError(rpc.DefaultErrorCode, "unauthorized")
}

Expand Down
2 changes: 1 addition & 1 deletion test/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ services:
command:
- "/bin/sh"
- "-c"
- "/app/cdk-data-availability run --cfg /app/config.toml"
- "/app/xlayer-data-availability run --cfg /app/config.toml"

cdk-data-availability-db:
container_name: cdk-data-availability-db
Expand Down

0 comments on commit 8cb579d

Please sign in to comment.