Skip to content

Commit

Permalink
feat: expose config.IsSealed (#414)
Browse files Browse the repository at this point in the history
  • Loading branch information
rootulp authored Sep 9, 2024
1 parent 13d3e17 commit 3562f46
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions types/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
7 changes: 7 additions & 0 deletions types/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}

0 comments on commit 3562f46

Please sign in to comment.