diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a5f11908..5ae5c955 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,6 +18,9 @@ concurrency: jobs: build: runs-on: ubuntu-latest + env: + GOPRIVATE: github.com/fabianMendez/privatemodule + GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} strategy: matrix: arch: [amd64, arm64] @@ -46,6 +49,7 @@ jobs: env: GOOS: ${{ matrix.targetos }} GOARCH: ${{ matrix.arch }} + - run: git config --global url.https://$GITHUB_TOKEN@github.com/.insteadOf https://github.com/ - name: Compile if: steps.cache-binaries.outputs.cache-hit != 'true' && env.GIT_DIFF run: | @@ -54,6 +58,9 @@ jobs: tests: runs-on: ubuntu-latest + env: + GOPRIVATE: github.com/fabianMendez/privatemodule + GH_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v4 @@ -62,6 +69,7 @@ jobs: check-latest: true cache: true cache-dependency-path: go.sum + - run: git config --global url.https://$GITHUB_TOKEN@github.com/.insteadOf https://github.com/ - uses: technote-space/get-diff-action@v6.1.2 id: git_diff with: @@ -84,12 +92,16 @@ jobs: test-e2e: runs-on: ubuntu-latest + env: + GOPRIVATE: github.com/fabianMendez/privatemodule + GH_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} timeout-minutes: 10 steps: - uses: actions/setup-go@v4 with: go-version: "1.21" - uses: actions/checkout@v4 + - run: git config --global url.https://$GITHUB_TOKEN@github.com/.insteadOf https://github.com/ - uses: technote-space/get-diff-action@v6.0.1 with: PATTERNS: | diff --git a/Makefile b/Makefile index a0ebcdba..ba398822 100644 --- a/Makefile +++ b/Makefile @@ -212,7 +212,9 @@ cover-html: test-unit-cover @go tool cover -html=$(TEST_COVERAGE_PROFILE) docker-build-e2e: - @docker build -t sedaprotocol/seda-chaind-e2e -f dockerfiles/Dockerfile.e2e . + @docker build \ + -t sedaprotocol/seda-chaind-e2e \ + -f dockerfiles/Dockerfile.e2e . .PHONY: cover-html run-tests $(TEST_TARGETS) test test-race docker-build-e2e diff --git a/dockerfiles/Dockerfile.e2e b/dockerfiles/Dockerfile.e2e index f4c34fd0..7569252f 100644 --- a/dockerfiles/Dockerfile.e2e +++ b/dockerfiles/Dockerfile.e2e @@ -15,9 +15,19 @@ ARG GIT_COMMIT RUN apk add --no-cache \ ca-certificates \ build-base \ - linux-headers + linux-headers \ + git + +# # Download go dependencies +COPY .netrc /root/ +# CMD echo $GITHUB_TOKEN + +# ENV GOPRIVATE=github.com/sedaprotocol/* +# ENV GIT_TERMINAL_PROMPT=0 + +# RUN git config --global url."https://${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/" + -# Download go dependencies WORKDIR /seda-chain COPY go.mod go.sum ./ RUN --mount=type=cache,target=/root/.cache/go-build \ diff --git a/x/randomness/keeper/abci.go b/x/randomness/keeper/abci.go index 356d1bfc..c9c6a9e6 100644 --- a/x/randomness/keeper/abci.go +++ b/x/randomness/keeper/abci.go @@ -118,9 +118,13 @@ func ProcessProposalHandler( return &abci.ResponseProcessProposal{Status: abci.ResponseProcessProposal_REJECT}, err } + if msg.Proposer != string(sdk.AccAddress(req.ProposerAddress).String()) { + return &abci.ResponseProcessProposal{Status: abci.ResponseProcessProposal_REJECT}, + fmt.Errorf("the NewSeed transaction must be from the block proposer") + } + // TO-DO run DefaultProposalHandler.ProcessProposalHandler first? // TO-DO Validate()? - // TO-DO Ensure that msg was signed by block proposer? // get block proposer's validator public key validator, err := stakingKeeper.GetValidatorByConsAddr(ctx, sdk.ConsAddress(req.ProposerAddress))