-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Summary 1. Implement a fix for incomplete migration of topic fields from the v0.4.0 upgrade. 2. Add additional RPC endpoint to allow for recalculating the inflation rate / target emission rate more often than once per month. 3. Update to use rewardable topics as active topics instead of using them separately. 4. Other miscellaneous minor fixes ## Link(s) to Ticket(s) or Issue(s) resolved by this PR See [Changelog.md](https://github.com/allora-network/allora-chain/blob/release-v0.5.0/CHANGELOG.md) --------- Signed-off-by: web3-nodeops <[email protected]> Signed-off-by: Tobi Okedeji <[email protected]> Signed-off-by: Fernando Campos <[email protected]> Signed-off-by: Guilherme Brandão <[email protected]> Signed-off-by: omahs <[email protected]> Signed-off-by: R <[email protected]> Signed-off-by: Oleksandr <[email protected]> Signed-off-by: Diego C <[email protected]> Co-authored-by: web3-nodeops <[email protected]> Co-authored-by: Guilherme Brandão <[email protected]> Co-authored-by: Kenny P <[email protected]> Co-authored-by: Diego C <[email protected]> Co-authored-by: Tobi Okedeji <[email protected]> Co-authored-by: RedBird96 <[email protected]> Co-authored-by: fernandofcampos <[email protected]> Co-authored-by: Elias Rad <[email protected]> Co-authored-by: Kenny <[email protected]> Co-authored-by: michael <[email protected]> Co-authored-by: Guilherme Brandão <[email protected]> Co-authored-by: omahs <[email protected]> Co-authored-by: R <[email protected]> Co-authored-by: Oleksandr <[email protected]>
- Loading branch information
1 parent
be9dd1e
commit c1585f9
Showing
221 changed files
with
145,993 additions
and
10,128 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
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
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,27 @@ | ||
package v0_5_0 //nolint:revive // var-naming: don't use an underscore in package name | ||
|
||
import ( | ||
"context" | ||
|
||
upgradetypes "cosmossdk.io/x/upgrade/types" | ||
"github.com/allora-network/allora-chain/app/upgrades" | ||
"github.com/cosmos/cosmos-sdk/types/module" | ||
) | ||
|
||
const ( | ||
UpgradeName = "v0.5.0" | ||
) | ||
|
||
var Upgrade = upgrades.Upgrade{ | ||
UpgradeName: UpgradeName, | ||
CreateUpgradeHandler: CreateUpgradeHandler, | ||
} | ||
|
||
func CreateUpgradeHandler( | ||
moduleManager *module.Manager, | ||
configurator module.Configurator, | ||
) upgradetypes.UpgradeHandler { | ||
return func(ctx context.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { | ||
return moduleManager.RunMigrations(ctx, configurator, vm) | ||
} | ||
} |
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,69 @@ | ||
package math_test | ||
|
||
import ( | ||
"testing" | ||
|
||
sdkmath "cosmossdk.io/math" | ||
alloraMath "github.com/allora-network/allora-chain/math" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestLegacyDecEncoding(t *testing.T) { | ||
legacyDec := sdkmath.LegacyMustNewDecFromStr("1.25") | ||
|
||
encoded, err := alloraMath.LegacyDecValue.Encode(legacyDec) | ||
require.NoError(t, err) | ||
require.Equal(t, []byte("1250000000000000000"), encoded) | ||
|
||
decoded, err := alloraMath.LegacyDecValue.Decode(encoded) | ||
require.NoError(t, err) | ||
|
||
require.Equal(t, legacyDec, decoded) | ||
} | ||
|
||
func TestLegacyDecEncodingJSON(t *testing.T) { | ||
legacyDec := sdkmath.LegacyMustNewDecFromStr("1.25") | ||
|
||
encoded, err := alloraMath.LegacyDecValue.EncodeJSON(legacyDec) | ||
require.NoError(t, err) | ||
require.Equal(t, []byte("\"1.250000000000000000\""), encoded) | ||
decoded, err := alloraMath.LegacyDecValue.DecodeJSON(encoded) | ||
require.NoError(t, err) | ||
|
||
require.Equal(t, legacyDec, decoded) | ||
} | ||
|
||
func TestLegacyDecEncodingStringify(t *testing.T) { | ||
legacyDec := sdkmath.LegacyMustNewDecFromStr("1.25") | ||
result := alloraMath.LegacyDecValue.Stringify(legacyDec) | ||
require.Equal(t, "1.250000000000000000", result) | ||
} | ||
|
||
func TestLegacyDecEncodingValueType(t *testing.T) { | ||
require.Equal(t, "math.LegacyDec", alloraMath.LegacyDecValue.ValueType()) | ||
} | ||
|
||
func TestDecEncoding(t *testing.T) { | ||
dec := alloraMath.MustNewDecFromString("1.25") | ||
|
||
encoded, err := alloraMath.DecValue.Encode(dec) | ||
require.NoError(t, err) | ||
require.Equal(t, []byte("1.25"), encoded) | ||
} | ||
|
||
func TestDecEncodingJSON(t *testing.T) { | ||
dec := alloraMath.MustNewDecFromString("1.25") | ||
encoded, err := alloraMath.DecValue.EncodeJSON(dec) | ||
require.NoError(t, err) | ||
require.Equal(t, []byte("\"1.25\""), encoded) | ||
} | ||
|
||
func TestDecEncodingStringify(t *testing.T) { | ||
dec := alloraMath.MustNewDecFromString("1.25") | ||
result := alloraMath.DecValue.Stringify(dec) | ||
require.Equal(t, "1.25", result) | ||
} | ||
|
||
func TestDecEncodingValueType(t *testing.T) { | ||
require.Equal(t, "AlloraDec", alloraMath.DecValue.ValueType()) | ||
} |
Oops, something went wrong.