From 4d300e4dece56535f56ccc32330340ce89e42581 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=9ETH=CE=9E=D0=AFSPH=CE=9E=D0=AF=CE=9E?= <{viktor.tron,nagydani,zsfelfoldi}@gmail.com> Date: Mon, 29 Aug 2016 21:18:00 +0200 Subject: swarm: plan bee for content storage and distribution on web3 This change imports the Swarm protocol codebase. Compared to the 'swarm' branch, a few mostly cosmetic changes had to be made: * The various redundant log message prefixes are gone. * All files now have LGPLv3 license headers. * Minor code changes were needed to please go vet and make the tests pass on Windows. * Further changes were required to adapt to the go-ethereum develop branch and its new Go APIs. Some code has not (yet) been brought over: * swarm/cmd/bzzhash: will reappear as cmd/bzzhash later * swarm/cmd/bzzup.sh: will be reimplemented in cmd/bzzup * swarm/cmd/makegenesis: will reappear somehow * swarm/examples/album: will move to a separate repository * swarm/examples/filemanager: ditto * swarm/examples/files: will not be merged * swarm/test/*: will not be merged * swarm/services/swear: will reappear as contracts/swear when needed --- contracts/chequebook/cheque.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'contracts') diff --git a/contracts/chequebook/cheque.go b/contracts/chequebook/cheque.go index 8199904ef..5ece1391b 100644 --- a/contracts/chequebook/cheque.go +++ b/contracts/chequebook/cheque.go @@ -42,6 +42,7 @@ import ( "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/logger" "github.com/ethereum/go-ethereum/logger/glog" + "github.com/ethereum/go-ethereum/swarm/services/swap/swap" "golang.org/x/net/context" ) @@ -408,8 +409,7 @@ func NewOutbox(chbook *Chequebook, beneficiary common.Address) *Outbox { } // Issue creates cheque. -func (self *Outbox) Issue(amount *big.Int) (interface{}, error) { - // TODO(fjl): the return type should be more descriptive. +func (self *Outbox) Issue(amount *big.Int) (swap.Promise, error) { return self.chequeBook.Issue(self.beneficiary, amount) } @@ -546,8 +546,7 @@ func (self *Inbox) autoCash(cashInterval time.Duration) { // Receive is called to deposit the latest cheque to the incoming Inbox. // The given promise must be a *Cheque. -func (self *Inbox) Receive(promise interface{}) (*big.Int, error) { - // TODO(fjl): the type of promise should be safer +func (self *Inbox) Receive(promise swap.Promise) (*big.Int, error) { ch := promise.(*Cheque) defer self.lock.Unlock() -- cgit v1.2.3