Skip to content

Conversation

yogeshwar-bitgo
Copy link
Contributor

Ticket: WIN-6319

* @param network required to stringify addresses
* @return mapper function
*/
deprecatedMapOutputToEntry(network: FlareNetwork): (DeprecatedOutput) => Entry {

Check warning

Code scanning / CodeQL

Ineffective parameter type Warning

The parameter 'DeprecatedOutput' has type 'any', but its name coincides with the
imported type DeprecatedOutput
.

Copilot Autofix

AI 1 day ago

To fix the problem, change the function signature at line 272 to give the parameter of the returned arrow function both a name and a type. In this context, the returned function represents a mapping (output: DeprecatedOutput) => Entry, so the fix is to change the type from (DeprecatedOutput) => Entry to (output: DeprecatedOutput) => Entry. Only the function's type signature on line 272 needs to be changed; the implementation already uses the correct parameter name and type for output. No new imports or definitions are required.

Suggested changeset 1
modules/sdk-coin-flrp/src/lib/utils.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/modules/sdk-coin-flrp/src/lib/utils.ts b/modules/sdk-coin-flrp/src/lib/utils.ts
--- a/modules/sdk-coin-flrp/src/lib/utils.ts
+++ b/modules/sdk-coin-flrp/src/lib/utils.ts
@@ -269,7 +269,7 @@
    * @param network required to stringify addresses
    * @return mapper function
    */
-  deprecatedMapOutputToEntry(network: FlareNetwork): (DeprecatedOutput) => Entry {
+  deprecatedMapOutputToEntry(network: FlareNetwork): (output: DeprecatedOutput) => Entry {
     return (output: DeprecatedOutput) => {
       if (this.deprecatedIsTransferableOutput(output)) {
         // Simplified implementation for FlareJS
EOF
@@ -269,7 +269,7 @@
* @param network required to stringify addresses
* @return mapper function
*/
deprecatedMapOutputToEntry(network: FlareNetwork): (DeprecatedOutput) => Entry {
deprecatedMapOutputToEntry(network: FlareNetwork): (output: DeprecatedOutput) => Entry {
return (output: DeprecatedOutput) => {
if (this.deprecatedIsTransferableOutput(output)) {
// Simplified implementation for FlareJS
Copilot is powered by AI and may make mistakes. Always verify output.
* @param network required to stringify addresses
* @return mapper function
*/
mapOutputToEntry(network: FlareNetwork): (Output) => Entry {

Check warning

Code scanning / CodeQL

Ineffective parameter type Warning

The parameter 'Output' has type 'any', but its name coincides with the
imported type Output
.

Copilot Autofix

AI 1 day ago

The best way to fix the problem is to give the callback parameter in the returned function type both a name and a type. On line 305, change the function signature

mapOutputToEntry(network: FlareNetwork): (Output) => Entry {

to

mapOutputToEntry(network: FlareNetwork): (output: Output) => Entry {

so that the callback parameter is named output (which matches the function body) and typed as Output. No additional methods or imports are required, and this is a local change entirely on the signature line.

Suggested changeset 1
modules/sdk-coin-flrp/src/lib/utils.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/modules/sdk-coin-flrp/src/lib/utils.ts b/modules/sdk-coin-flrp/src/lib/utils.ts
--- a/modules/sdk-coin-flrp/src/lib/utils.ts
+++ b/modules/sdk-coin-flrp/src/lib/utils.ts
@@ -302,7 +302,7 @@
    * @param network required to stringify addresses
    * @return mapper function
    */
-  mapOutputToEntry(network: FlareNetwork): (Output) => Entry {
+  mapOutputToEntry(network: FlareNetwork): (output: Output) => Entry {
     return (output: Output) => {
       if (this.isTransferableOutput(output)) {
         const transferableOutput = output as TransferableOutput;
EOF
@@ -302,7 +302,7 @@
* @param network required to stringify addresses
* @return mapper function
*/
mapOutputToEntry(network: FlareNetwork): (Output) => Entry {
mapOutputToEntry(network: FlareNetwork): (output: Output) => Entry {
return (output: Output) => {
if (this.isTransferableOutput(output)) {
const transferableOutput = output as TransferableOutput;
Copilot is powered by AI and may make mistakes. Always verify output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant