rpc: generalized rpc using reflection on funcs and params

This commit is contained in:
Ethan Buchman
2015-03-27 02:25:41 -07:00
parent 1fb1163721
commit 9aeafffd9b
14 changed files with 436 additions and 405 deletions

View File

@ -8,7 +8,7 @@ import (
//-----------------------------------------------------------------------------
func BlockchainInfoHandler(minHeight, maxHeight uint) (uint, []*types.BlockMeta) {
func BlockchainInfo(minHeight, maxHeight uint) (uint, []*types.BlockMeta) {
if maxHeight == 0 {
maxHeight = blockStore.Height()
} else {
@ -30,7 +30,7 @@ func BlockchainInfoHandler(minHeight, maxHeight uint) (uint, []*types.BlockMeta)
//-----------------------------------------------------------------------------
func GetBlockHandler(height uint) (*types.BlockMeta, *types.Block, error) {
func GetBlock(height uint) (*types.BlockMeta, *types.Block, error) {
if height == 0 {
return nil, nil, fmt.Errorf("height must be greater than 1")
}