mirror of
https://github.com/tendermint/tendermint.git
synced 2026-07-20 06:52:30 +00:00
Minor cleanup
This commit is contained in:
+5
-2
@@ -332,11 +332,13 @@ func (a *AddrBook) saveToFile(filePath string) {
|
||||
}
|
||||
}
|
||||
|
||||
func (a *AddrBook) loadFromFile(filePath string) {
|
||||
// Returns false if file does not exist.
|
||||
// Panics if file is corrupt.
|
||||
func (a *AddrBook) loadFromFile(filePath string) bool {
|
||||
// If doesn't exist, do nothing.
|
||||
_, err := os.Stat(filePath)
|
||||
if os.IsNotExist(err) {
|
||||
panic(Fmt("File does not exist: %v", filePath))
|
||||
return false
|
||||
}
|
||||
|
||||
// Load addrBookJSON{}
|
||||
@@ -368,6 +370,7 @@ func (a *AddrBook) loadFromFile(filePath string) {
|
||||
a.nOld++
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
/* Private methods */
|
||||
|
||||
@@ -5,20 +5,17 @@ import (
|
||||
)
|
||||
|
||||
func initHandlers() {
|
||||
http.HandleFunc("/status", StatusHandler)
|
||||
http.HandleFunc("/net_info", NetInfoHandler)
|
||||
http.HandleFunc("/blockchain", BlockchainInfoHandler)
|
||||
http.HandleFunc("/get_block", GetBlockHandler)
|
||||
|
||||
http.HandleFunc("/develop/gen_priv_account", GenPrivAccountHandler)
|
||||
http.HandleFunc("/get_account", GetAccountHandler)
|
||||
http.HandleFunc("/develop/list_accounts", ListAccountsHandler)
|
||||
|
||||
http.HandleFunc("/broadcast_tx", BroadcastTxHandler)
|
||||
http.HandleFunc("/list_validators", ListValidatorsHandler)
|
||||
http.HandleFunc("/develop/sign_tx", SignTxHandler)
|
||||
|
||||
http.HandleFunc("/broadcast_tx", BroadcastTxHandler)
|
||||
//http.HandleFunc("/call", CallHandler)
|
||||
//http.HandleFunc("/get_storage", GetStorageHandler)
|
||||
|
||||
http.HandleFunc("/net_info", NetInfoHandler)
|
||||
http.HandleFunc("/status", StatusHandler)
|
||||
http.HandleFunc("/develop/gen_priv_account", GenPrivAccountHandler)
|
||||
http.HandleFunc("/develop/list_accounts", ListAccountsHandler)
|
||||
http.HandleFunc("/develop/sign_tx", SignTxHandler)
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ func main() {
|
||||
}
|
||||
|
||||
var gas uint64 = 1000
|
||||
output, err := ourVm.Call(account1, account2, []byte{0x60, 0x01, 0x60, 0x01}, []byte{}, 0, &gas)
|
||||
output, err := ourVm.Call(account1, account2, []byte{0x5B, 0x60, 0x00, 0x56}, []byte{}, 0, &gas)
|
||||
fmt.Printf("Output: %v Error: %v\n", output, err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user