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 various static check errors #61

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
17 changes: 8 additions & 9 deletions core/types/deposit_tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/rlp"
primitivev1 "buf.build/gen/go/astria/primitives/protocolbuffers/go/astria/primitive/v1"
)

var _ TxData = &DepositTx{}
Expand All @@ -26,8 +25,8 @@ type DepositTx struct {
// to the `mint` function calldata.
Data []byte
// the transaction ID of the source action for the deposit, consisting
// of the transaction hash.
SourceTransactionId primitivev1.TransactionId
// of the transaction hash.
SourceTransactionId string
// index of the deposit's source action within its transaction
SourceTransactionIndex uint64
}
Expand All @@ -39,12 +38,12 @@ func (tx *DepositTx) copy() TxData {
}

cpy := &DepositTx{
From: tx.From,
Value: new(big.Int),
Gas: tx.Gas,
To: to,
Data: make([]byte, len(tx.Data)),
SourceTransactionId: tx.SourceTransactionId,
From: tx.From,
Value: new(big.Int),
Gas: tx.Gas,
To: to,
Data: make([]byte, len(tx.Data)),
SourceTransactionId: tx.SourceTransactionId,
SourceTransactionIndex: tx.SourceTransactionIndex,
}

Expand Down
2 changes: 1 addition & 1 deletion grpc/execution/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func (s *ExecutionServiceServerV1) GetBlock(ctx context.Context, req *astriaPb.G
// BatchGetBlocks will return an array of Blocks given an array of block
// identifiers.
func (s *ExecutionServiceServerV1) BatchGetBlocks(ctx context.Context, req *astriaPb.BatchGetBlocksRequest) (*astriaPb.BatchGetBlocksResponse, error) {
if req.Identifiers == nil || len(req.Identifiers) == 0 {
if len(req.Identifiers) == 0 {
return nil, status.Error(codes.InvalidArgument, "identifiers cannot be empty")
}

Expand Down
6 changes: 3 additions & 3 deletions grpc/execution/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func validateAndUnmarshalSequencerTx(
Gas: 64000,
To: &bac.Erc20Asset.ContractAddress,
Data: calldata,
SourceTransactionId: *deposit.SourceTransactionId,
SourceTransactionId: deposit.SourceTransactionId.GetInner(),
SourceTransactionIndex: deposit.SourceActionIndex,
}

Expand All @@ -84,7 +84,7 @@ func validateAndUnmarshalSequencerTx(
To: &recipient,
Value: amount,
Gas: 0,
SourceTransactionId: *deposit.SourceTransactionId,
SourceTransactionId: deposit.SourceTransactionId.GetInner(),
SourceTransactionIndex: deposit.SourceActionIndex,
}
return types.NewTx(&txdata), nil
Expand Down Expand Up @@ -115,7 +115,7 @@ func validateStaticExecuteBlockRequest(req *astriaPb.ExecuteBlockRequest) error
return fmt.Errorf("PrevBlockHash cannot be nil")
}
if req.Timestamp == nil {
return fmt.Errorf("Timestamp cannot be nil")
return fmt.Errorf("timestamp cannot be nil")
}

return nil
Expand Down
Loading