Skip to content

Commit

Permalink
[CHANGE] Remove test key from repository
Browse files Browse the repository at this point in the history
  • Loading branch information
DarthMike committed Feb 14, 2023
1 parent 962f26d commit 8d5bfe4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@ jobs:
macos:
needs: lint
runs-on: macos-latest
env:
TESTS_PRIVATEKEY: ${{ secrets.TESTS_PRIVATEKEY }}
steps:
- uses: actions/checkout@v3
- name: SetupKey
run: ./scripts/setupKey.sh "${{ secrets.TESTS_PRIVATEKEY }}"
- name: Build
run: swift build -v
- name: Tests
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,4 @@ fastlane/screenshots
fastlane/test_output

scripts/bin/*
TestConfig_private.swift
4 changes: 4 additions & 0 deletions scripts/setupKey.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

# write first argument to a Test
echo "extension TestConfig {\nstatic let privateKey = \"$1\"\n}" > web3sTests/TestConfig_private.swift
6 changes: 3 additions & 3 deletions web3sTests/TestConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ struct TestConfig {
// This is the proxy wss URL for connecting to the Blockchain. For testing we usually use the Goerli network on Infura. Using free tier, so might hit rate limits
static let wssUrl = "wss://goerli.infura.io/ws/v3/b2f4b3f635d8425c96854c3d28ba6bb0"

// An EOA with some Ether, so that we can test sending transactions (pay for gas)
static let privateKey = "0xef4e182ae2cf32192d2a62c1159c8c4f7f2d658c303d0dfca5791a205456a132"
// An EOA with some Ether, so that we can test sending transactions (pay for gas). Set by CI
// static let privateKey = "SET_YOUR_KEY_HERE"

// This is the expected public key (address) from the above private key
static let publicKey = "0x719561fee351F7aC6560D0302aE415FfBEEc0B51"
static let publicKey = "0xE78e5ecb061fE3DD1672dDDA7b5116213B23B99A"

// A test ERC20 token contract (UNI)
static let erc20Contract = "0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984"
Expand Down

0 comments on commit 8d5bfe4

Please sign in to comment.