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

[action] fix Incorrect conversion between integer types #3545

Merged
merged 2 commits into from
Jul 14, 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
8 changes: 4 additions & 4 deletions action/consignment_transfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ type (

// ConsignMsgEther is the consignment message format of Ethereum
ConsignMsgEther struct {
BucketIdx int `json:"bucket"`
Nonce int `json:"nonce"`
BucketIdx uint64 `json:"bucket"`
Nonce uint64 `json:"nonce"`
Recipient string `json:"recipient"`
Reclaim string `json:"reclaim"`
}
Expand Down Expand Up @@ -148,8 +148,8 @@ func NewConsignMsg(sigType, recipient string, bucketIdx, nonce uint64) ([]byte,
switch sigType {
case "Ethereum":
msg := ConsignMsgEther{
BucketIdx: int(bucketIdx),
Nonce: int(nonce),
BucketIdx: bucketIdx,
Nonce: nonce,
Recipient: recipient,
Reclaim: _reclaim,
}
Expand Down
4 changes: 2 additions & 2 deletions action/protocol/staking/handlers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2057,7 +2057,7 @@ func TestProtocol_HandleConsignmentTransfer(t *testing.T) {
// transfer to test.to through consignment
var consign []byte
if !test.nilPayload {
consign = newconsignment(require, int(test.sigIndex), int(test.sigNonce), test.bucketOwner, test.to.String(), test.consignType, test.reclaim, test.wrongSig)
consign = newconsignment(require, test.sigIndex, test.sigNonce, test.bucketOwner, test.to.String(), test.consignType, test.reclaim, test.wrongSig)
}

act, err := action.NewTransferStake(1, caller.String(), 0, consign, gasLimit, gasPrice)
Expand Down Expand Up @@ -2713,7 +2713,7 @@ func depositGas(ctx context.Context, sm protocol.StateManager, gasFee *big.Int)
return nil, accountutil.StoreAccount(sm, actionCtx.Caller, acc)
}

func newconsignment(r *require.Assertions, bucketIdx, nonce int, senderPrivate, recipient, consignTpye, reclaim string, wrongSig bool) []byte {
func newconsignment(r *require.Assertions, bucketIdx, nonce uint64, senderPrivate, recipient, consignTpye, reclaim string, wrongSig bool) []byte {
msg := action.ConsignMsgEther{
BucketIdx: bucketIdx,
Nonce: nonce,
Expand Down