forked from qubic/core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHashStore.h
More file actions
39 lines (33 loc) · 821 Bytes
/
HashStore.h
File metadata and controls
39 lines (33 loc) · 821 Bytes
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
// src/contracts/HashStore.h
struct HASHSTORE {
Array<uint8, 32> hash;
};
// Input/output para o procedimento de setar o hash
struct SetHash_input {
Array<uint8, 32> hash;
};
struct SetHash_output {};
// Input/output para a função de consultar o hash
struct GetHash_input {};
struct GetHash_output {
Array<uint8, 32> hash;
};
// Procedimento público para setar o hash
PUBLIC_PROCEDURE(SetHash)
{
for (uint32 i = 0; i < 32; i += 1) {
state.hash[i] = input.hash[i];
}
}
// Função pública para consultar o hash
PUBLIC_FUNCTION(GetHash)
{
for (uint32 i = 0; i < 32; i += 1) {
output.hash[i] = state.hash[i];
}
}
// Registro das interfaces
void REGISTER_USER_FUNCTIONS_AND_PROCEDURES() {
REGISTER_USER_PROCEDURE(SetHash, 1);
REGISTER_USER_FUNCTION(GetHash, 2);
}