Skip to content

Commit

Permalink
Added another TODO_MAINNET(@Olshansk, #1033)
Browse files Browse the repository at this point in the history
  • Loading branch information
Olshansk committed Jan 17, 2025
1 parent a740395 commit c274e52
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 19 deletions.
2 changes: 2 additions & 0 deletions api/poktroll/shared/supplier.pulsar.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 20 additions & 16 deletions e2e/tests/stake_supplier.feature
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,23 @@ Feature: Stake Supplier Namespace
And the user verifies the "supplier" for account "supplier2" is not staked
And the account balance of "supplier2" should be "1000070" uPOKT "more" than before

Scenario: User can restake a Supplier waiting for it to become active again
Given the user has the pocketd binary installed
# Reduce the application unbonding period to avoid timeouts and speed up scenarios.
And the "supplier" unbonding period param is successfully set to "1" sessions of "2" blocks
And the user verifies the "supplier" for account "supplier2" is not staked
Then the user stakes a "supplier" with "1000070" uPOKT for "anvil" service from the account "supplier2"
And the user should wait for the "supplier" module "StakeSupplier" message to be submitted
Then the user should see that the supplier for account "supplier2" is staked
But the session for application "app1" and service "anvil" does not contain "supplier2"
When the user waits for supplier "supplier2" to become active for service "anvil"
Then the session for application "app1" and service "anvil" contains the supplier "supplier2"
# Cleanup to make this feature idempotent.
And the user unstakes a "supplier" from the account "supplier2"
And the supplier for account "supplier2" is unbonding
And the user should wait for the "supplier" module "SupplierUnbondingBegin" tx event to be broadcast
And a "supplier" module "SupplierUnbondingEnd" end block event is broadcast
# TODO_MAINNET(@olshansk, #1033): Since the "to become active for service" step
# requires reading "ServicesActivationHeightsMap", which is temporarily set to nil,
# this test has been commented out. See #1033 for details and re-enable this test
# once that data is retrievable through a different method.
# Scenario: User can restake a Supplier waiting for it to become active again
# Given the user has the pocketd binary installed
# # Reduce the application unbonding period to avoid timeouts and speed up scenarios.
# And the "supplier" unbonding period param is successfully set to "1" sessions of "2" blocks
# And the user verifies the "supplier" for account "supplier2" is not staked
# Then the user stakes a "supplier" with "1000070" uPOKT for "anvil" service from the account "supplier2"
# And the user should wait for the "supplier" module "StakeSupplier" message to be submitted
# Then the user should see that the supplier for account "supplier2" is staked
# But the session for application "app1" and service "anvil" does not contain "supplier2"
# When the user waits for supplier "supplier2" to become active for service "anvil"
# Then the session for application "app1" and service "anvil" contains the supplier "supplier2"
# # Cleanup to make this feature idempotent.
# And the user unstakes a "supplier" from the account "supplier2"
# And the supplier for account "supplier2" is unbonding
# And the user should wait for the "supplier" module "SupplierUnbondingBegin" tx event to be broadcast
# And a "supplier" module "SupplierUnbondingEnd" end block event is broadcast
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ require (
cosmossdk.io/x/tx v0.13.4
github.com/jhump/protoreflect v1.16.0
github.com/mitchellh/mapstructure v1.5.0
go.uber.org/mock v0.5.0
)

require (
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1211,8 +1211,6 @@ go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0
go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/mock v0.5.0 h1:KAMbZvZPyBPWgD14IrIQ38QCyjwpvVVV6K/bHl1IwQU=
go.uber.org/mock v0.5.0/go.mod h1:ge71pBPLYDk7QIi1LupWxdAykm7KIEFchiOqd6z7qMM=
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4=
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
Expand Down
2 changes: 2 additions & 0 deletions proto/poktroll/shared/supplier.proto
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,7 @@ message Supplier {
// Mapping of serviceIds to their activation heights
// Key: serviceId
// Value: Session start height when supplier becomes active for the service
// TODO_MAINNET(@olshansk, #1033): Look into moving this to an external repeated protobuf
// because maps are no longer supported for serialized types in the CosmoSDK.
map<string, uint64> services_activation_heights_map = 6;
}
2 changes: 2 additions & 0 deletions x/shared/types/supplier.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c274e52

Please sign in to comment.