-
Notifications
You must be signed in to change notification settings - Fork 2
Add Cadence lint target to Makefile #154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
f8d8e42
4bff0e3
72e36e8
ff6f39f
6d043e3
e5f14ef
99451de
59af50b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| .PHONY: test | ||
| test: | ||
| flow test --cover --covercode="contracts" --coverprofile="coverage.lcov" ./cadence/tests/*_test.cdc | ||
|
|
||
| .PHONY: lint | ||
| lint: | ||
| find cadence/contracts -name "*.cdc" | xargs flow cadence lint \ | ||
| | tee /dev/stderr | tail -n2 | grep -q "Lint passed" | ||
|
|
||
| .PHONY: ci | ||
| ci: lint test | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,7 +34,7 @@ access(all) contract FlowALPInterestRates { | |
| self.yearlyRate = yearlyRate | ||
| } | ||
|
|
||
| access(all) fun interestRate(creditBalance: UFix128, debitBalance: UFix128): UFix128 { | ||
| access(all) fun interestRate(creditBalance _: UFix128, debitBalance _1: UFix128): UFix128 { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this the right way to do this @turbolent ?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, prefixing with underscore works |
||
| return self.yearlyRate | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -755,7 +755,7 @@ access(all) contract FlowALPv0 { | |
| access(self) fun computeRequiredDepositForHealth( | ||
| position: &{FlowALPModels.InternalPosition}, | ||
| depositType: Type, | ||
| withdrawType: Type, | ||
| withdrawType _: Type, | ||
| effectiveCollateral: UFix128, | ||
| effectiveDebt: UFix128, | ||
| targetHealth: UFix128 | ||
|
|
@@ -1030,7 +1030,6 @@ access(all) contract FlowALPv0 { | |
|
|
||
| // assign issuance & repayment connectors within the InternalPosition | ||
| let iPos = self._borrowPosition(pid: id) | ||
| let fundsType = funds.getType() | ||
| iPos.setDrawDownSink(issuanceSink) | ||
| if repaymentSource != nil { | ||
| iPos.setTopUpSource(repaymentSource) | ||
|
|
@@ -1044,14 +1043,7 @@ access(all) contract FlowALPv0 { | |
| self._rebalancePositionNoLock(pid: id, force: true) | ||
| } | ||
|
|
||
| // Create a capability to the Pool for the Position resource | ||
| // The Pool is stored in the FlowALPv0 contract account | ||
| let poolCap = FlowALPv0.account.capabilities.storage.issue<auth(FlowALPModels.EPosition) &{FlowALPModels.PositionPool}>( | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was also mentioned as unused, is this leftover from our refactor @jordanschalm @nialexsan @liobrasil
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this is leftover from FLO-20 / PR #247. Before that refactor, each FLO-20 changed the design to use a single shared contract-level pool capability in |
||
| FlowALPv0.PoolStoragePath | ||
| ) | ||
|
|
||
| // Create and return the Position resource | ||
|
|
||
| let position <- FlowALPPositionResources.createPosition(id: id) | ||
|
|
||
| self.unlockPosition(id) | ||
|
|
@@ -1402,7 +1394,7 @@ access(all) contract FlowALPv0 { | |
| /// Returns a mutable reference to the pool's configuration. | ||
| /// Use this to update config fields that don't require events or side effects. | ||
| access(FlowALPModels.EGovernance) fun borrowConfig(): auth(FlowALPModels.EImplementation) &{FlowALPModels.PoolConfig} { | ||
| return &self.config as auth(FlowALPModels.EImplementation) &{FlowALPModels.PoolConfig} | ||
| return &self.config | ||
| } | ||
|
|
||
| /// Pauses the pool, temporarily preventing further withdrawals, deposits, and liquidations | ||
|
|
@@ -2240,7 +2232,7 @@ access(all) contract FlowALPv0 { | |
| ) | ||
| FlowALPv0.account.storage.save(<-pool, to: FlowALPv0.PoolStoragePath) | ||
| let cap = FlowALPv0.account.capabilities.storage.issue<&Pool>(FlowALPv0.PoolStoragePath) | ||
| FlowALPv0.account.capabilities.unpublish(FlowALPv0.PoolPublicPath) | ||
| let _ = FlowALPv0.account.capabilities.unpublish(FlowALPv0.PoolPublicPath) | ||
| FlowALPv0.account.capabilities.publish(cap, at: FlowALPv0.PoolPublicPath) | ||
| } | ||
| } | ||
|
|
@@ -2282,7 +2274,6 @@ access(all) contract FlowALPv0 { | |
| <-create PoolFactory(), | ||
| to: self.PoolFactoryPath | ||
| ) | ||
| let factory = self.account.storage.borrow<&PoolFactory>(from: self.PoolFactoryPath)! | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and this as well @jordanschalm @nialexsan @liobrasil
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one does not come from the February split. The exact local So there is no separate later commit where it transitions from used -> unused; it was introduced unused. This is an older dead local carried forward through later renames/refactors, not something introduced by the February split. |
||
| FlowALPPositionResources.setPoolCap(cap: self._borrowPool()) | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if we want onflow/FlowYieldVaults#223 (comment) here, cc @holyfuchs