generated from zeroknots/femplate
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathMockCombination.sol
81 lines (65 loc) · 2.79 KB
/
MockCombination.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "src/external/IExternalResolver.sol";
import "src/external/IExternalSchemaValidator.sol";
import { IRegistry, SchemaUID, AttestationRequest } from "src/IRegistry.sol";
contract MockCombination is IExternalResolver, IExternalSchemaValidator {
bool immutable returnVal;
event AttestationCalled();
event RevokeCalled();
event ModuleCalled();
constructor(bool ret) {
returnVal = ret;
}
/*//////////////////////////////////////////////////////////////////////////
RESOLVER
//////////////////////////////////////////////////////////////////////////*/
function supportsInterface(bytes4 interfaceId) public pure override returns (bool) {
if (interfaceId == type(IExternalResolver).interfaceId || interfaceId == type(IExternalSchemaValidator).interfaceId) return true;
}
function resolveAttestation(AttestationRecord calldata attestation) external payable override returns (bool) {
emit AttestationCalled();
return returnVal;
}
function resolveAttestation(AttestationRecord[] calldata attestation) external payable override returns (bool) {
emit AttestationCalled();
return returnVal;
}
function resolveRevocation(AttestationRecord calldata attestation) external payable override returns (bool) {
emit RevokeCalled();
return returnVal;
}
function resolveRevocation(AttestationRecord[] calldata attestation) external payable override returns (bool) {
emit RevokeCalled();
return returnVal;
}
function resolveModuleRegistration(
address sender,
address moduleRecord,
ModuleRecord calldata record,
bytes calldata resolverContext
)
external
payable
override
returns (bool)
{
emit ModuleCalled();
return returnVal;
}
/*//////////////////////////////////////////////////////////////////////////
SCHEMA VALIDATOR
//////////////////////////////////////////////////////////////////////////*/
function validateSchema(AttestationRecord calldata attestation) external view override returns (bool) {
return returnVal;
}
function validateSchema(AttestationRecord[] calldata attestations) external view override returns (bool) {
return returnVal;
}
/*//////////////////////////////////////////////////////////////////////////
MOCK ATTESTER
//////////////////////////////////////////////////////////////////////////*/
function attest(IRegistry registry, SchemaUID schemaUID, AttestationRequest calldata request) external payable returns (bool) {
registry.attest(schemaUID, request);
}
}