Skip to content

Commit 6a2915e

Browse files
committed
remove duplicated methods
1 parent 2d8788b commit 6a2915e

5 files changed

Lines changed: 0 additions & 128 deletions

cadence/tests/rebalance_scenario2_test.cdc

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,6 @@ access(all) let targetHealthFactor = 1.3
2323

2424
access(all) var snapshot: UInt64 = 0
2525

26-
// Helper function to get Flow collateral from position
27-
access(all) fun getFlowCollateralFromPosition(pid: UInt64): UFix64 {
28-
let positionDetails = getPositionDetails(pid: pid, beFailed: false)
29-
for balance in positionDetails.balances {
30-
if balance.vaultType == Type<@FlowToken.Vault>() {
31-
// Credit means it's a deposit (collateral)
32-
if balance.direction.rawValue == 0 { // Credit = 0
33-
return balance.balance
34-
}
35-
}
36-
}
37-
return 0.0
38-
}
39-
40-
41-
4226
// Enhanced diagnostic precision tracking function with full call stack tracing
4327
access(all) fun performDiagnosticPrecisionTrace(
4428
yieldVaultID: UInt64,

cadence/tests/rebalance_scenario3a_test.cdc

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -23,34 +23,6 @@ access(all) let targetHealthFactor = 1.3
2323

2424
access(all) var snapshot: UInt64 = 0
2525

26-
// Helper function to get Flow collateral from position
27-
access(all) fun getFlowCollateralFromPosition(pid: UInt64): UFix64 {
28-
let positionDetails = getPositionDetails(pid: pid, beFailed: false)
29-
for balance in positionDetails.balances {
30-
if balance.vaultType == Type<@FlowToken.Vault>() {
31-
// Credit means it's a deposit (collateral)
32-
if balance.direction == FlowALPv0.BalanceDirection.Credit {
33-
return balance.balance
34-
}
35-
}
36-
}
37-
return 0.0
38-
}
39-
40-
// Helper function to get MOET debt from position
41-
access(all) fun getMOETDebtFromPosition(pid: UInt64): UFix64 {
42-
let positionDetails = getPositionDetails(pid: pid, beFailed: false)
43-
for balance in positionDetails.balances {
44-
if balance.vaultType == Type<@MOET.Vault>() {
45-
// Debit means it's borrowed (debt)
46-
if balance.direction == FlowALPv0.BalanceDirection.Debit {
47-
return balance.balance
48-
}
49-
}
50-
}
51-
return 0.0
52-
}
53-
5426
access(all)
5527
fun setup() {
5628
deployContracts()

cadence/tests/rebalance_scenario3b_test.cdc

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -23,34 +23,6 @@ access(all) let targetHealthFactor = 1.3
2323

2424
access(all) var snapshot: UInt64 = 0
2525

26-
// Helper function to get Flow collateral from position
27-
access(all) fun getFlowCollateralFromPosition(pid: UInt64): UFix64 {
28-
let positionDetails = getPositionDetails(pid: pid, beFailed: false)
29-
for balance in positionDetails.balances {
30-
if balance.vaultType == Type<@FlowToken.Vault>() {
31-
// Credit means it's a deposit (collateral)
32-
if balance.direction.rawValue == 0 { // Credit = 0
33-
return balance.balance
34-
}
35-
}
36-
}
37-
return 0.0
38-
}
39-
40-
// Helper function to get MOET debt from position
41-
access(all) fun getMOETDebtFromPosition(pid: UInt64): UFix64 {
42-
let positionDetails = getPositionDetails(pid: pid, beFailed: false)
43-
for balance in positionDetails.balances {
44-
if balance.vaultType == Type<@MOET.Vault>() {
45-
// Debit means it's borrowed (debt)
46-
if balance.direction.rawValue == 1 { // Debit = 1
47-
return balance.balance
48-
}
49-
}
50-
}
51-
return 0.0
52-
}
53-
5426
access(all)
5527
fun setup() {
5628
deployContracts()

cadence/tests/rebalance_scenario3c_test.cdc

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -23,34 +23,6 @@ access(all) let targetHealthFactor = 1.3
2323

2424
access(all) var snapshot: UInt64 = 0
2525

26-
// Helper function to get Flow collateral from position
27-
access(all) fun getFlowCollateralFromPosition(pid: UInt64): UFix64 {
28-
let positionDetails = getPositionDetails(pid: pid, beFailed: false)
29-
for balance in positionDetails.balances {
30-
if balance.vaultType == Type<@FlowToken.Vault>() {
31-
// Credit means it's a deposit (collateral)
32-
if balance.direction == FlowALPv0.BalanceDirection.Credit {
33-
return balance.balance
34-
}
35-
}
36-
}
37-
return 0.0
38-
}
39-
40-
// Helper function to get MOET debt from position
41-
access(all) fun getMOETDebtFromPosition(pid: UInt64): UFix64 {
42-
let positionDetails = getPositionDetails(pid: pid, beFailed: false)
43-
for balance in positionDetails.balances {
44-
if balance.vaultType == Type<@MOET.Vault>() {
45-
// Debit means it's borrowed (debt)
46-
if balance.direction == FlowALPv0.BalanceDirection.Debit {
47-
return balance.balance
48-
}
49-
}
50-
}
51-
return 0.0
52-
}
53-
5426
access(all)
5527
fun setup() {
5628
deployContracts()

cadence/tests/rebalance_scenario3d_test.cdc

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -23,34 +23,6 @@ access(all) let targetHealthFactor = 1.3
2323

2424
access(all) var snapshot: UInt64 = 0
2525

26-
// Helper function to get Flow collateral from position
27-
access(all) fun getFlowCollateralFromPosition(pid: UInt64): UFix64 {
28-
let positionDetails = getPositionDetails(pid: pid, beFailed: false)
29-
for balance in positionDetails.balances {
30-
if balance.vaultType == Type<@FlowToken.Vault>() {
31-
// Credit means it's a deposit (collateral)
32-
if balance.direction == FlowALPv0.BalanceDirection.Credit {
33-
return balance.balance
34-
}
35-
}
36-
}
37-
return 0.0
38-
}
39-
40-
// Helper function to get MOET debt from position
41-
access(all) fun getMOETDebtFromPosition(pid: UInt64): UFix64 {
42-
let positionDetails = getPositionDetails(pid: pid, beFailed: false)
43-
for balance in positionDetails.balances {
44-
if balance.vaultType == Type<@MOET.Vault>() {
45-
// Debit means it's borrowed (debt)
46-
if balance.direction == FlowALPv0.BalanceDirection.Debit {
47-
return balance.balance
48-
}
49-
}
50-
}
51-
return 0.0
52-
}
53-
5426
access(all)
5527
fun setup() {
5628
deployContracts()

0 commit comments

Comments
 (0)