-
Notifications
You must be signed in to change notification settings - Fork 30
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
2024-09-26 FE Release #3155
2024-09-26 FE Release #3155
Changes from 70 commits
89907ce
b07d94e
6e41b29
9049299
7a118c9
0b64779
d4d1c5a
bf22448
5052439
a03677e
4ed82b0
1b821a0
965736b
fd1540d
8e12c27
4f4c201
b1eca8a
86415c0
49cf94d
01ec2d4
8127a4c
d7599c3
c262b01
c32b70b
ce1defe
304ecda
fd0aecb
23f6c4c
dd67210
4a0f2e7
1eb52a0
3b507bd
f4101f2
4cb5d73
1891fed
4680ddc
faf9387
8c702c7
9418b40
1eb6fa0
6f21b1a
1de17e0
b6651b1
0daec70
74b620e
038605d
98362bb
67a04cd
c15ec86
11ac650
8113d0b
e89b363
7594100
6ec996d
ceff8bc
3af3438
3e75b0d
2e808e6
1bdfee6
2709e85
9742f8f
abeea4d
fc6ddae
90ac800
fe71628
5c8a069
65ee496
1c5e21d
4a45bcf
d8338fe
f0b13bc
96bf50f
e897b18
ebf102c
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 | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -110,7 +110,6 @@ jobs: | |||||||||||||||||||||||||||||||||||
env: | ||||||||||||||||||||||||||||||||||||
VERCEL_PROJECT_ID: ${{ steps.project_id.outputs.VERCEL_PROJECT_ID}} | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
cancel-outdated: | ||||||||||||||||||||||||||||||||||||
name: Cancel Outdated Jobs | ||||||||||||||||||||||||||||||||||||
runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||
|
@@ -130,6 +129,9 @@ jobs: | |||||||||||||||||||||||||||||||||||
fail-fast: false | ||||||||||||||||||||||||||||||||||||
matrix: | ||||||||||||||||||||||||||||||||||||
package: ${{ fromJson(needs.changes.outputs.packages) }} | ||||||||||||||||||||||||||||||||||||
# Slither is irrelevant for solidity-devops, as it only contains devops scripts rather than deployed contracts | ||||||||||||||||||||||||||||||||||||
exclude: | ||||||||||||||||||||||||||||||||||||
- package: solidity-devops | ||||||||||||||||||||||||||||||||||||
permissions: | ||||||||||||||||||||||||||||||||||||
# always required | ||||||||||||||||||||||||||||||||||||
security-events: write | ||||||||||||||||||||||||||||||||||||
|
@@ -138,40 +140,34 @@ jobs: | |||||||||||||||||||||||||||||||||||
contents: read | ||||||||||||||||||||||||||||||||||||
steps: | ||||||||||||||||||||||||||||||||||||
- name: Checkout repository | ||||||||||||||||||||||||||||||||||||
if: ${{ matrix.package != 'solidity-devops' }} | ||||||||||||||||||||||||||||||||||||
uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||
with: | ||||||||||||||||||||||||||||||||||||
fetch-depth: 2 | ||||||||||||||||||||||||||||||||||||
submodules: 'recursive' | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
- name: Setup NodeJS | ||||||||||||||||||||||||||||||||||||
if: ${{ matrix.package != 'solidity-devops' }} | ||||||||||||||||||||||||||||||||||||
uses: ./.github/actions/setup-nodejs | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
- name: Install Foundry | ||||||||||||||||||||||||||||||||||||
if: ${{ matrix.package != 'solidity-devops' }} | ||||||||||||||||||||||||||||||||||||
uses: foundry-rs/foundry-toolchain@v1 | ||||||||||||||||||||||||||||||||||||
with: | ||||||||||||||||||||||||||||||||||||
version: nightly | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
# TODO: find a flag for this | ||||||||||||||||||||||||||||||||||||
- name: Delete Untested Files | ||||||||||||||||||||||||||||||||||||
if: ${{ matrix.package != 'solidity-devops' }} | ||||||||||||||||||||||||||||||||||||
working-directory: './packages/${{matrix.package}}' | ||||||||||||||||||||||||||||||||||||
run: | | ||||||||||||||||||||||||||||||||||||
rm -rf test/ || true | ||||||||||||||||||||||||||||||||||||
rm -rf script/ || true | ||||||||||||||||||||||||||||||||||||
- name: Build Contracts | ||||||||||||||||||||||||||||||||||||
if: ${{ matrix.package != 'solidity-devops' }} | ||||||||||||||||||||||||||||||||||||
# TODO: unforunately, as of now concurrency needs to be 1 since if multiple instances of forge try to install the same version | ||||||||||||||||||||||||||||||||||||
# of solc at the same time, we get "text file busy" errors. See https://github.com/synapsecns/sanguine/actions/runs/8457116792/job/23168392860?pr=2234 | ||||||||||||||||||||||||||||||||||||
# for an example. | ||||||||||||||||||||||||||||||||||||
run: | | ||||||||||||||||||||||||||||||||||||
npx lerna exec npm run build:slither --concurrency=1 | ||||||||||||||||||||||||||||||||||||
- name: Run Slither | ||||||||||||||||||||||||||||||||||||
if: ${{ matrix.package != 'solidity-devops' }} | ||||||||||||||||||||||||||||||||||||
uses: crytic/slither-action@v0.3.0 | ||||||||||||||||||||||||||||||||||||
continue-on-error: true | ||||||||||||||||||||||||||||||||||||
id: slither | ||||||||||||||||||||||||||||||||||||
|
@@ -183,7 +179,7 @@ jobs: | |||||||||||||||||||||||||||||||||||
solc-version: 0.8.17 | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
- name: Upload SARIF file | ||||||||||||||||||||||||||||||||||||
if: ${{!github.event.repository.private && matrix.package != 'solidity-devops'}} | ||||||||||||||||||||||||||||||||||||
if: ${{!github.event.repository.private}} | ||||||||||||||||||||||||||||||||||||
uses: github/codeql-action/upload-sarif@v2 | ||||||||||||||||||||||||||||||||||||
with: | ||||||||||||||||||||||||||||||||||||
sarif_file: ./results.sarif | ||||||||||||||||||||||||||||||||||||
|
@@ -199,28 +195,32 @@ jobs: | |||||||||||||||||||||||||||||||||||
package: ${{ fromJson(needs.changes.outputs.packages) }} | ||||||||||||||||||||||||||||||||||||
steps: | ||||||||||||||||||||||||||||||||||||
- uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||
if: ${{ matrix.package != 'solidity-devops' }} | ||||||||||||||||||||||||||||||||||||
with: | ||||||||||||||||||||||||||||||||||||
submodules: recursive | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
- name: Setup Node JS | ||||||||||||||||||||||||||||||||||||
if: ${{ matrix.package != 'solidity-devops' }} | ||||||||||||||||||||||||||||||||||||
uses: ./.github/actions/setup-nodejs | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
- name: Installing dependencies | ||||||||||||||||||||||||||||||||||||
if: ${{ matrix.package != 'solidity-devops' }} | ||||||||||||||||||||||||||||||||||||
run: yarn install --immutable | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
- name: Install Foundry | ||||||||||||||||||||||||||||||||||||
if: ${{ matrix.package != 'solidity-devops' }} | ||||||||||||||||||||||||||||||||||||
uses: foundry-rs/foundry-toolchain@v1 | ||||||||||||||||||||||||||||||||||||
with: | ||||||||||||||||||||||||||||||||||||
version: nightly | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
- name: Run Foundry Tests | ||||||||||||||||||||||||||||||||||||
working-directory: './packages/${{matrix.package}}' | ||||||||||||||||||||||||||||||||||||
run: forge test -vvv | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
# We skip only the coverage steps for solidity-devops before we establish a good coverage there | ||||||||||||||||||||||||||||||||||||
- name: Run Foundry Coverage | ||||||||||||||||||||||||||||||||||||
if: ${{ matrix.package != 'solidity-devops' }} | ||||||||||||||||||||||||||||||||||||
working-directory: './packages/${{matrix.package}}' | ||||||||||||||||||||||||||||||||||||
run: forge coverage -vvv --report lcov --report summary >> $GITHUB_STEP_SUMMARY | ||||||||||||||||||||||||||||||||||||
run: forge coverage --report lcov --report summary >> $GITHUB_STEP_SUMMARY | ||||||||||||||||||||||||||||||||||||
# Limit the number of fuzz runs to speed up the coverage | ||||||||||||||||||||||||||||||||||||
env: | ||||||||||||||||||||||||||||||||||||
FOUNDRY_FUZZ_RUNS: 10 | ||||||||||||||||||||||||||||||||||||
Comment on lines
+216
to
+223
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. LGTM: Improved coverage configuration and output The changes to the "Run Foundry Coverage" step are well-thought-out:
There's a minor shell scripting issue in the - run: forge coverage --report lcov --report summary >> $GITHUB_STEP_SUMMARY
+ run: forge coverage --report lcov --report summary >> "$GITHUB_STEP_SUMMARY" This change ensures that the 📝 Committable suggestion
Suggested change
🧰 Tools🪛 actionlint
|
||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
- name: Send Coverage (Codecov) | ||||||||||||||||||||||||||||||||||||
if: ${{ matrix.package != 'solidity-devops' }} | ||||||||||||||||||||||||||||||||||||
|
@@ -236,39 +236,62 @@ jobs: | |||||||||||||||||||||||||||||||||||
attempt_limit: 5 | ||||||||||||||||||||||||||||||||||||
attempt_delay: 30000 | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
snapshot: | ||||||||||||||||||||||||||||||||||||
gas-diff: | ||||||||||||||||||||||||||||||||||||
runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||
name: Foundry Gas Snapshot | ||||||||||||||||||||||||||||||||||||
name: Foundry Gas Diff | ||||||||||||||||||||||||||||||||||||
if: ${{ needs.changes.outputs.package_count > 0 }} | ||||||||||||||||||||||||||||||||||||
needs: changes | ||||||||||||||||||||||||||||||||||||
strategy: | ||||||||||||||||||||||||||||||||||||
fail-fast: false | ||||||||||||||||||||||||||||||||||||
matrix: | ||||||||||||||||||||||||||||||||||||
package: ${{ fromJson(needs.changes.outputs.packages) }} | ||||||||||||||||||||||||||||||||||||
# Gas diff is irrelevant for solidity-devops, as it only contains devops scripts rather than deployed contracts | ||||||||||||||||||||||||||||||||||||
exclude: | ||||||||||||||||||||||||||||||||||||
- package: solidity-devops | ||||||||||||||||||||||||||||||||||||
steps: | ||||||||||||||||||||||||||||||||||||
- uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||
if: ${{ matrix.package != 'solidity-devops' }} | ||||||||||||||||||||||||||||||||||||
with: | ||||||||||||||||||||||||||||||||||||
submodules: recursive | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
- name: Setup Node JS | ||||||||||||||||||||||||||||||||||||
if: ${{ matrix.package != 'solidity-devops' }} | ||||||||||||||||||||||||||||||||||||
uses: ./.github/actions/setup-nodejs | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
- name: Installing dependencies | ||||||||||||||||||||||||||||||||||||
if: ${{ matrix.package != 'solidity-devops' }} | ||||||||||||||||||||||||||||||||||||
run: yarn install --immutable | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
- name: Install Foundry | ||||||||||||||||||||||||||||||||||||
if: ${{ matrix.package != 'solidity-devops' }} | ||||||||||||||||||||||||||||||||||||
uses: foundry-rs/foundry-toolchain@v1 | ||||||||||||||||||||||||||||||||||||
with: | ||||||||||||||||||||||||||||||||||||
version: nightly | ||||||||||||||||||||||||||||||||||||
- name: Run snapshot | ||||||||||||||||||||||||||||||||||||
if: ${{ matrix.package != 'solidity-devops' }} | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
# TODO: consider defining a package-specific script for this | ||||||||||||||||||||||||||||||||||||
- name: Run tests and generate gas report | ||||||||||||||||||||||||||||||||||||
working-directory: './packages/${{matrix.package}}' | ||||||||||||||||||||||||||||||||||||
run: forge snapshot >> $GITHUB_STEP_SUMMARY | ||||||||||||||||||||||||||||||||||||
# Excluding tests with reverts to get accurate average gas cost estimates | ||||||||||||||||||||||||||||||||||||
run: forge test --nmt "(fail|revert)" --gas-report > "../../gas-report-${{ matrix.package }}.ansi" | ||||||||||||||||||||||||||||||||||||
env: | ||||||||||||||||||||||||||||||||||||
# make fuzzing semi-deterministic to avoid noisy gas cost estimation | ||||||||||||||||||||||||||||||||||||
# due to non-deterministic fuzzing (but still use pseudo-random fuzzing seeds) | ||||||||||||||||||||||||||||||||||||
FOUNDRY_FUZZ_SEED: 0x${{ github.event.pull_request.base.sha || github.sha }} | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
- name: Compare gas reports | ||||||||||||||||||||||||||||||||||||
uses: Rubilmax/foundry-gas-diff@v3.18 | ||||||||||||||||||||||||||||||||||||
with: | ||||||||||||||||||||||||||||||||||||
ignore: 'test/**/*' | ||||||||||||||||||||||||||||||||||||
report: 'gas-report-${{ matrix.package }}.ansi' | ||||||||||||||||||||||||||||||||||||
sortCriteria: avg | ||||||||||||||||||||||||||||||||||||
sortOrders: desc | ||||||||||||||||||||||||||||||||||||
summaryQuantile: 0.5 | ||||||||||||||||||||||||||||||||||||
id: gas_diff | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
- name: Add gas diff to sticky comment | ||||||||||||||||||||||||||||||||||||
if: ${{ github.event_name == 'pull_request' || github.event_name == 'pull_request_target' }} | ||||||||||||||||||||||||||||||||||||
uses: marocchino/sticky-pull-request-comment@v2 | ||||||||||||||||||||||||||||||||||||
with: | ||||||||||||||||||||||||||||||||||||
# delete the comment in case changes no longer impact gas costs | ||||||||||||||||||||||||||||||||||||
delete: ${{ !steps.gas_diff.outputs.markdown }} | ||||||||||||||||||||||||||||||||||||
message: ${{ steps.gas_diff.outputs.markdown }} | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
size-check: | ||||||||||||||||||||||||||||||||||||
name: Foundry Size Check | ||||||||||||||||||||||||||||||||||||
runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||
|
@@ -278,25 +301,24 @@ jobs: | |||||||||||||||||||||||||||||||||||
fail-fast: false | ||||||||||||||||||||||||||||||||||||
matrix: | ||||||||||||||||||||||||||||||||||||
package: ${{ fromJson(needs.changes.outputs.packages) }} | ||||||||||||||||||||||||||||||||||||
# Size check is irrelevant for solidity-devops, as it only contains devops scripts rather than deployed contracts | ||||||||||||||||||||||||||||||||||||
exclude: | ||||||||||||||||||||||||||||||||||||
- package: solidity-devops | ||||||||||||||||||||||||||||||||||||
steps: | ||||||||||||||||||||||||||||||||||||
- uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||
if: ${{ matrix.package != 'solidity-devops' }} | ||||||||||||||||||||||||||||||||||||
with: | ||||||||||||||||||||||||||||||||||||
submodules: recursive | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
- name: Setup Node JS | ||||||||||||||||||||||||||||||||||||
if: ${{ matrix.package != 'solidity-devops' }} | ||||||||||||||||||||||||||||||||||||
uses: ./.github/actions/setup-nodejs | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
- name: Install Foundry | ||||||||||||||||||||||||||||||||||||
if: ${{ matrix.package != 'solidity-devops' }} | ||||||||||||||||||||||||||||||||||||
uses: foundry-rs/foundry-toolchain@v1 | ||||||||||||||||||||||||||||||||||||
with: | ||||||||||||||||||||||||||||||||||||
version: nightly | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
# This will run https://book.getfoundry.sh/reference/forge/forge-build#build-options | ||||||||||||||||||||||||||||||||||||
- name: Run forge build --sizes | ||||||||||||||||||||||||||||||||||||
if: ${{ matrix.package != 'solidity-devops' }} | ||||||||||||||||||||||||||||||||||||
run: | | ||||||||||||||||||||||||||||||||||||
forge build --sizes | ||||||||||||||||||||||||||||||||||||
working-directory: './packages/${{matrix.package}}' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
{ | ||
"editor.fontLigatures": "'calt', 'liga', 'ss01', 'ss02', 'ss03', 'ss04', 'ss05', 'ss06', 'ss07', 'ss08', 'ss09'", | ||
"[solidity]": { | ||
"editor.defaultFormatter": "JuanBlanco.solidity" | ||
}, | ||
"[typescript]": { | ||
"editor.defaultFormatter": "dbaeumer.vscode-eslint" | ||
}, | ||
|
@@ -16,11 +19,8 @@ | |
"eslint.format.enable": true, | ||
"editorconfig.generateAuto": false, | ||
"files.trimTrailingWhitespace": true, | ||
"solidity.packageDefaultDependenciesContractsDirectory": "contracts", | ||
"solidity.packageDefaultDependenciesDirectory": "lib", | ||
"solidity.compileUsingRemoteVersion": "v0.8.17+commit.8df45f5f", | ||
"solidity.formatter": "prettier", | ||
"solidity.defaultCompiler": "remote", | ||
"solidity.formatter": "forge", | ||
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. Tip Codebase Verification Solidity formatter change to 'forge' may be ineffective due to missing 'forge' command. The Analysis chainVerify the impact of changing Solidity formatter to forge. Changing the Solidity formatter from "prettier" to "forge" is consistent with the new default formatter configuration. However, this change might affect the formatting style of existing Solidity files. Please run the following script to check the impact on Solidity files: Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Check the impact of changing Solidity formatter to forge
# Test: List all Solidity files that might be affected
echo "Solidity files that might be affected:"
fd -e sol
# Test: Show a diff of formatting changes (if forge is available)
if command -v forge &> /dev/null
then
echo "Formatting diff (sample of up to 5 files):"
fd -e sol | head -n 5 | xargs -I {} sh -c 'echo "File: {}"; forge fmt --check {}'
else
echo "Note: 'forge' command not found. Unable to show formatting diff."
fi
Length of output: 14973 |
||
"solidity.monoRepoSupport": true, | ||
"tailwindCSS.classAttributes": [ | ||
".*class.*", | ||
".*Class.*", | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -25,6 +25,7 @@ import ( | |||||||||||||
"github.com/synapsecns/sanguine/core/retry" | ||||||||||||||
"github.com/synapsecns/sanguine/ethergo/chaindata" | ||||||||||||||
"github.com/synapsecns/sanguine/ethergo/client" | ||||||||||||||
"github.com/synapsecns/sanguine/ethergo/submitter" | ||||||||||||||
rfqClient "github.com/synapsecns/sanguine/services/rfq/api/client" | ||||||||||||||
"github.com/synapsecns/sanguine/services/rfq/contracts/fastbridge" | ||||||||||||||
"github.com/synapsecns/sanguine/services/rfq/relayer/relapi" | ||||||||||||||
|
@@ -347,17 +348,12 @@ func (b *Bot) rfqRefund() *slacker.CommandDefinition { | |||||||||||||
return | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
var txHash *relapi.TxHashByNonceResponse | ||||||||||||||
var status submitter.SubmissionStatus | ||||||||||||||
err = retry.WithBackoff( | ||||||||||||||
ctx.Context(), | ||||||||||||||
func(ctx context.Context) error { | ||||||||||||||
txHash, err = relClient.GetTxHashByNonce( | ||||||||||||||
ctx, | ||||||||||||||
&relapi.GetTxByNonceRequest{ | ||||||||||||||
ChainID: rawRequest.OriginChainID, | ||||||||||||||
Nonce: nonce, | ||||||||||||||
}) | ||||||||||||||
if err != nil { | ||||||||||||||
status, err = b.submitter.GetSubmissionStatus(ctx, big.NewInt(int64(rawRequest.OriginChainID)), nonce) | ||||||||||||||
if err != nil || !status.HasTx() { | ||||||||||||||
b.logger.Errorf(ctx, "error fetching quote request: %v", err) | ||||||||||||||
return fmt.Errorf("error fetching quote request: %w", err) | ||||||||||||||
Comment on lines
+356
to
358
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. Correct the error messages to reflect the actual operation. The error messages in the logging and returned error incorrectly state "error fetching quote request," but the code is fetching the submission status. To avoid confusion and improve clarity, please update the error messages to accurately describe the error. Apply this diff to correct the error messages: - b.logger.Errorf(ctx, "error fetching quote request: %v", err)
+ b.logger.Errorf(ctx, "error fetching submission status: %v", err)
- return fmt.Errorf("error fetching quote request: %w", err)
+ return fmt.Errorf("error fetching submission status: %w", err) Committable suggestion
Suggested change
|
||||||||||||||
} | ||||||||||||||
|
@@ -373,7 +369,7 @@ func (b *Bot) rfqRefund() *slacker.CommandDefinition { | |||||||||||||
return | ||||||||||||||
} | ||||||||||||||
|
||||||||||||||
_, err = ctx.Response().Reply(fmt.Sprintf("refund submitted: %s", toExplorerSlackLink(txHash.Hash))) | ||||||||||||||
_, err = ctx.Response().Reply(fmt.Sprintf("refund submitted: %s", toExplorerSlackLink(status.TxHash().String()))) | ||||||||||||||
if err != nil { | ||||||||||||||
log.Println(err) | ||||||||||||||
} | ||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -3,6 +3,7 @@ package commandline | |||||||||||||||||||||||||||||||||||||||||||||||
import ( | ||||||||||||||||||||||||||||||||||||||||||||||||
"context" | ||||||||||||||||||||||||||||||||||||||||||||||||
"fmt" | ||||||||||||||||||||||||||||||||||||||||||||||||
"k8s.io/apimachinery/pkg/util/sets" | ||||||||||||||||||||||||||||||||||||||||||||||||
"os" | ||||||||||||||||||||||||||||||||||||||||||||||||
"os/signal" | ||||||||||||||||||||||||||||||||||||||||||||||||
"os/user" | ||||||||||||||||||||||||||||||||||||||||||||||||
|
@@ -90,11 +91,18 @@ func GenerateShellCommand(shellCommands []*cli.Command) *cli.Command { | |||||||||||||||||||||||||||||||||||||||||||||||
// pruneShellCommands gets a list of commands including the shell command. | ||||||||||||||||||||||||||||||||||||||||||||||||
func pruneShellCommands(commands []*cli.Command) (prunedCommands []*cli.Command) { | ||||||||||||||||||||||||||||||||||||||||||||||||
// initialize shell commands | ||||||||||||||||||||||||||||||||||||||||||||||||
nameSet := sets.NewString() | ||||||||||||||||||||||||||||||||||||||||||||||||
for _, command := range commands { | ||||||||||||||||||||||||||||||||||||||||||||||||
if command.Name != shellCommandName { | ||||||||||||||||||||||||||||||||||||||||||||||||
prunedCommands = append(prunedCommands, command) | ||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||
if !nameSet.Has(command.Name) { | ||||||||||||||||||||||||||||||||||||||||||||||||
fmt.Printf("Command %s already exists, skipping\n", command.Name) | ||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||
nameSet.Insert(command.Name) | ||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+94
to
+105
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. Fix logic for handling duplicate command names. The current implementation has a few issues:
Please apply the following changes to fix these issues: func pruneShellCommands(commands []*cli.Command) (prunedCommands []*cli.Command) {
// initialize shell commands
nameSet := sets.NewString()
for _, command := range commands {
- if command.Name != shellCommandName {
- prunedCommands = append(prunedCommands, command)
- }
- if !nameSet.Has(command.Name) {
- fmt.Printf("Command %s already exists, skipping\n", command.Name)
+ if command.Name == shellCommandName {
+ continue
}
-
- nameSet.Insert(command.Name)
+ if nameSet.Has(command.Name) {
+ fmt.Printf("Command %s already exists, skipping\n", command.Name)
+ continue
+ }
+ nameSet.Insert(command.Name)
+ prunedCommands = append(prunedCommands, command)
}
return prunedCommands
} These changes will:
📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||
return prunedCommands | ||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"[solidity]": { | ||
"editor.defaultFormatter": "JuanBlanco.solidity" | ||
}, | ||
"solidity.formatter": "forge", | ||
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. Tip Codebase Verification Issue: Forge is set as Solidity formatter but is not installed Forge is specified as the Solidity formatter in the settings, but it is not installed in the development environment. Please install Forge to ensure the formatter works correctly.
Analysis chainLGTM: Forge set as Solidity formatter Using Forge as the Solidity formatter is a good choice, aligning with modern development practices. Ensure that Forge is installed and properly configured in the development environment. Run the following command to verify: Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Check if Forge is installed
if command -v forge &> /dev/null
then
echo "Forge is installed. Version:"
forge --version
else
echo "Forge is not installed. Please install it to use the specified formatter."
fi
Length of output: 175 |
||
"solidity.monoRepoSupport": false | ||
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. Tip Codebase Verification Mono-repo support setting may be misconfigured The project structure indicates a monorepo setup with multiple packages and services. Consider setting
Analysis chainVerify project structure for mono-repo setting The Please confirm that this setting aligns with the project's structure. You can verify this by checking the root directory structure: If you see multiple packages or projects at the same level, you might need to reconsider this setting. Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Check the root directory structure
echo "Project root structure:"
ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\// /g' -e 's/^/ /' -e 's/-/|/'
Length of output: 17137 |
||
} |
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.
Fix potential shell scripting issue
There's a potential issue with the shell command on this line. Unquoted variables can lead to unexpected behavior if they contain spaces or special characters.
To address this, please modify the line as follows:
This change ensures that the
$GITHUB_STEP_SUMMARY
variable is properly quoted, preventing potential issues with globbing and word splitting.📝 Committable suggestion
🧰 Tools
actionlint