Skip to content

Commit 2ff5541

Browse files
committed
forge fmt
1 parent ac2be27 commit 2ff5541

2 files changed

Lines changed: 14 additions & 11 deletions

File tree

src/Asset.sol

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ contract Asset is Ownable, ReentrancyGuard, IAsset {
8484
event CreatorFeeClaimedBatch(bytes32[] indexed subscribers, uint256 totalAmount);
8585
event SubscriptionPriceUpdated(uint256 newSubscriptionPrice);
8686
event SubscriptionRevoked(bytes32 indexed subscriber, uint256 indexed nonce, uint256 indexed endTime, bool removed);
87-
event SubscriptionCancelled(bytes32 indexed subscriber, uint256 indexed nonce, uint256 indexed endTime, bool removed);
87+
event SubscriptionCancelled(
88+
bytes32 indexed subscriber, uint256 indexed nonce, uint256 indexed endTime, bool removed
89+
);
8890

8991
/// @notice Initializes the asset with id, price, payment token, and owner.
9092
/// Callable only by the registry (msg.sender).
@@ -524,10 +526,7 @@ contract Asset is Ownable, ReentrancyGuard, IAsset {
524526
emit SubscriptionRevoked(subscriber, nonce, endTime, removed);
525527
}
526528

527-
function cancelSubscription(string memory subscriberId, bytes memory signature)
528-
external
529-
nonReentrant
530-
{
529+
function cancelSubscription(string memory subscriberId, bytes memory signature) external nonReentrant {
531530
bytes32 subscriber = _hash(subscriberId, msg.sender);
532531

533532
bytes32 hash = _signatureHash(block.chainid, address(this), subscriber);
@@ -553,7 +552,11 @@ contract Asset is Ownable, ReentrancyGuard, IAsset {
553552
return result;
554553
}
555554

556-
function _signatureHash(uint256 chainId, address assetAddress, bytes32 subscriber) internal pure returns (bytes32 result) {
555+
function _signatureHash(uint256 chainId, address assetAddress, bytes32 subscriber)
556+
internal
557+
pure
558+
returns (bytes32 result)
559+
{
557560
result = keccak256(abi.encodePacked(chainId, assetAddress, subscriber));
558561
return result;
559562
}

test/Asset.t.sol

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ contract AssetTest is BaseTest {
6464
return keccak256(abi.encode(subscriberId, subscriberAddress));
6565
}
6666

67-
function _getCancellationSignatureWithKey(
68-
string memory subscriberId,
69-
address subscriberAddress,
70-
uint256 signingKey
71-
) internal view returns (bytes memory signature) {
67+
function _getCancellationSignatureWithKey(string memory subscriberId, address subscriberAddress, uint256 signingKey)
68+
internal
69+
view
70+
returns (bytes memory signature)
71+
{
7272
bytes32 subscriber = keccak256(abi.encode(subscriberId, subscriberAddress));
7373
bytes32 hash = keccak256(abi.encodePacked(block.chainid, address(asset), subscriber));
7474
bytes32 digest = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));

0 commit comments

Comments
 (0)