2022-05-02 15:28:50 +02:00
|
|
|
#ifndef EIP712_CTX_H_
|
|
|
|
|
#define EIP712_CTX_H_
|
|
|
|
|
|
2022-05-16 10:59:20 +02:00
|
|
|
#ifdef HAVE_EIP712_FULL_SUPPORT
|
2022-05-02 15:28:50 +02:00
|
|
|
|
2022-05-16 10:59:20 +02:00
|
|
|
#include <stdbool.h>
|
2022-07-19 11:49:18 +02:00
|
|
|
#include "ethUstream.h" // ADDRESS_LENGTH
|
2022-05-02 15:28:50 +02:00
|
|
|
|
2022-07-19 11:49:18 +02:00
|
|
|
typedef struct {
|
2022-06-09 15:21:27 +02:00
|
|
|
uint8_t contract_addr[ADDRESS_LENGTH];
|
2022-08-16 18:44:28 +02:00
|
|
|
uint64_t chain_id;
|
2022-06-29 14:51:37 +02:00
|
|
|
uint8_t schema_hash[224 / 8];
|
2022-07-19 11:49:18 +02:00
|
|
|
} s_eip712_context;
|
2022-06-09 12:00:42 +02:00
|
|
|
|
|
|
|
|
extern s_eip712_context *eip712_context;
|
2022-05-02 15:28:50 +02:00
|
|
|
|
2022-07-19 11:49:18 +02:00
|
|
|
bool eip712_context_init(void);
|
|
|
|
|
void eip712_context_deinit(void);
|
2022-05-12 17:30:26 +02:00
|
|
|
|
2022-10-18 11:09:00 +02:00
|
|
|
typedef enum { NOT_INITIALIZED, INITIALIZED, DEFINED } e_struct_init;
|
2022-08-08 13:53:41 +02:00
|
|
|
extern e_struct_init struct_state;
|
|
|
|
|
|
2022-07-19 11:49:18 +02:00
|
|
|
#endif // HAVE_EIP712_FULL_SUPPORT
|
2022-05-16 10:59:20 +02:00
|
|
|
|
2022-07-19 11:49:18 +02:00
|
|
|
#endif // EIP712_CTX_H_
|