diff --git a/types/config.go b/types/config.go index fce6c73526e..06a3c3ce09f 100644 --- a/types/config.go +++ b/types/config.go @@ -82,6 +82,13 @@ func (config *Config) assertNotSealed() { } } +func (config *Config) IsSealed() bool { + config.mtx.Lock() + defer config.mtx.Unlock() + + return config.sealed +} + // SetBech32PrefixForAccount builds the Config with Bech32 addressPrefix and publKeyPrefix for accounts // and returns the config instance func (config *Config) SetBech32PrefixForAccount(addressPrefix, pubKeyPrefix string) { diff --git a/types/config_test.go b/types/config_test.go index df281b1f852..1c9b57d80c5 100644 --- a/types/config_test.go +++ b/types/config_test.go @@ -68,3 +68,10 @@ func (s *configTestSuite) TestConfig_SetFullFundraiserPath() { func (s *configTestSuite) TestKeyringServiceName() { s.Require().Equal(sdk.DefaultKeyringServiceName, sdk.KeyringServiceName()) } + +func (s *configTestSuite) TestIsConfigSealed() { + config := sdk.NewConfig() + s.Require().False(config.IsSealed()) + config.Seal() + s.Require().True(config.IsSealed()) +}