Skip to content

Commit

Permalink
Merge pull request ethereum#17 from CortexFoundation/ucwong
Browse files Browse the repository at this point in the history
Ucwong
  • Loading branch information
ucwong authored Aug 13, 2018
2 parents 168c3df + ef37a11 commit 80d0c04
Show file tree
Hide file tree
Showing 19 changed files with 889 additions and 154 deletions.
11 changes: 11 additions & 0 deletions accounts/abi/bind/backends/simulated.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,17 @@ func (b *SimulatedBackend) BalanceAt(ctx context.Context, contract common.Addres
return statedb.GetBalance(contract), nil
}

func (b *SimulatedBackend) UploadAt(ctx context.Context, contract common.Address, blockNumber *big.Int) (*big.Int, error) {
b.mu.Lock()
defer b.mu.Unlock()

if blockNumber != nil && blockNumber.Cmp(b.blockchain.CurrentBlock().Number()) != 0 {
return nil, errBlockNumberUnsupported
}
statedb, _ := b.blockchain.State()
return statedb.GetUpload(contract), nil
}

// NonceAt returns the nonce of a certain account in the blockchain.
func (b *SimulatedBackend) NonceAt(ctx context.Context, contract common.Address, blockNumber *big.Int) (uint64, error) {
b.mu.Lock()
Expand Down
10 changes: 5 additions & 5 deletions cmd/swarm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,23 +322,23 @@ Downloads a swarm bzz uri to the given dir. When no dir is provided, working dir
Description: "Updates a MANIFEST by adding/removing/updating the hash of a path.\nCOMMAND could be: add, update, remove",
Subcommands: []cli.Command{
{
Action: add,
Action: manifestAdd,
CustomHelpTemplate: helpTemplate,
Name: "add",
Usage: "add a new path to the manifest",
ArgsUsage: "<MANIFEST> <path> <hash> [<content-type>]",
ArgsUsage: "<MANIFEST> <path> <hash>",
Description: "Adds a new path to the manifest",
},
{
Action: update,
Action: manifestUpdate,
CustomHelpTemplate: helpTemplate,
Name: "update",
Usage: "update the hash for an already existing path in the manifest",
ArgsUsage: "<MANIFEST> <path> <newhash> [<newcontent-type>]",
ArgsUsage: "<MANIFEST> <path> <newhash>",
Description: "Update the hash for an already existing path in the manifest",
},
{
Action: remove,
Action: manifestRemove,
CustomHelpTemplate: helpTemplate,
Name: "remove",
Usage: "removes a path from the manifest",
Expand Down
Loading

0 comments on commit 80d0c04

Please sign in to comment.