-
Notifications
You must be signed in to change notification settings - Fork 21
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
61f8090
commit d5fb6ca
Showing
6 changed files
with
124 additions
and
15 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,15 +1,59 @@ | ||
package v2_0 | ||
|
||
/* | ||
Protocol-Consensus Validator Linking: | ||
1. Fill out the entry below following the example. | ||
2. Send 1$KYVE from the protocol-address to the consensus-validator-operator address using the memo "Shared-Staking" | ||
and put the tx-hash in Proof1. | ||
3. Send 1$KYVE from the consensus-validator-operator address to the protocol address using the memo "Shared-Staking" | ||
and put the tx-hash in Proof2. | ||
4. Submit a Pull-Request to https://github.com/KYVENetwork/chain | ||
*/ | ||
|
||
type ValidatorMapping struct { | ||
Name string | ||
ConsensusAddress string | ||
ProtocolAddress string | ||
Proof1 string | ||
Proof2 string | ||
} | ||
|
||
var ValidatorMappingsMainnet = []ValidatorMapping{ | ||
{ | ||
// human-readable name, only used for logging | ||
Name: "", | ||
// kyvevaloper... address of the chain node | ||
ConsensusAddress: "", | ||
// kyve... address of the protocol node | ||
ProtocolAddress: "", | ||
// Proof TX-Hash 1, transferring 1 $KYVE from the protocol-address to the operator address | ||
// using "Shared Staking" as memo. | ||
Proof1: "", | ||
// Proof TX-Hash 2, transferring 1 $KYVE from the operator address to the protocol-address | ||
// using "Shared Staking" as memo. | ||
Proof2: "", | ||
}, | ||
} | ||
|
||
var ValidatorMappings = []ValidatorMapping{ | ||
var ValidatorMappingsKaon = []ValidatorMapping{ | ||
{ | ||
Name: "", | ||
// human-readable name, only used for logging | ||
Name: "", | ||
// kyvevaloper... address of the chain node | ||
ConsensusAddress: "", | ||
ProtocolAddress: "", | ||
// kyve... address of the protocol node | ||
ProtocolAddress: "", | ||
// Proof TX-Hash 1, transferring 1 $KYVE from the protocol-address to the operator address | ||
// using "Shared Staking" as memo. | ||
Proof1: "", | ||
// Proof TX-Hash 2, transferring 1 $KYVE from the operator address to the protocol-address | ||
// using "Shared Staking" as memo. | ||
Proof2: "", | ||
}, | ||
} |
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,56 @@ | ||
package keeper | ||
|
||
import ( | ||
"cosmossdk.io/store/prefix" | ||
storeTypes "cosmossdk.io/store/types" | ||
"github.com/KYVENetwork/chain/x/stakers/types" | ||
"github.com/cosmos/cosmos-sdk/runtime" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
) | ||
|
||
func (k Keeper) migration_RemoveBranch(ctx sdk.Context, keyPrefix []byte) { | ||
storeAdapter := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) | ||
store := prefix.NewStore(storeAdapter, keyPrefix) | ||
iterator := storeTypes.KVStorePrefixIterator(store, []byte{}) | ||
|
||
defer iterator.Close() | ||
|
||
keys := make([][]byte, 0) | ||
for ; iterator.Valid(); iterator.Next() { | ||
keys = append(keys, iterator.Key()) | ||
} | ||
|
||
for _, key := range keys { | ||
store.Delete(key) | ||
} | ||
} | ||
|
||
func (k Keeper) Migration_ResetOldState(ctx sdk.Context) { | ||
k.migration_RemoveBranch(ctx, types.StakerKeyPrefix) | ||
|
||
k.migration_RemoveBranch(ctx, types.ValaccountPrefix) | ||
k.migration_RemoveBranch(ctx, types.ValaccountPrefixIndex2) | ||
|
||
k.migration_RemoveBranch(ctx, types.CommissionChangeEntryKeyPrefix) | ||
k.migration_RemoveBranch(ctx, types.CommissionChangeEntryKeyPrefixIndex2) | ||
|
||
k.migration_RemoveBranch(ctx, types.LeavePoolEntryKeyPrefix) | ||
k.migration_RemoveBranch(ctx, types.LeavePoolEntryKeyPrefixIndex2) | ||
|
||
k.migration_RemoveBranch(ctx, types.ActiveStakerIndex) | ||
|
||
k.SetQueueState(ctx, types.QUEUE_IDENTIFIER_COMMISSION, types.QueueState{ | ||
LowIndex: 0, | ||
HighIndex: 0, | ||
}) | ||
|
||
k.SetQueueState(ctx, types.QUEUE_IDENTIFIER_LEAVE, types.QueueState{ | ||
LowIndex: 0, | ||
HighIndex: 0, | ||
}) | ||
|
||
k.SetQueueState(ctx, types.QUEUE_IDENTIFIER_STAKE_FRACTION, types.QueueState{ | ||
LowIndex: 0, | ||
HighIndex: 0, | ||
}) | ||
} |
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