forked from uddugteam/oracle-flare
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'uddugteam:main' into main
- Loading branch information
Showing
9 changed files
with
276 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package whitelistall | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/spf13/cobra" | ||
|
||
"oracle-flare/internal" | ||
"oracle-flare/pkg/logger" | ||
) | ||
|
||
// Cmd returns the "whitelist" command of the application. | ||
// This command is responsible for initializing and adding given address for given token to the smart-contract whitelist | ||
func Cmd(app *internal.App) *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "whitelistall", | ||
Short: "Whitelist address for all tokens in the config file", | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
address, err := cmd.Flags().GetString("address") | ||
if err != nil { | ||
return fmt.Errorf("err get address flag: %w", err) | ||
} | ||
|
||
if err := app.InitForWhiteList(); err != nil { | ||
return fmt.Errorf("application initialisation: %w", err) | ||
} | ||
|
||
return app.WhiteListAddressAll(address) | ||
}, | ||
PreRun: func(cmd *cobra.Command, args []string) { | ||
logger.Log().Info(app.Version()) | ||
}, | ||
} | ||
|
||
cmd.Flags().String("address", "", "wallet address for whitelist") | ||
|
||
return cmd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.