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

feat(rpc): Transaction proxy for staking tx types #984

Merged
merged 6 commits into from
Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
docs: adding punctuation, removing todo
  • Loading branch information
distractedm1nd committed Aug 9, 2022
commit cdb6156dacf721296357d167273ceb375bbcbe74
1 change: 1 addition & 0 deletions service/rpc/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ type delegationRequest struct {
GasLimit uint64 `json:"gas_limit"`
}

// delegationRequest represents a request for redelegation
distractedm1nd marked this conversation as resolved.
Show resolved Hide resolved
type redelegationRequest struct {
renaynay marked this conversation as resolved.
Show resolved Hide resolved
From string `json:"from"`
To string `json:"to"`
Expand Down
1 change: 0 additions & 1 deletion service/state/core_access.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ func (ca *CoreAccessor) CancelUnbondingDelegation(
return nil, err
}
coins := sdktypes.NewCoin(app.BondDenom, amount)
// TODO(distractedm1nd): Is this the best way to be getting the height? Should it be head.Height or head.Height - 1?
head, err := ca.getter.Head(ctx)
if err != nil {
return nil, err
Expand Down
6 changes: 3 additions & 3 deletions service/state/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ type Accessor interface {
// SubmitPayForData builds, signs and submits a PayForData transaction.
SubmitPayForData(ctx context.Context, nID namespace.ID, data []byte, gasLim uint64) (*TxResponse, error)

// CancelUnbondingDelegation cancels a user's pending undelegation from a validator
// CancelUnbondingDelegation cancels a user's pending undelegation from a validator.
CancelUnbondingDelegation(ctx context.Context, valAddr Address, amount Int, gasLim uint64) (*TxResponse, error)
// BeginRedelegate sends a user's delegated tokens to a new validator for redelegation.
BeginRedelegate(ctx context.Context, srcValAddr, dstValAddr Address, amount Int, gasLim uint64) (*TxResponse, error)
// Undelegate undelegates a user's delegated tokens, unbonding them from the current validator
// Undelegate undelegates a user's delegated tokens, unbonding them from the current validator.
Undelegate(ctx context.Context, delAddr Address, amount Int, gasLim uint64) (*TxResponse, error)
// Delegate sends a user's liquid tokens to a validator for delegation
// Delegate sends a user's liquid tokens to a validator for delegation.
Delegate(ctx context.Context, delAddr Address, amount Int, gasLim uint64) (*TxResponse, error)
}