Skip to content
Merged
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
2 changes: 1 addition & 1 deletion src/BlockBuilderPolicy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ contract BlockBuilderPolicy is

bytes32 workloadKey = WorkloadId.unwrap(workloadId);
string memory commitHash = approvedWorkloads[workloadKey].commitHash;
emit BlockBuilderProofVerified(teeAddress, workloadKey, block.number, version, blockContentHash, commitHash);
emit BlockBuilderProofVerified(teeAddress, workloadKey, version, blockContentHash, commitHash);
}

/// @inheritdoc IBlockBuilderPolicy
Expand Down
8 changes: 1 addition & 7 deletions src/interfaces/IBlockBuilderPolicy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,11 @@ interface IBlockBuilderPolicy {
/// @notice Emitted when a block builder proof is successfully verified
/// @param caller The address that called the verification function (TEE address)
/// @param workloadId The workload identifier of the TEE
/// @param blockNumber The block number when the verification occurred
/// @param version The flashtestation protocol version used
/// @param blockContentHash The hash of the block content
/// @param commitHash The git commit hash associated with the workload
event BlockBuilderProofVerified(
address caller,
bytes32 workloadId,
uint256 blockNumber,
uint8 version,
bytes32 blockContentHash,
string commitHash
address caller, bytes32 workloadId, uint8 version, bytes32 blockContentHash, string commitHash
);

// ============ Errors ============
Expand Down
28 changes: 4 additions & 24 deletions test/BlockBuilderPolicy.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -464,12 +464,7 @@ contract BlockBuilderPolicyTest is Test {
bytes32 blockContentHash = bytes32(hex"1234");
vm.expectEmit(address(policy));
emit IBlockBuilderPolicy.BlockBuilderProofVerified(
mockf200.teeAddress,
WorkloadId.unwrap(actualWorkloadId),
block.number,
1,
blockContentHash,
mockf200.commitHash
mockf200.teeAddress, WorkloadId.unwrap(actualWorkloadId), 1, blockContentHash, mockf200.commitHash
);

vm.prank(mockf200.teeAddress);
Expand Down Expand Up @@ -517,12 +512,7 @@ contract BlockBuilderPolicyTest is Test {
// Expect the event to be emitted
vm.expectEmit(address(policy));
emit IBlockBuilderPolicy.BlockBuilderProofVerified(
teeAddress,
WorkloadId.unwrap(actualWorkloadId),
block.number,
version,
blockContentHash,
mock46f6.commitHash
teeAddress, WorkloadId.unwrap(actualWorkloadId), version, blockContentHash, mock46f6.commitHash
);

// Call the function
Expand Down Expand Up @@ -553,12 +543,7 @@ contract BlockBuilderPolicyTest is Test {
// Expect the event to be emitted
vm.expectEmit(address(policy));
emit IBlockBuilderPolicy.BlockBuilderProofVerified(
teeAddress,
WorkloadId.unwrap(actualWorkloadId),
block.number,
version,
blockContentHash,
mock46f6.commitHash
teeAddress, WorkloadId.unwrap(actualWorkloadId), version, blockContentHash, mock46f6.commitHash
);

// Call the function
Expand All @@ -577,12 +562,7 @@ contract BlockBuilderPolicyTest is Test {
// Expect the event to be emitted
vm.expectEmit(address(policy));
emit IBlockBuilderPolicy.BlockBuilderProofVerified(
teeAddress,
WorkloadId.unwrap(actualWorkloadId),
block.number,
version,
blockContentHash,
mock46f6.commitHash
teeAddress, WorkloadId.unwrap(actualWorkloadId), version, blockContentHash, mock46f6.commitHash
);

// Call the function
Expand Down