Skip to content

Commit

Permalink
fix various static check errors
Browse files Browse the repository at this point in the history
  • Loading branch information
noot committed Dec 12, 2024
1 parent b0bacf6 commit c7379a6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
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

0 comments on commit c7379a6

Please sign in to comment.