-
Notifications
You must be signed in to change notification settings - Fork 62
Feat/sync dev with master after v1.58.3 #332
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
6e349e8
(feat) Updated the proto definitions to match injective-core v1.16.4 …
aarmoa bd8bcac
(feat) added the downtime detector module to the codec configuration
aarmoa 8461bc0
(feat) Updated proto definitions to match Injective core v1.16.4 and …
aarmoa 05bd437
(fix) Updated the official tokens JSON files URLs
aarmoa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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,26 @@ | ||
| package types | ||
|
|
||
| import ( | ||
| "github.com/cosmos/cosmos-sdk/codec" | ||
| "github.com/cosmos/cosmos-sdk/codec/types" | ||
| sdk "github.com/cosmos/cosmos-sdk/types" | ||
| authzcdc "github.com/cosmos/cosmos-sdk/x/authz/codec" | ||
| ) | ||
|
|
||
| func RegisterLegacyAminoCodec(*codec.LegacyAmino) {} | ||
|
|
||
| func RegisterInterfaces(types.InterfaceRegistry) {} | ||
|
|
||
| var ( | ||
| ModuleCdc = codec.NewLegacyAmino() | ||
| ) | ||
|
|
||
| func init() { | ||
| RegisterLegacyAminoCodec(ModuleCdc) | ||
| // Register all Amino interfaces and concrete types on the authz Amino codec so that this can later be | ||
| // used to properly serialize MsgGrant and MsgExec instances | ||
| sdk.RegisterLegacyAminoCodec(ModuleCdc) | ||
| RegisterLegacyAminoCodec(authzcdc.Amino) | ||
|
|
||
| ModuleCdc.Seal() | ||
| } |
This file contains hidden or 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,83 @@ | ||
| package types | ||
|
|
||
| import ( | ||
| "fmt" | ||
| "strings" | ||
| "time" | ||
|
|
||
| "github.com/tidwall/btree" | ||
| ) | ||
|
|
||
| const ( | ||
| // we don't use a `-` as RouterKey must be alphanumeric | ||
| ModuleName = "downtimedetector" | ||
| StoreKey = ModuleName | ||
| RouterKey = ModuleName | ||
|
|
||
| QuerierRoute = ModuleName | ||
| ) | ||
|
|
||
| var ( | ||
| DowntimeToDuration = btree.NewMap[Downtime, time.Duration](16) | ||
| DefaultLastDowntime = time.Unix(0, 0) | ||
| ) | ||
|
|
||
| // init initializes the DowntimeToDuration map with mappings | ||
| // from the Duration enum values to their corresponding | ||
| // time.Duration values. | ||
| func init() { | ||
| DowntimeToDuration.Set(Downtime_DURATION_30S, 30*time.Second) | ||
| DowntimeToDuration.Set(Downtime_DURATION_1M, time.Minute) | ||
| DowntimeToDuration.Set(Downtime_DURATION_2M, 2*time.Minute) | ||
| DowntimeToDuration.Set(Downtime_DURATION_3M, 3*time.Minute) | ||
| DowntimeToDuration.Set(Downtime_DURATION_4M, 4*time.Minute) | ||
| DowntimeToDuration.Set(Downtime_DURATION_5M, 5*time.Minute) | ||
| DowntimeToDuration.Set(Downtime_DURATION_10M, 10*time.Minute) | ||
| DowntimeToDuration.Set(Downtime_DURATION_20M, 20*time.Minute) | ||
| DowntimeToDuration.Set(Downtime_DURATION_30M, 30*time.Minute) | ||
| DowntimeToDuration.Set(Downtime_DURATION_40M, 40*time.Minute) | ||
| DowntimeToDuration.Set(Downtime_DURATION_50M, 50*time.Minute) | ||
| DowntimeToDuration.Set(Downtime_DURATION_1H, time.Hour) | ||
| DowntimeToDuration.Set(Downtime_DURATION_1_5H, time.Hour+30*time.Minute) | ||
| DowntimeToDuration.Set(Downtime_DURATION_2H, 2*time.Hour) | ||
| DowntimeToDuration.Set(Downtime_DURATION_2_5H, 2*time.Hour+30*time.Minute) | ||
| DowntimeToDuration.Set(Downtime_DURATION_3H, 3*time.Hour) | ||
| DowntimeToDuration.Set(Downtime_DURATION_4H, 4*time.Hour) | ||
| DowntimeToDuration.Set(Downtime_DURATION_5H, 5*time.Hour) | ||
| DowntimeToDuration.Set(Downtime_DURATION_6H, 6*time.Hour) | ||
| DowntimeToDuration.Set(Downtime_DURATION_9H, 9*time.Hour) | ||
| DowntimeToDuration.Set(Downtime_DURATION_12H, 12*time.Hour) | ||
| DowntimeToDuration.Set(Downtime_DURATION_18H, 18*time.Hour) | ||
| DowntimeToDuration.Set(Downtime_DURATION_24H, 24*time.Hour) | ||
| DowntimeToDuration.Set(Downtime_DURATION_36H, 36*time.Hour) | ||
| DowntimeToDuration.Set(Downtime_DURATION_48H, 48*time.Hour) | ||
| } | ||
|
|
||
| func DowntimeStrings() []string { | ||
| arr := []string{} | ||
| DowntimeToDuration.Ascend(Downtime(0), func(_ Downtime, v time.Duration) bool { | ||
| s := strings.Replace(v.String(), "m0s", "m", 1) | ||
| s = strings.Replace(s, "h0m", "h", 1) | ||
| arr = append(arr, s) | ||
| return true | ||
| }) | ||
| return arr | ||
| } | ||
|
|
||
| func DowntimeByDuration(duration time.Duration) (Downtime, error) { | ||
| var result Downtime | ||
| found := false | ||
| DowntimeToDuration.Ascend(Downtime(0), func(k Downtime, v time.Duration) bool { | ||
| if v == duration { | ||
| result = k | ||
| found = true | ||
| return false | ||
| } | ||
| return true | ||
| }) | ||
| if found { | ||
| return result, nil | ||
| } | ||
| downtimeOptions := strings.Join(DowntimeStrings(), ", ") | ||
| return result, fmt.Errorf("downtime of %s does not exist. Chain-provided downtimes [%s]", duration.String(), downtimeOptions) | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🧩 Analysis chain
Verify tag/branch availability for reproducible clones.
Ensure these refs exist to avoid CI flakes.
🏁 Script executed:
Length of output: 115
🏁 Script executed:
Length of output: 999
Fix unreachable repo URLs referenced in Makefile clones
Both referenced repos/tags (InjectiveLabs/injective-indexer@v1.16.91 and InjectiveLabs/injective-core@v1.16.4) return HTTP 404 and git ls-remote failed — CI will fail to clone. Update the Makefile to point to valid repo URLs/tags (or use mirrors/commit SHAs) and re-verify with git ls-remote.
Location: Makefile lines 4-7
🤖 Prompt for AI Agents