Skip to content

Commit

Permalink
integrate RPC v2 via develop
Browse files Browse the repository at this point in the history
* integrate #2035 via latest develop. fixes #2041
* refactor apis
* fix tests for windows, add simple download test
* separate dns api and chequebook api
* http proxy api in separate subpackage
* remove legacy rpc code partially, adding only legacy to make v2 work
* TODO: add dns tests see #2048
* TODO: further refactor  due to #2040
  • Loading branch information
zelig authored and Daniel A. Nagy committed Jan 30, 2016
1 parent 4939b8a commit 0427aad
Show file tree
Hide file tree
Showing 21 changed files with 918 additions and 1,276 deletions.
83 changes: 0 additions & 83 deletions cmd/geth/js_bzz_test.go

This file was deleted.

29 changes: 29 additions & 0 deletions common/chequebook/api.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package chequebook

import (
"math/big"

"github.com/ethereum/go-ethereum/common"
)

const Version = "1.0"

type Api struct {
ch *Chequebook
}

func NewApi(ch *Chequebook) *Api {
return &Api{ch}
}

func (self *Api) Issue(beneficiary common.Address, amount *big.Int) (cheque *Cheque, err error) {
return self.ch.Issue(beneficiary, amount)
}

func (self *Api) Cash(cheque *Cheque) (txhash string, err error) {
return self.ch.Cash(cheque)
}

func (self *Api) Deposit(amount *big.Int) (txhash string, err error) {
return self.ch.Deposit(amount)
}
3 changes: 2 additions & 1 deletion eth/downloader/modes.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,15 @@ const (
TxPoolApiName = "txpool"
PersonalApiName = "personal"
Web3ApiName = "web3"
ChequebookApiName = "chequebook"

JsonRpcVersion = "2.0"
)

var (
// All API's
AllApis = strings.Join([]string{
AdminApiName, BzzApiName, DbApiName, EthApiName, DebugApiName, MinerApiName, NetApiName,
AdminApiName, BzzApiName, ChequebookApiName, DbApiName, EthApiName, DebugApiName, MinerApiName, NetApiName,
ShhApiName, TxPoolApiName, PersonalApiName, Web3ApiName,
}, ",")
)
Loading

0 comments on commit 0427aad

Please sign in to comment.