Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: support MpoolGetConfig #51

Merged
merged 1 commit into from
Apr 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,9 @@ type Proxy interface {

MpoolPublishByAddr(context.Context, address.Address) error //perm:write

// MpoolGetConfig returns (a copy of) the current mpool config
MpoolGetConfig(context.Context) (*types.MpoolConfig, error) //perm:read

// StateGetRandomnessFromTickets is used to sample the chain for randomness.
StateGetRandomnessFromTickets(ctx context.Context, personalization crypto.DomainSeparationTag, randEpoch abi.ChainEpoch, entropy []byte, tsk types.TipSetKey) (abi.Randomness, error) //perm:read
// StateGetRandomnessFromBeacon is used to sample the beacon for randomness.
Expand Down Expand Up @@ -600,8 +603,6 @@ type UnSupport interface {
// MpoolClear clears pending messages from the mpool
MpoolClear(context.Context, bool) error //perm:write

// MpoolGetConfig returns (a copy of) the current mpool config
MpoolGetConfig(context.Context) (*types.MpoolConfig, error) //perm:read
// MpoolSetConfig sets the mpool config to (a copy of) the supplied config
MpoolSetConfig(context.Context, *types.MpoolConfig) error //perm:admin

Expand Down
9 changes: 9 additions & 0 deletions proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,15 @@ func (p *Proxy) MpoolBatchPushUntrusted(in0 context.Context, in1 []*types.Signed
return cli.MpoolBatchPushUntrusted(in0, in1)
}

func (p *Proxy) MpoolGetConfig(in0 context.Context) (out0 *types.MpoolConfig, err error) {
cli, err := p.Select(types.EmptyTSK)
if err != nil {
err = fmt.Errorf("api MpoolGetConfig %v", err)
return
}
return cli.MpoolGetConfig(in0)
}

func (p *Proxy) MpoolGetNonce(in0 context.Context, in1 address.Address) (out0 uint64, err error) {
cli, err := p.Select(types.EmptyTSK)
if err != nil {
Expand Down
9 changes: 0 additions & 9 deletions proxy/unsupport.go
Original file line number Diff line number Diff line change
Expand Up @@ -544,15 +544,6 @@ func (p *UnSupport) MpoolClear(in0 context.Context, in1 bool) (err error) {
return cli.MpoolClear(in0, in1)
}

func (p *UnSupport) MpoolGetConfig(in0 context.Context) (out0 *types.MpoolConfig, err error) {
cli, err := p.Select(types.EmptyTSK)
if err != nil {
err = fmt.Errorf("api MpoolGetConfig %v", err)
return
}
return cli.MpoolGetConfig(in0)
}

func (p *UnSupport) MpoolPushUntrusted(in0 context.Context, in1 *types.SignedMessage) (out0 cid.Cid, err error) {
cli, err := p.Select(types.EmptyTSK)
if err != nil {
Expand Down