Skip to content

Commit

Permalink
remove unused block height
Browse files Browse the repository at this point in the history
  • Loading branch information
ramtinms committed Jul 17, 2024
1 parent a370f70 commit 76ea3b8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
11 changes: 6 additions & 5 deletions fvm/evm/types/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@ func NewBlock(
totalSupply *big.Int,
) *Block {
return &Block{
ParentBlockHash: parentBlockHash,
Height: height,
Timestamp: timestamp,
TotalSupply: totalSupply,
ReceiptRoot: gethTypes.EmptyReceiptsHash,
ParentBlockHash: parentBlockHash,
Height: height,
Timestamp: timestamp,
TotalSupply: totalSupply,
ReceiptRoot: gethTypes.EmptyReceiptsHash,
TransactionHashRoot: gethTypes.EmptyRootHash,
}
}

Expand Down
5 changes: 0 additions & 5 deletions fvm/evm/types/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,12 @@ type transactionEvent struct {
Payload []byte // transaction RLP-encoded payload
Result *Result // transaction execution result
BlockHeight uint64
BlockHash gethCommon.Hash
}

// NewTransactionEvent creates a new transaction event with the given parameters
// - result: the result of the transaction execution
// - payload: the RLP-encoded payload of the transaction
// - blockHeight: the height of the block where the transaction is included
// - blockHash: the hash of the block where the transaction is included
func NewTransactionEvent(
result *Result,
payload []byte,
Expand All @@ -67,8 +65,6 @@ var transactionEventFields = []cadence.Field{
cadence.NewField("contractAddress", cadence.StringType),
cadence.NewField("logs", cadenceArrayTypeOfUInt8),
cadence.NewField("blockHeight", cadence.UInt64Type),
// todo we can remove hash and just reference block by height (evm-gateway dependency)
cadence.NewField("blockHash", cadenceHashType),
cadence.NewField("returnedData", cadenceArrayTypeOfUInt8),
cadence.NewField("precompiledCalls", cadenceArrayTypeOfUInt8),
}
Expand Down Expand Up @@ -116,7 +112,6 @@ func (p *transactionEvent) ToCadence(location common.Location) (cadence.Event, e
deployedAddress,
BytesToCadenceUInt8ArrayValue(encodedLogs),
cadence.NewUInt64(p.BlockHeight),
HashToCadenceArrayValue(p.BlockHash),
BytesToCadenceUInt8ArrayValue(p.Result.ReturnedData),
BytesToCadenceUInt8ArrayValue(p.Result.PrecompiledCalls),
}).WithType(eventType), nil
Expand Down

0 comments on commit 76ea3b8

Please sign in to comment.