From e8f5cf1fd1d652292f90b88be9a290edb7de920f Mon Sep 17 00:00:00 2001 From: Benjamin Bollen Date: Tue, 28 Nov 2023 13:49:48 +0000 Subject: [PATCH 1/3] (github/worklfow): add on: triggers; correct import error in tests --- .github/workflows/test.yml | 7 ++++++- src/circles/TemporalDiscount.sol | 3 +-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 09880b1..55cd993 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,11 @@ name: test -on: workflow_dispatch +on: + push: + branches: [ master, develop ] + pull_request: + branches: [ master, develop ] + workflow_dispatch: env: FOUNDRY_PROFILE: ci diff --git a/src/circles/TemporalDiscount.sol b/src/circles/TemporalDiscount.sol index 0debe3b..0a6e7a5 100644 --- a/src/circles/TemporalDiscount.sol +++ b/src/circles/TemporalDiscount.sol @@ -34,7 +34,7 @@ contract TemporalDiscount is IERC20 { /** * Store the signed 128-bit 64.64 representation of 1 as a constant */ - int128 internal constant ONE_64x64 = int128(2**64); + int128 internal constant ONE_64x64 = int128(2 ** 64); /** * Reduction factor gamma for temporally discounting balances @@ -249,7 +249,6 @@ contract TemporalDiscount is IERC20 { // and update the timespan in which we updated the balance. balanceTimeSpans[_owner] = _currentSpan; - // emit DiscountCost only when effectively discounted. // if the original balance was zero before adding, // discount cost can still be zero, even when discounted From 15fbe06ad729f265dca669c0c32b8cfa9f60c596 Mon Sep 17 00:00:00 2001 From: Benjamin Bollen Date: Tue, 28 Nov 2023 13:58:34 +0000 Subject: [PATCH 2/3] (test): resolving import of MockHub --- test/graph/Graph.t.sol | 2 +- test/graph/GraphPathTransfer.t.sol | 2 +- test/graph/{MockHubv1.sol => MockHub.sol} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename test/graph/{MockHubv1.sol => MockHub.sol} (100%) diff --git a/test/graph/Graph.t.sol b/test/graph/Graph.t.sol index 0ef3deb..0b5491a 100644 --- a/test/graph/Graph.t.sol +++ b/test/graph/Graph.t.sol @@ -7,7 +7,7 @@ import "../../src/graph/Graph.sol"; import "../../src/graph/ICircleNode.sol"; import "../../src/circles/TimeCircle.sol"; import "../../src/circles/GroupCircle.sol"; -import "./MockHubV1.sol"; +import "./MockHub.sol"; import "./MockInternalGraph.sol"; contract GraphTest is Test { diff --git a/test/graph/GraphPathTransfer.t.sol b/test/graph/GraphPathTransfer.t.sol index 7c0ec5e..9c22091 100644 --- a/test/graph/GraphPathTransfer.t.sol +++ b/test/graph/GraphPathTransfer.t.sol @@ -8,7 +8,7 @@ import "../../src/graph/ICircleNode.sol"; import "../../src/circles/TimeCircle.sol"; import "../../src/circles/GroupCircle.sol"; import "../setup/TimeSetup.sol"; -import "./MockHubV1.sol"; +import "./MockHub.sol"; contract GraphPathTransferTest is Test, TimeSetup { // Constant diff --git a/test/graph/MockHubv1.sol b/test/graph/MockHub.sol similarity index 100% rename from test/graph/MockHubv1.sol rename to test/graph/MockHub.sol From b1ec716b5e6c8e1a17fed5d13dcc85af0e624ba4 Mon Sep 17 00:00:00 2001 From: Benjamin Bollen Date: Tue, 28 Nov 2023 14:03:54 +0000 Subject: [PATCH 3/3] (workflow): add forge fmt --check as formatting check --- .github/workflows/test.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 55cd993..91bcba0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,6 +27,11 @@ jobs: with: version: nightly + - name: Check Code Formatting + run: | + forge fmt --check + id: formatting + - name: Run Forge build run: | forge --version