Skip to content

Commit 910f7c2

Browse files
committed
e2e test
1 parent 77f7771 commit 910f7c2

3 files changed

Lines changed: 67 additions & 1 deletion

File tree

.github/workflows/e2e_tests.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: E2E test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
e2e-tests:
13+
name: Tidal Yield E2E Test
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
token: ${{ secrets.GH_PAT }}
19+
submodules: "true"
20+
- name: Set up Go
21+
uses: actions/setup-go@v3
22+
with:
23+
go-version: "1.23.x"
24+
- uses: actions/cache@v4
25+
with:
26+
path: ~/go/pkg/mod
27+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
28+
restore-keys: |
29+
${{ runner.os }}-go-
30+
- name: Install Flow CLI
31+
run: sh -ci "$(curl -fsSL https://raw.githubusercontent.com/onflow/flow-cli/master/install.sh)"
32+
- name: Flow CLI Version
33+
run: flow version
34+
- name: Update PATH
35+
run: echo "/root/.local/bin" >> $GITHUB_PATH
36+
- name: Install dependencies
37+
run: flow deps install --skip-alias --skip-deployments
38+
- name: Run Emulator
39+
run: ./local/run_emulator.sh
40+
- name: Setup Emulator
41+
run: ./local/setup_emulator.sh
42+
- name: Setup Wallets
43+
run: ./local/setup_wallets.sh
44+
- name: Run E2E test
45+
run: ./local/e2e_test.sh

local/e2e_test.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
echo_info "Grant Protocol Beta access to TidalYield..."
2+
flow transactions send ./lib/TidalProtocol/cadence/tests/transactions/tidal-protocol/pool-management/03_grant_beta.cdc --authorizer emulator-account,emulator-account --proposer emulator-account --payer emulator-account
3+
4+
echo_info "Grant Tide Beta access to test user..."
5+
flow transactions send ./cadence/transactions/tidal-yield/admin/grant_beta.cdc --authorizer emulator-account,test-user --proposer test-user --payer emulator-account
6+
7+
echo_info "Creating Tide[0]..."
8+
flow transactions send ./cadence/transactions/tidal-yield/create_tide.cdc \
9+
A.f8d6e0586b0a20c7.TidalYieldStrategies.TracerStrategy \
10+
A.0ae53cb6e3f42a79.FlowToken.Vault \
11+
100.0 \
12+
--signer test-user
13+
14+
echo_info "Depositing 20.0 to Tide[0]..."
15+
flow transactions send ./cadence/transactions/tidal-yield/deposit_to_tide.cdc 0 20.0 --signer test-user
16+
17+
echo_info "Withdrawing 10.0 from Tide[0]..."
18+
flow transactions send ./cadence/transactions/tidal-yield/withdraw_from_tide.cdc 0 10.0 --signer test-user
19+
20+
flow transactions send ../cadence/transactions/tidal-yield/close_tide.cdc 0 --signer test-user
21+

local/test-user.pkey

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0xb1a77d1b931e602dda3d70e6dcddbd8692b55940cc33a46c4e264b1d7415dd4f
1+
31e37343af5e04d79ebd3dfcc86ee70b44e539a85d0c2dde6c55ff25ff2ed368

0 commit comments

Comments
 (0)