Skip to content

Commit

Permalink
Mass rename keymap -> keyassignment
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel committed Nov 2, 2022
1 parent 2daab1e commit 2410cf7
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion docs/keymap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,4 @@ The KeyAssignment implementation satisfies a number of internal properties, whic
3. Pruning\
'When the pruning method is used correctly, the internal state of the data structure does not grow unboundedly'

Details can be found in x/ccv/provider/keeper/keymap_core_test.go. TODO: link?
Details can be found in x/ccv/provider/keeper/keyassignment_core_test.go. TODO: link?
2 changes: 1 addition & 1 deletion proto/interchain_security/ccv/provider/v1/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import "interchain_security/ccv/v1/ccv.proto";
import "interchain_security/ccv/provider/v1/provider.proto";
import "interchain_security/ccv/consumer/v1/consumer.proto";
import "interchain_security/ccv/consumer/v1/genesis.proto";
import "interchain_security/ccv/provider/v1/keymap.proto";
import "interchain_security/ccv/provider/v1/keyassignment.proto";

// GenesisState defines the CCV provider chain genesis state
message GenesisState {
Expand Down
2 changes: 1 addition & 1 deletion proto/interchain_security/ccv/provider/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ option go_package = "github.com/cosmos/interchain-security/x/ccv/provider/types"

import "google/api/annotations.proto";
import "gogoproto/gogo.proto";
import "interchain_security/ccv/provider/v1/keymap.proto";
import "interchain_security/ccv/provider/v1/keyassignment.proto";
import "cosmos_proto/cosmos.proto";
import "google/protobuf/any.proto";

Expand Down
2 changes: 1 addition & 1 deletion tests/difference/core/driver/core_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ type CoreSuite struct {
offsetHeight int64
offsetProviderVscId uint64

// Maps vscid to data needed to check keymapping
// Maps vscid to data needed to check keyassignmentping
vscidToKeyAssignment map[uint64]map[int64]providerkeeper.ConsumerPublicKey
}

Expand Down
2 changes: 1 addition & 1 deletion x/ccv/provider/keeper/keymap_api.tla
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---- MODULE keymap_api ----
---- MODULE keyassignment_api ----

EXTENDS Integers, Naturals, FiniteSets, Sequences, TLC

Expand Down
2 changes: 1 addition & 1 deletion x/ccv/provider/keeper/keymap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ func getTrace(t *testing.T) []traceStep {
return ret
}

// go test -coverprofile=coverage.out -coverpkg=./... -timeout 1000m -run KeyAssignmentPropertiesRandomlyHeuristically keymap_test.go
// go test -coverprofile=coverage.out -coverpkg=./... -timeout 1000m -run KeyAssignmentPropertiesRandomlyHeuristically keyassignment_test.go

// Execute randomly generated traces (lists of actions)
// against new instances of the class, checking properties
Expand Down
6 changes: 3 additions & 3 deletions x/ccv/provider/keeper/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func (k Keeper) OnRecvVSCMaturedPacket(
panic(fmt.Errorf("VSCMaturedPacket received on unknown channel %s", packet.DestinationChannel))
}

// It is now possible to delete keys from the keymap which the consumer chain
// It is now possible to delete keys from the keyassignment which the consumer chain
// is no longer able to reference in slash requests.
k.KeyAssignment(ctx, chainID).PruneUnusedKeys(data.ValsetUpdateId)

Expand Down Expand Up @@ -202,8 +202,8 @@ func (k Keeper) OnRecvSlashPacket(ctx sdk.Context, packet channeltypes.Packet, d
}

// TODO: should this be a panic or an error?
func GetProviderConsAddr(keymap *KeyAssignment, consumerConsAddress sdk.ConsAddress) (sdk.ConsAddress, error) {
providerPublicKey, found := keymap.GetProviderPubKeyFromConsumerConsAddress(consumerConsAddress)
func GetProviderConsAddr(keyassignment *KeyAssignment, consumerConsAddress sdk.ConsAddress) (sdk.ConsAddress, error) {
providerPublicKey, found := keyassignment.GetProviderPubKeyFromConsumerConsAddress(consumerConsAddress)
if !found {
return nil, errors.New("could not find provider address for slashing")
}
Expand Down
4 changes: 2 additions & 2 deletions x/ccv/provider/types/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func NewConsumerStates(
unbondingOpsIndexes []UnbondingOpIndex,
pendingValsetChanges []ccv.ValidatorSetChangePacketData,
slashDowntimeAck []string,
keymap *ccv.KeyAssignment,
keyassignment *ccv.KeyAssignment,
) ConsumerState {
return ConsumerState{
ChainId: chainID,
Expand All @@ -27,6 +27,6 @@ func NewConsumerStates(
PendingValsetChanges: pendingValsetChanges,
ConsumerGenesis: genesis,
SlashDowntimeAck: slashDowntimeAck,
KeyAssignment: keymap,
KeyAssignment: keyassignment,
}
}

0 comments on commit 2410cf7

Please sign in to comment.