p2p/protocols: finalized accounting implementation

This commit is contained in:
Fabio Barone 2018-10-19 11:58:06 -05:00
parent f2dee249c3
commit fdbbef4f5f

View file

@ -20,7 +20,6 @@ import (
"testing" "testing"
"github.com/ethereum/go-ethereum/p2p" "github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/ethereum/go-ethereum/p2p/simulations/adapters" "github.com/ethereum/go-ethereum/p2p/simulations/adapters"
"github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/rlp"
) )
@ -31,11 +30,6 @@ type dummyBalance struct {
peer *Peer peer *Peer
} }
//dummy Balance implementation
type testExchangeBalance struct {
balances map[enode.ID]int64
}
//dummy Prices implementation //dummy Prices implementation
type dummyPrices struct{} type dummyPrices struct{}
@ -114,12 +108,6 @@ func (d *dummyBalance) Add(amount int64, peer *Peer) error {
return nil return nil
} }
//test exchanges balance implementation
func (d *testExchangeBalance) Add(amount int64, peer *Peer) error {
d.balances[peer.ID()] += amount
return nil
}
type testCase struct { type testCase struct {
msg interface{} msg interface{}
size uint32 size uint32