Skip to content

Commit

Permalink
fix(storagemarket): fix rebase issues
Browse files Browse the repository at this point in the history
fix problems from rebase and add a few doc things
  • Loading branch information
hannahhoward committed Jun 26, 2020
1 parent c7ab3cb commit 34adcc4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
10 changes: 10 additions & 0 deletions storagemarket/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,16 @@ func ValidateAskSignature(ctx context.Context, ask *SignedStorageAsk, tok shared
```
Verify the signature in `ask`, returning true (valid) or false (invalid).


#### GetMinerInfo
```go
func GetMinerInfo(ctx context.Context, maddr address.Address, tok shared.TipSetToken,
) (*StorageProviderInfo, error)
```

Returns `StorageProviderInfo` for a specific provider at the given address


## Construction

### StorageClient
Expand Down
3 changes: 3 additions & 0 deletions storagemarket/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,7 @@ type StorageClientNode interface {

// ValidateAskSignature verifies a the signature is valid for a given SignedStorageAsk
ValidateAskSignature(ctx context.Context, ask *SignedStorageAsk, tok shared.TipSetToken) (bool, error)

// GetMinerInfo returns info for a single miner with the given address
GetMinerInfo(ctx context.Context, maddr address.Address, tok shared.TipSetToken) (*StorageProviderInfo, error)
}
4 changes: 2 additions & 2 deletions storagemarket/testnodes/testnodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,12 @@ func (n *FakeClientNode) GetDefaultWalletAddress(ctx context.Context) (address.A
return n.ClientAddr, nil
}

// GetMinerInfo returns stubbed information for the first miner in storage market state
func (n *FakeClientNode) GetMinerInfo(ctx context.Context, maddr address.Address, tok shared.TipSetToken) (*storagemarket.StorageProviderInfo, error) {
if len(n.SMState.Providers) == 0 {
return nil, errors.New("Provider not found")
} else {
return n.SMState.Providers[0], nil
}
return n.SMState.Providers[0], nil
}

// ValidateAskSignature returns the stubbed validation error and a boolean value
Expand Down

0 comments on commit 34adcc4

Please sign in to comment.