-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
93f0010
commit 5a0fd39
Showing
2 changed files
with
22 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,28 @@ | ||
package main | ||
|
||
import "fmt" | ||
|
||
const ( | ||
UptimeLeftKey = "UPTL-" | ||
FileKey = "FILE-" | ||
DowntimeKey = "DWNT-" | ||
import ( | ||
"fmt" | ||
"github.com/jackalLabs/canine-chain/v4/x/storage/types" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
//nolint:unused | ||
func makeUptimeKey(cid string) []byte { | ||
return []byte(fmt.Sprintf("%s%s", UptimeLeftKey, cid)) | ||
} | ||
func AddressGenerationCommand() *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "get-address [value]", | ||
Short: "Generate an address from text, the same system used to generate protocol owned accounts.", | ||
Args: cobra.ExactArgs(1), | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
|
||
//nolint:unused | ||
func makeFileKey(cid string) []byte { | ||
return []byte(fmt.Sprintf("%s%s", FileKey, cid)) | ||
} | ||
acc, err := types.GetAccount(args[0]) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
fmt.Printf("'%s' becomes: '%s'", args[0], acc.String()) | ||
|
||
return nil | ||
}, | ||
} | ||
|
||
//nolint:unused | ||
func makeDowntimeKey(cid string) []byte { | ||
return []byte(fmt.Sprintf("%s%s", DowntimeKey, cid)) | ||
return cmd | ||
} |