Skip to content

Commit

Permalink
Lint and adding new token to workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
chray-zhang committed Nov 14, 2024
1 parent 11cd7a3 commit 453cea8
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/integration-tests-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,13 @@ jobs:
nix_path: nixpkgs=channel:nixos-unstable
- name: Install Cairo
uses: ./.github/actions/install-cairo
- name: Setup GitHub Token
id: setup-github-token
uses: smartcontractkit/.github/actions/setup-github-token@9e7cc0779934cae4a9028b8588c9adb64d8ce68c # [email protected]
with:
aws-role-arn: ${{ secrets.AWS_OIDC_GLOBAL_READ_ONLY_TOKEN_ISSUER_ROLE_ARN }}
aws-lambda-url: ${{ secrets.GATI_RELENG_LAMBDA_URL }}
aws-region: ${{ secrets.QA_AWS_REGION }}
- name: Build contracts
run: |
cd contracts && scarb --profile release build
Expand Down Expand Up @@ -199,7 +206,7 @@ jobs:
test_download_vendor_packages_command: cd integration-tests && nix develop -c go mod download
cl_repo: ${{ env.CL_ECR }}
cl_image_tag: starknet.${{ github.sha }}${{ matrix.image.tag-suffix }}
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ steps.setup-github-token.outputs.access-token }}
go_mod_path: ./integration-tests/go.mod
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
Expand Down
25 changes: 11 additions & 14 deletions ops/gauntlet/gauntlet_plus_plus_starknet.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import (
"context"
"encoding/json"
"fmt"
"net/http"

"github.com/rs/zerolog/log"
g "github.com/smartcontractkit/gauntlet-plus-plus/sdks/go-gauntlet/client"
"net/http"
)

var (
Expand Down Expand Up @@ -56,21 +57,21 @@ func (sgpp *StarknetGauntletPlusPlus) BuildProviders(address string, rpcUrl stri
"url": rpcUrl,
"checkStatus": false,
}
RpcProvider := g.Provider{
RPCProvider := g.Provider{
Name: "basic-url",
Type: "@chainlink/gauntlet-starknet/lib/starknet.js/provider",
Input: toPointerMap(providerInput),
}

providers := []g.Provider{AccountProvider, SignerProvider, RpcProvider}
providers := []g.Provider{AccountProvider, SignerProvider, RPCProvider}

return &providers
}

// New StarknetGauntletPlusPlus creates a default g++ client with responses
func NewStarknetGauntletPlusPlus(gauntletPPEndpoint string, rpcUrl string, address string, privateKey string) (*StarknetGauntletPlusPlus, error) {
log.Info().Str("Creating G++ Client with Endpoint: ", string(gauntletPPEndpoint)).Msg("Gauntlet++")
log.Info().Str("Connecting G++ Client to RPC URL: ", string(rpcUrl)).Msg("Gauntlet++")
func NewStarknetGauntletPlusPlus(gauntletPPEndpoint string, rpcURL string, address string, privateKey string) (*StarknetGauntletPlusPlus, error) {
log.Info().Str("Creating G++ Client with Endpoint: ", gauntletPPEndpoint).Msg("Gauntlet++")
log.Info().Str("Connecting G++ Client to RPC URL: ", rpcURL).Msg("Gauntlet++")
newClient, err := g.NewClientWithResponses(gauntletPPEndpoint)

if err != nil {
Expand All @@ -80,7 +81,7 @@ func NewStarknetGauntletPlusPlus(gauntletPPEndpoint string, rpcUrl string, addre
sgpp = &StarknetGauntletPlusPlus{
client: newClient,
gr: &http.Response{},
providers: sgpp.BuildProviders(address, rpcUrl, privateKey),
providers: sgpp.BuildProviders(address, rpcURL, privateKey),
}

return sgpp, nil
Expand All @@ -94,18 +95,14 @@ func (sgpp *StarknetGauntletPlusPlus) ExtractValueFromResponseBody(report g.Repo
// Assert value to a string
if strValue, ok := value.(string); ok {
return strValue, nil
} else {
err := fmt.Errorf("parsed Value is not of type string")
return "", err
}
err := fmt.Errorf("parsed Value is not of type string")
return "", err
}
} else {
err := fmt.Errorf("output is not of type map[string]interface{}")
return "", err
}
} else {
err := fmt.Errorf("output is nil")
return "", err
}
return "", nil
}
Expand Down Expand Up @@ -137,7 +134,7 @@ func (sgpp *StarknetGauntletPlusPlus) execute(request *Request) error {
}

// Show request body
log.Info().Str("Request Body: ", string(tmp)).Msg("Gauntlet++")
log.Info().Str("Request Body: ", tmp).Msg("Gauntlet++")

headers := &g.PostExecuteParams{}
response, err := sgpp.client.PostExecuteWithResponse(context.Background(), headers, *body)
Expand Down

0 comments on commit 453cea8

Please sign in to comment.