Extract data for external plugins from internal plugin file

This commit is contained in:
Francois Beutin
2024-01-15 19:25:44 +01:00
parent ca9d5c9c77
commit 294f88195b
17 changed files with 94 additions and 46 deletions

View File

@@ -1,25 +1,13 @@
#ifndef _ETH_PLUGIN_INTERNAL_H_
#define _ETH_PLUGIN_INTERNAL_H_
#pragma once
#include <stdint.h>
#include <stdbool.h>
#include "shared_context.h"
#include "eth_plugin_interface.h"
#define SELECTOR_SIZE 4
#define PARAMETER_LENGTH 32
void copy_address(uint8_t* dst, const uint8_t* parameter, uint8_t dst_size);
void copy_parameter(uint8_t* dst, const uint8_t* parameter, uint8_t dst_size);
void erc721_plugin_call(int message, void* parameters);
void erc1155_plugin_call(int message, void* parameters);
// Get the value from the beginning of the parameter (right to left) and check if the rest of it is
// zero
bool U2BE_from_parameter(const uint8_t* parameter, uint16_t* value);
bool U4BE_from_parameter(const uint8_t* parameter, uint32_t* value);
typedef bool (*PluginAvailableCheck)(void);
typedef void (*PluginCall)(int, void*);
@@ -49,5 +37,3 @@ extern const uint8_t* const STARKWARE_SELECTORS[NUM_STARKWARE_SELECTORS];
#endif
extern internalEthPlugin_t const INTERNAL_ETH_PLUGINS[];
#endif // _ETH_PLUGIN_INTERNAL_H_