-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
赵波
committed
Aug 27, 2020
1 parent
83eb398
commit 298ca2b
Showing
19 changed files
with
524 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
package filecoin | ||
|
||
import "context" | ||
import ( | ||
"context" | ||
"github.com/myxtype/filecoin-client/types" | ||
) | ||
|
||
// BeaconGetEntry returns the beacon entry for the given filecoin epoch. If the entry has not yet been produced, the call will block until the entry becomes available | ||
func (c *Client) BeaconGetEntry(ctx context.Context, epoch int64) (*BeaconEntry, error) { | ||
var be *BeaconEntry | ||
func (c *Client) BeaconGetEntry(ctx context.Context, epoch int64) (*types.BeaconEntry, error) { | ||
var be *types.BeaconEntry | ||
return be, c.Request(ctx, c.FilecoinMethod("BeaconGetEntry"), &be, epoch) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package crypto | ||
|
||
import ( | ||
"fmt" | ||
"math" | ||
) | ||
|
||
type SigType byte | ||
|
||
const ( | ||
SigTypeUnknown = SigType(math.MaxUint8) | ||
|
||
SigTypeSecp256k1 = SigType(iota) // Most | ||
SigTypeBLS | ||
) | ||
|
||
func (t SigType) Name() (string, error) { | ||
switch t { | ||
case SigTypeUnknown: | ||
return "unknown", nil | ||
case SigTypeSecp256k1: | ||
return "secp256k1", nil | ||
case SigTypeBLS: | ||
return "bls", nil | ||
default: | ||
return "", fmt.Errorf("invalid signature type: %d", t) | ||
} | ||
} | ||
|
||
type Signature struct { | ||
Type SigType `json:"Type"` | ||
Data []byte `json:"Data"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.