-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expand and update instruction count tests (#16522)
- Loading branch information
Showing
3 changed files
with
13 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,16 @@ | ||
/** | ||
* @brief Example C++-based BPF program that prints out the parameters | ||
* @brief Example C++ based BPF program that prints out the parameters | ||
* passed to it | ||
*/ | ||
#include <solana_sdk.h> | ||
|
||
/** | ||
* Custom error for when input serialization fails | ||
*/ | ||
#define INVALID_INPUT 1 | ||
|
||
extern uint64_t entrypoint(const uint8_t *input) { | ||
SolAccountInfo ka[1]; | ||
SolParameters params = (SolParameters) { .ka = ka }; | ||
|
||
sol_log(__FILE__); | ||
|
||
if (!sol_deserialize(input, ¶ms, SOL_ARRAY_SIZE(ka))) { | ||
return ERROR_INVALID_ARGUMENT; | ||
} | ||
|
||
// Log the provided input parameters. In the case of the no-op | ||
// program, no account keys or input data are expected but real | ||
// programs will have specific requirements so they can do their work. | ||
sol_log_params(¶ms); | ||
return SUCCESS; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
/** | ||
* @brief Example C-based BPF noop program | ||
* @brief Example C based BPF program that prints out the parameters | ||
* passed to it | ||
*/ | ||
#include <solana_sdk.h> | ||
|
||
extern uint64_t entrypoint(const uint8_t *input) { | ||
SolAccountInfo ka[1]; | ||
SolParameters params = (SolParameters) { .ka = ka }; | ||
|
||
if (!sol_deserialize(input, ¶ms, SOL_ARRAY_SIZE(ka))) { | ||
return ERROR_INVALID_ARGUMENT; | ||
} | ||
|
||
return SUCCESS; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters