Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
insumity committed Jun 28, 2024
1 parent b3e2096 commit 1c9a119
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 304 deletions.
12 changes: 12 additions & 0 deletions tests/e2e/steps_compatibility.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,18 @@ func compstepsStartConsumerChain(consumerName string, proposalIndex, chainIndex
},
},
},
{
// op should fail - key already assigned by the same validator
Action: AssignConsumerPubKeyAction{
Chain: ChainID(consumerName),
Validator: ValidatorID("carol"),
ConsumerPubkey: getDefaultValidators()[ValidatorID("carol")].ConsumerValPubKey,
ReconfigureNode: false,
ExpectError: true,
ExpectedError: "a validator has assigned the consumer key already: consumer key is already in use by a validator",
},
State: State{},
},
{
// op should fail - key already assigned by another validator
Action: AssignConsumerPubKeyAction{
Expand Down
16 changes: 4 additions & 12 deletions tests/e2e/steps_start_chains.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,24 +83,16 @@ func stepsStartConsumerChain(consumerName string, proposalIndex, chainIndex uint
},
},
{
// op should be a noop - key already assigned, but by the same validator
// op should fail - key already assigned by the same validator
Action: AssignConsumerPubKeyAction{
Chain: ChainID(consumerName),
Validator: ValidatorID("carol"),
ConsumerPubkey: getDefaultValidators()[ValidatorID("carol")].ConsumerValPubKey,
ReconfigureNode: false,
ExpectError: false,
},
State: State{
ChainID(consumerName): ChainState{
AssignedKeys: &map[ValidatorID]string{
ValidatorID("carol"): getDefaultValidators()[ValidatorID("carol")].ConsumerValconsAddressOnProvider,
},
ProviderKeys: &map[ValidatorID]string{
ValidatorID("carol"): getDefaultValidators()[ValidatorID("carol")].ValconsAddress,
},
},
ExpectError: true,
ExpectedError: "a validator has assigned the consumer key already: consumer key is already in use by a validator",
},
State: State{},
},
{
// op should fail - key already assigned by another validator
Expand Down
27 changes: 3 additions & 24 deletions tests/e2e/tracehandler_testdata/consumer-double-sign.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,31 +142,10 @@
"Validator": "carol",
"ConsumerPubkey": "{\"@type\":\"/cosmos.crypto.ed25519.PubKey\",\"key\":\"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is=\"}",
"ReconfigureNode": false,
"ExpectError": false,
"ExpectedError": ""
"ExpectError": true,
"ExpectedError": "a validator has assigned the consumer key already: consumer key is already in use by a validator"
},
"State": {
"consu": {
"ValBalances": null,
"ProposedConsumerChains": null,
"ValPowers": null,
"StakedTokens": null,
"Params": null,
"Rewards": null,
"ConsumerChains": null,
"AssignedKeys": {
"carol": "cosmosvalcons1kswr5sq599365kcjmhgufevfps9njf43e4lwdk"
},
"ProviderKeys": {
"carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6"
},
"ConsumerPendingPacketQueueSize": null,
"RegisteredConsumerRewardDenoms": null,
"ClientsFrozenHeights": null,
"HasToValidate": null,
"Proposals": null
}
}
"State": {}
},
{
"ActionType": "main.AssignConsumerPubKeyAction",
Expand Down
27 changes: 3 additions & 24 deletions tests/e2e/tracehandler_testdata/democracy.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,31 +142,10 @@
"Validator": "carol",
"ConsumerPubkey": "{\"@type\":\"/cosmos.crypto.ed25519.PubKey\",\"key\":\"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is=\"}",
"ReconfigureNode": false,
"ExpectError": false,
"ExpectedError": ""
"ExpectError": true,
"ExpectedError": "a validator has assigned the consumer key already: consumer key is already in use by a validator"
},
"State": {
"democ": {
"ValBalances": null,
"ProposedConsumerChains": null,
"ValPowers": null,
"StakedTokens": null,
"Params": null,
"Rewards": null,
"ConsumerChains": null,
"AssignedKeys": {
"carol": "cosmosvalcons1kswr5sq599365kcjmhgufevfps9njf43e4lwdk"
},
"ProviderKeys": {
"carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6"
},
"ConsumerPendingPacketQueueSize": null,
"RegisteredConsumerRewardDenoms": null,
"ClientsFrozenHeights": null,
"HasToValidate": null,
"Proposals": null
}
}
"State": {}
},
{
"ActionType": "main.AssignConsumerPubKeyAction",
Expand Down
27 changes: 3 additions & 24 deletions tests/e2e/tracehandler_testdata/democracyRewardsSteps.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,31 +142,10 @@
"Validator": "carol",
"ConsumerPubkey": "{\"@type\":\"/cosmos.crypto.ed25519.PubKey\",\"key\":\"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is=\"}",
"ReconfigureNode": false,
"ExpectError": false,
"ExpectedError": ""
"ExpectError": true,
"ExpectedError": "a validator has assigned the consumer key already: consumer key is already in use by a validator"
},
"State": {
"democ": {
"ValBalances": null,
"ProposedConsumerChains": null,
"ValPowers": null,
"StakedTokens": null,
"Params": null,
"Rewards": null,
"ConsumerChains": null,
"AssignedKeys": {
"carol": "cosmosvalcons1kswr5sq599365kcjmhgufevfps9njf43e4lwdk"
},
"ProviderKeys": {
"carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6"
},
"ConsumerPendingPacketQueueSize": null,
"RegisteredConsumerRewardDenoms": null,
"ClientsFrozenHeights": null,
"HasToValidate": null,
"Proposals": null
}
}
"State": {}
},
{
"ActionType": "main.AssignConsumerPubKeyAction",
Expand Down
27 changes: 3 additions & 24 deletions tests/e2e/tracehandler_testdata/happyPath.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,31 +142,10 @@
"Validator": "carol",
"ConsumerPubkey": "{\"@type\":\"/cosmos.crypto.ed25519.PubKey\",\"key\":\"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is=\"}",
"ReconfigureNode": false,
"ExpectError": false,
"ExpectedError": ""
"ExpectError": true,
"ExpectedError": "a validator has assigned the consumer key already: consumer key is already in use by a validator"
},
"State": {
"consu": {
"ValBalances": null,
"ProposedConsumerChains": null,
"ValPowers": null,
"StakedTokens": null,
"Params": null,
"Rewards": null,
"ConsumerChains": null,
"AssignedKeys": {
"carol": "cosmosvalcons1kswr5sq599365kcjmhgufevfps9njf43e4lwdk"
},
"ProviderKeys": {
"carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6"
},
"ConsumerPendingPacketQueueSize": null,
"RegisteredConsumerRewardDenoms": null,
"ClientsFrozenHeights": null,
"HasToValidate": null,
"Proposals": null
}
}
"State": {}
},
{
"ActionType": "main.AssignConsumerPubKeyAction",
Expand Down
54 changes: 6 additions & 48 deletions tests/e2e/tracehandler_testdata/multipleConsumers.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,31 +142,10 @@
"Validator": "carol",
"ConsumerPubkey": "{\"@type\":\"/cosmos.crypto.ed25519.PubKey\",\"key\":\"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is=\"}",
"ReconfigureNode": false,
"ExpectError": false,
"ExpectedError": ""
"ExpectError": true,
"ExpectedError": "a validator has assigned the consumer key already: consumer key is already in use by a validator"
},
"State": {
"consu": {
"ValBalances": null,
"ProposedConsumerChains": null,
"ValPowers": null,
"StakedTokens": null,
"Params": null,
"Rewards": null,
"ConsumerChains": null,
"AssignedKeys": {
"carol": "cosmosvalcons1kswr5sq599365kcjmhgufevfps9njf43e4lwdk"
},
"ProviderKeys": {
"carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6"
},
"ConsumerPendingPacketQueueSize": null,
"RegisteredConsumerRewardDenoms": null,
"ClientsFrozenHeights": null,
"HasToValidate": null,
"Proposals": null
}
}
"State": {}
},
{
"ActionType": "main.AssignConsumerPubKeyAction",
Expand Down Expand Up @@ -439,31 +418,10 @@
"Validator": "carol",
"ConsumerPubkey": "{\"@type\":\"/cosmos.crypto.ed25519.PubKey\",\"key\":\"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is=\"}",
"ReconfigureNode": false,
"ExpectError": false,
"ExpectedError": ""
"ExpectError": true,
"ExpectedError": "a validator has assigned the consumer key already: consumer key is already in use by a validator"
},
"State": {
"densu": {
"ValBalances": null,
"ProposedConsumerChains": null,
"ValPowers": null,
"StakedTokens": null,
"Params": null,
"Rewards": null,
"ConsumerChains": null,
"AssignedKeys": {
"carol": "cosmosvalcons1kswr5sq599365kcjmhgufevfps9njf43e4lwdk"
},
"ProviderKeys": {
"carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6"
},
"ConsumerPendingPacketQueueSize": null,
"RegisteredConsumerRewardDenoms": null,
"ClientsFrozenHeights": null,
"HasToValidate": null,
"Proposals": null
}
}
"State": {}
},
{
"ActionType": "main.AssignConsumerPubKeyAction",
Expand Down
27 changes: 3 additions & 24 deletions tests/e2e/tracehandler_testdata/shorthappy.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,31 +142,10 @@
"Validator": "carol",
"ConsumerPubkey": "{\"@type\":\"/cosmos.crypto.ed25519.PubKey\",\"key\":\"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is=\"}",
"ReconfigureNode": false,
"ExpectError": false,
"ExpectedError": ""
"ExpectError": true,
"ExpectedError": "a validator has assigned the consumer key already: consumer key is already in use by a validator"
},
"State": {
"consu": {
"ValBalances": null,
"ProposedConsumerChains": null,
"ValPowers": null,
"StakedTokens": null,
"Params": null,
"Rewards": null,
"ConsumerChains": null,
"AssignedKeys": {
"carol": "cosmosvalcons1kswr5sq599365kcjmhgufevfps9njf43e4lwdk"
},
"ProviderKeys": {
"carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6"
},
"ConsumerPendingPacketQueueSize": null,
"RegisteredConsumerRewardDenoms": null,
"ClientsFrozenHeights": null,
"HasToValidate": null,
"Proposals": null
}
}
"State": {}
},
{
"ActionType": "main.AssignConsumerPubKeyAction",
Expand Down
27 changes: 3 additions & 24 deletions tests/e2e/tracehandler_testdata/slashThrottle.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,31 +142,10 @@
"Validator": "carol",
"ConsumerPubkey": "{\"@type\":\"/cosmos.crypto.ed25519.PubKey\",\"key\":\"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is=\"}",
"ReconfigureNode": false,
"ExpectError": false,
"ExpectedError": ""
"ExpectError": true,
"ExpectedError": "a validator has assigned the consumer key already: consumer key is already in use by a validator"
},
"State": {
"consu": {
"ValBalances": null,
"ProposedConsumerChains": null,
"ValPowers": null,
"StakedTokens": null,
"Params": null,
"Rewards": null,
"ConsumerChains": null,
"AssignedKeys": {
"carol": "cosmosvalcons1kswr5sq599365kcjmhgufevfps9njf43e4lwdk"
},
"ProviderKeys": {
"carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6"
},
"ConsumerPendingPacketQueueSize": null,
"RegisteredConsumerRewardDenoms": null,
"ClientsFrozenHeights": null,
"HasToValidate": null,
"Proposals": null
}
}
"State": {}
},
{
"ActionType": "main.AssignConsumerPubKeyAction",
Expand Down
Loading

0 comments on commit 1c9a119

Please sign in to comment.