Browse Source

Conform to go-common WriteFile*(path,mode)

pull/164/head
Jae Kwon 9 years ago
parent
commit
e67f385574
4 changed files with 5 additions and 5 deletions
  1. +1
    -1
      config/tendermint/config.go
  2. +2
    -2
      config/tendermint_test/config.go
  3. +1
    -1
      types/genesis.go
  4. +1
    -1
      types/priv_validator.go

+ 1
- 1
config/tendermint/config.go View File

@ -29,7 +29,7 @@ func initTMRoot(rootDir string) {
if !FileExists(configFilePath) {
// Ask user for moniker
// moniker := cfg.Prompt("Type hostname: ", "anonymous")
MustWriteFile(configFilePath, []byte(defaultConfig("anonymous")))
MustWriteFile(configFilePath, []byte(defaultConfig("anonymous")), 0644)
}
}


+ 2
- 2
config/tendermint_test/config.go View File

@ -35,10 +35,10 @@ func initTMRoot(rootDir string) {
if !FileExists(configFilePath) {
// Ask user for moniker
// moniker := cfg.Prompt("Type hostname: ", "anonymous")
MustWriteFile(configFilePath, []byte(defaultConfig("anonymous")))
MustWriteFile(configFilePath, []byte(defaultConfig("anonymous")), 0644)
}
if !FileExists(genesisFilePath) {
MustWriteFile(genesisFilePath, []byte(defaultGenesis))
MustWriteFile(genesisFilePath, []byte(defaultGenesis), 0644)
}
}


+ 1
- 1
types/genesis.go View File

@ -32,7 +32,7 @@ type GenesisDoc struct {
// Utility method for saving GenensisDoc as JSON file.
func (genDoc *GenesisDoc) SaveAs(file string) error {
genDocBytes := wire.JSONBytes(genDoc)
return WriteFile(file, genDocBytes)
return WriteFile(file, genDocBytes, 0644)
}
//------------------------------------------------------------


+ 1
- 1
types/priv_validator.go View File

@ -111,7 +111,7 @@ func (privVal *PrivValidator) save() {
PanicSanity("Cannot save PrivValidator: filePath not set")
}
jsonBytes := wire.JSONBytes(privVal)
err := WriteFileAtomic(privVal.filePath, jsonBytes)
err := WriteFileAtomic(privVal.filePath, jsonBytes, 0600)
if err != nil {
// `@; BOOM!!!
PanicCrisis(err)


Loading…
Cancel
Save