Nit: Align Rust and C names (#8918)

This commit is contained in:
Jack May 2020-03-17 19:37:16 -07:00 committed by GitHub
parent f020370ae7
commit f192e4f08f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 53 additions and 53 deletions

View File

@ -9,7 +9,7 @@
*/
extern uint64_t entrypoint(const uint8_t *input) {
SolKeyedAccount ka[4];
SolAccountInfo ka[4];
SolParameters params = (SolParameters) { .ka = ka };
if (!sol_deserialize(input, &params, SOL_ARRAY_SIZE(ka))) {

View File

@ -9,7 +9,7 @@
*/
extern uint64_t entrypoint(const uint8_t *input) {
SolKeyedAccount ka[1];
SolAccountInfo ka[1];
SolParameters params = (SolParameters) { .ka = ka };
if (!sol_deserialize(input, &params, SOL_ARRAY_SIZE(ka))) {

View File

@ -11,7 +11,7 @@
#define NUM_KA 3
extern uint64_t entrypoint(const uint8_t *input) {
SolKeyedAccount ka[NUM_KA];
SolAccountInfo ka[NUM_KA];
SolParameters params = (SolParameters) { .ka = ka };
if (!sol_deserialize(input, &params, SOL_ARRAY_SIZE(ka))) {

View File

@ -10,7 +10,7 @@
#define INVALID_INPUT 1
extern uint64_t entrypoint(const uint8_t *input) {
SolKeyedAccount ka[1];
SolAccountInfo ka[1];
SolParameters params = (SolParameters) { .ka = ka };
sol_log(__FILE__);

View File

@ -5,7 +5,7 @@
#include <solana_sdk.h>
extern uint64_t entrypoint(const uint8_t *input) {
SolKeyedAccount ka[1];
SolAccountInfo ka[1];
SolParameters params = (SolParameters) { .ka = ka };
sol_log(__FILE__);

View File

@ -4,7 +4,7 @@ mod bpf {
bank::Bank,
bank_client::BankClient,
genesis_utils::{create_genesis_config, GenesisConfigInfo},
loader_utils::{load_program},
loader_utils::load_program,
};
use solana_sdk::{
account::Account,
@ -45,7 +45,7 @@ mod bpf {
}
#[test]
#[cfg(any(feature = "bpf_c", feature = "bpf_rust"))]
#[cfg(any(feature = "bpf_c", feature = "bpf_rust"))]
fn test_program_bpf_sanity() {
solana_logger::setup();

View File

@ -178,7 +178,7 @@ typedef struct {
bool is_signer; /** Transaction was signed by this account's key? */
bool is_writable; /** Is the account writable? */
bool executable; /** This account's data contains a loaded program (and is now read-only) */
} SolKeyedAccount;
} SolAccountInfo;
/**
* Copies memory
@ -252,9 +252,9 @@ if (!(expr)) { \
* Structure that the program's entrypoint input data is deserialized into.
*/
typedef struct {
SolKeyedAccount* ka; /** Pointer to an array of SolKeyedAccount, must already
point to an array of SolKeyedAccounts */
uint64_t ka_num; /** Number of SolKeyedAccount entries in `ka` */
SolAccountInfo* ka; /** Pointer to an array of SolAccountInfo, must already
point to an array of SolAccountInfos */
uint64_t ka_num; /** Number of SolAccountInfo entries in `ka` */
const uint8_t *data; /** pointer to the instruction data */
uint64_t data_len; /** Length in bytes of the instruction data */
const SolPubkey *program_id; /** program_id of the currently executing program */
@ -265,7 +265,7 @@ typedef struct {
*
* Use this function to deserialize the buffer passed to the program entrypoint
* into usable types. This function does not perform copy deserialization,
* instead it populates the pointers and lengths in SolKeyedAccount and data so
* instead it populates the pointers and lengths in SolAccountInfo and data so
* that any modification to lamports or account data take place on the original
* buffer. Doing so also eliminates the need to serialize back into the buffer
* at program end.