Skip to content

Commit

Permalink
Add validation and fields
Browse files Browse the repository at this point in the history
  • Loading branch information
rianhughes committed Nov 22, 2023
1 parent 9cbfcea commit c250d0e
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions rpc/types_transaction_receipt.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,19 +367,30 @@ type ExecutionResources struct {
// The number of unused memory cells (each cell is roughly equivalent to a step)
MemoryHoles int `json:"memory_holes,omitempty"`
// The number of RANGE_CHECK builtin instances
RangeCheckApps int `json:"range_check_builtin_applications"`
RangeCheckApps int `json:"range_check_builtin_applications,omitempty"`
// The number of Pedersen builtin instances
PedersenApps int `json:"pedersen_builtin_applications"`
PedersenApps int `json:"pedersen_builtin_applications,omitempty"`
// The number of Poseidon builtin instances
PoseidonApps int `json:"poseidon_builtin_applications"`
PoseidonApps int `json:"poseidon_builtin_applications,omitempty"`
// The number of EC_OP builtin instances
ECOPApps int `json:"ec_op_builtin_applications"`
ECOPApps int `json:"ec_op_builtin_applications,omitempty"`
// The number of ECDSA builtin instances
ECDSAApps int `json:"ecdsa_builtin_applications"`
ECDSAApps int `json:"ecdsa_builtin_applications,omitempty"`
// The number of BITWISE builtin instances
BitwiseApps int `json:"bitwise_builtin_applications"`
BitwiseApps int `json:"bitwise_builtin_applications,omitempty"`
// The number of KECCAK builtin instances
KeccakApps int `json:"keccak_builtin_applications"`
KeccakApps int `json:"keccak_builtin_applications,omitempty"`
// The number of accesses to the segment arena
SegmentArenaBuiltin int `json:"segment_arena_builtin,omitempty"`
}

func (er *ExecutionResources) Validation() bool {
if er.Steps == 0 || er.MemoryHoles == 0 || er.RangeCheckApps == 0 || er.PedersenApps == 0 ||
er.PoseidonApps == 0 || er.ECOPApps == 0 || er.ECDSAApps == 0 || er.BitwiseApps == 0 ||
er.KeccakApps == 0 || er.SegmentArenaBuiltin == 0 {
return false
}
return true
}

// Hash returns the transaction hash of the PendingCommonTransactionReceiptProperties.
Expand Down

0 comments on commit c250d0e

Please sign in to comment.