Skip to content

Commit 35a1b8e

Browse files
committed
address PR comments
1 parent 3b3fbe3 commit 35a1b8e

7 files changed

Lines changed: 30 additions & 45 deletions

File tree

.github/workflows/incrementfi_tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,7 @@ jobs:
2929
run: ./local/setup_wallets.sh
3030
- name: Install Flow deps
3131
run: flow deps install
32+
- name: Deploy contracts
33+
run: flow deploy
3234
- name: Setup IncrementFi
3335
run: ./local/incrementfi/setup_incrementfi.sh

cadence/transactions/mocks/incrementfi/create_pair.cdc

Lines changed: 0 additions & 10 deletions
This file was deleted.

cadence/transactions/mocks/incrementfi/setup.cdc

Lines changed: 2 additions & 4 deletions
Large diffs are not rendered by default.

flow.json

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,6 @@
2121
"testing": "0000000000000007"
2222
}
2323
},
24-
"DeFiActionsUtils": {
25-
"source": "./lib/DeFiActions/cadence/contracts/utils/DeFiActionsUtils.cdc",
26-
"aliases": {
27-
"emulator": "f8d6e0586b0a20c7",
28-
"testing": "0000000000000007"
29-
}
30-
},
3124
"FungibleTokenConnectors": {
3225
"source": "./lib/DeFiActions/cadence/contracts/connectors/FungibleTokenConnectors.cdc",
3326
"aliases": {
@@ -290,22 +283,6 @@
290283
},
291284
"deployments": {
292285
"emulator": {
293-
"mock-incrementfi": [
294-
"SwapConfig",
295-
"SwapInterfaces",
296-
"SwapError",
297-
{
298-
"name": "SwapFactory",
299-
"args": [
300-
{
301-
"value": "0xf3fcd2c1a78f5eee",
302-
"type": "Address"
303-
}
304-
]
305-
},
306-
"StableSwapFactory",
307-
"SwapRouter"
308-
],
309286
"emulator-account": [
310287
"DeFiActionsMathUtils",
311288
"DeFiActionsUtils",
@@ -345,7 +322,23 @@
345322
"TidalYieldAutoBalancers",
346323
"TidalYield",
347324
"TidalYieldStrategies"
325+
],
326+
"mock-incrementfi": [
327+
"SwapConfig",
328+
"SwapInterfaces",
329+
"SwapError",
330+
{
331+
"name": "SwapFactory",
332+
"args": [
333+
{
334+
"value": "0xf3fcd2c1a78f5eee",
335+
"type": "Address"
336+
}
337+
]
338+
},
339+
"StableSwapFactory",
340+
"SwapRouter"
348341
]
349342
}
350343
}
351-
}
344+
}

local/incrementfi/generate-swap-pair-tx.sh

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
TEMPLATE="./cadence/contracts/mocks/incrementfi/SwapPairTemplate.cdc"
44
OUTPUT="./cadence/contracts/mocks/incrementfi/SwapPair.cdc"
55

6-
TX="./cadence/transactions/mocks/incrementfi/setup.cdc"
7-
86
jq -r '
97
(.contracts, .dependencies)
108
| to_entries[]
@@ -15,10 +13,9 @@ jq -r '
1513
cp "$TEMPLATE" "$OUTPUT"
1614

1715
while read name address; do
18-
sed -i '' -E "s|^[[:space:]]*import[[:space:]]+\"${name}\"[[:space:]]*;?[[:space:]]*$|import ${name} from ${address}|g" "$OUTPUT"
16+
sed -i '' -E "s|^[[:space:]]*import[[:space:]]+\"${name}\"[[:space:]]*;?[[:space:]]*$|import ${name} from ${address}|g" "$OUTPUT"
1917
done < contracts_map.txt
2018

21-
HEX_STRING=$(xxd -p "$OUTPUT" | tr -d '\n')
22-
23-
sed -i '' -E "s|^[[:space:]]*let swapPairTemplateCode[[:space:]]*=[[:space:]]*\"[^\"]*\"| let swapPairTemplateCode = \"${HEX_STRING}\"|" $TX
19+
# Generate hex string
20+
xxd -p "$OUTPUT" | tr -d '\n'
2421

local/incrementfi/setup_incrementfi.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ flow transactions send "./cadence/transactions/flow-token/transfer_flow.cdc" 0xf
2020
MOET_IDENTIFIER=$(flow scripts execute ./cadence/scripts/mocks/incrementfi/get_moet_token_identifier.cdc | grep "^Result:" | sed -E 's/Result: "([^"]+)"/\1/')
2121
YIELD_IDENTIFIER=$(flow scripts execute ./cadence/scripts/mocks/incrementfi/get_yield_token_identifier.cdc | grep "^Result:" | sed -E 's/Result: "([^"]+)"/\1/')
2222

23-
flow transactions send ./cadence/transactions/mocks/incrementfi/setup.cdc --signer ${SIGNER}
23+
24+
SWAP_PAIR_HEX=$(./local/incrementfi/generate-swap-pair-tx.sh)
25+
26+
flow transactions send ./cadence/transactions/mocks/incrementfi/setup.cdc ${SWAP_PAIR_HEX} --signer ${SIGNER}
27+
2428
#
2529
# 3. transfer funds to FLOW, MOET, and YIELD vaults
2630
#

local/setup_wallets.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ flow accounts create --network "$FLOW_NETWORK" --key "$(cat $AMM_PUBKEY_PATH)"
77
flow accounts create --network "$FLOW_NETWORK" --key "$(cat $EVM_GATEWAY_PUBKEY_PATH)"
88

99
flow transactions send ./cadence/transactions/mocks/add_gw_keys.cdc --signer evm-gateway
10+

0 commit comments

Comments
 (0)