Skip to content

Delete contract-related states unpon unregister#554

Merged
codchen merged 1 commit intomasterfrom
tony-chen-unregister-contract-delete-state
Feb 10, 2023
Merged

Delete contract-related states unpon unregister#554
codchen merged 1 commit intomasterfrom
tony-chen-unregister-contract-delete-state

Conversation

@codchen
Copy link
Collaborator

@codchen codchen commented Feb 10, 2023

Describe your changes and provide context

Remove all states associated with a contract if it is unregistered

Testing performed to validate your change

unit tests

Comment on lines +48 to +51
return append(
OrderBookContractPrefix(long, contractAddr),
PairPrefix(priceDenom, assetDenom)...,
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to worry about where this is called?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is just a refactor so the caller wouldn't see a difference

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bbut in the old method it appends the append(prefix wheras this doesnt?

@codchen codchen force-pushed the tony-chen-unregister-contract-delete-state branch from c54730e to 0f1335e Compare February 10, 2023 07:57
@github-actions
Copy link

Code Coverage

Package Line Rate Complexity Health
github.com/sei-protocol/sei-chain/aclmapping/bank 83% 0
github.com/sei-protocol/sei-chain/aclmapping/dex 100% 0
github.com/sei-protocol/sei-chain/aclmapping/oracle 100% 0
github.com/sei-protocol/sei-chain/aclmapping/staking 82% 0
github.com/sei-protocol/sei-chain/aclmapping/tokenfactory 96% 0
github.com/sei-protocol/sei-chain/aclmapping/utils 0% 0
github.com/sei-protocol/sei-chain/aclmapping/wasm 83% 0
github.com/sei-protocol/sei-chain/app 60% 0
github.com/sei-protocol/sei-chain/app/antedecorators 76% 0
github.com/sei-protocol/sei-chain/oracle/price-feeder/config 85% 0
github.com/sei-protocol/sei-chain/oracle/price-feeder/oracle 67% 0
github.com/sei-protocol/sei-chain/oracle/price-feeder/oracle/provider 49% 0
github.com/sei-protocol/sei-chain/oracle/price-feeder/router/v1 45% 0
github.com/sei-protocol/sei-chain/store/whitelist/cachemulti 100% 0
github.com/sei-protocol/sei-chain/store/whitelist/kv 100% 0
github.com/sei-protocol/sei-chain/store/whitelist/multi 100% 0
github.com/sei-protocol/sei-chain/utils 46% 0
github.com/sei-protocol/sei-chain/utils/datastructures 90% 0
github.com/sei-protocol/sei-chain/utils/logging 100% 0
github.com/sei-protocol/sei-chain/x/dex 57% 0
github.com/sei-protocol/sei-chain/x/dex/cache 86% 0
github.com/sei-protocol/sei-chain/x/dex/client/cli/query 23% 0
github.com/sei-protocol/sei-chain/x/dex/contract 50% 0
github.com/sei-protocol/sei-chain/x/dex/exchange 89% 0
github.com/sei-protocol/sei-chain/x/dex/keeper 63% 0
github.com/sei-protocol/sei-chain/x/dex/keeper/abci 29% 0
github.com/sei-protocol/sei-chain/x/dex/keeper/msgserver 78% 0
github.com/sei-protocol/sei-chain/x/dex/keeper/query 82% 0
github.com/sei-protocol/sei-chain/x/dex/migrations 88% 0
github.com/sei-protocol/sei-chain/x/dex/types 1% 0
github.com/sei-protocol/sei-chain/x/dex/types/utils 100% 0
github.com/sei-protocol/sei-chain/x/dex/types/wasm 83% 0
github.com/sei-protocol/sei-chain/x/epoch 11% 0
github.com/sei-protocol/sei-chain/x/epoch/keeper 66% 0
github.com/sei-protocol/sei-chain/x/epoch/types 2% 0
github.com/sei-protocol/sei-chain/x/mint 0% 0
github.com/sei-protocol/sei-chain/x/mint/keeper 61% 0
github.com/sei-protocol/sei-chain/x/mint/simulation 95% 0
github.com/sei-protocol/sei-chain/x/mint/types 3% 0
github.com/sei-protocol/sei-chain/x/nitro/client/cli 45% 0
github.com/sei-protocol/sei-chain/x/nitro/keeper 80% 0
github.com/sei-protocol/sei-chain/x/nitro/replay 63% 0
github.com/sei-protocol/sei-chain/x/oracle 65% 0
github.com/sei-protocol/sei-chain/x/oracle/keeper 83% 0
github.com/sei-protocol/sei-chain/x/oracle/simulation 18% 0
github.com/sei-protocol/sei-chain/x/oracle/types 3% 0
github.com/sei-protocol/sei-chain/x/tokenfactory/keeper 85% 0
github.com/sei-protocol/sei-chain/x/tokenfactory/types 2% 0
Summary 15% (5112 / 34199) 0

@codchen codchen merged commit 2ca3f41 into master Feb 10, 2023
masih pushed a commit that referenced this pull request Sep 29, 2025
## Describe your changes and provide context
Remove stale allowlist comment
## Testing performed to validate your change

N/A
masih pushed a commit that referenced this pull request Sep 30, 2025
## Describe your changes and provide context
Remove stale allowlist comment
## Testing performed to validate your change

N/A
@masih masih deleted the tony-chen-unregister-contract-delete-state branch October 31, 2025 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants