Skip to content

Commit

Permalink
NFC: Comment on TestDirective and input.json
Browse files Browse the repository at this point in the history
  • Loading branch information
ksolana committed May 30, 2024
1 parent 430a477 commit bc5249a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ pub enum TestDirective {
Xfail(String), // The test is expected to fail with the `String` message. It is an error if test passes.
Abort(u64), // The test should abort.
Log(String), // Test should pass.
Input(Input),
Input2(Input2),
Input(Input), // Input file with program_id, accounts, instruction_data
Input2(Input2),// Input file with program_id, entry_fn. // TODO: Single input.json should be used.
UseStdlib, // Build and link the move stdlib as bytecode
}

Expand All @@ -170,6 +170,7 @@ pub struct Input {

#[derive(Serialize, Deserialize, Debug, Eq, PartialEq, Clone)]
pub struct Input2 {
// FIXME: We should have single input.json loader with appropriate discriminators.
pub program_id: String,
pub entry_fn: String,
}
Expand Down
8 changes: 4 additions & 4 deletions external-crates/move/solana/move-to-solana/src/entry_codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub fn generate_move_call_message(

fn encode_instruction_data(
entry_fn_name: &str,
_args: &[MoveValue],
args: &[MoveValue],
) -> Result<Vec<u8>> {
let mut insn_data: Vec<u8> = vec![];

Expand All @@ -48,10 +48,10 @@ fn encode_instruction_data(
}

// encode remaining args of the function
if !_args.is_empty() {
let arglen = _args.len() as u64;
if !args.is_empty() {
let arglen = args.len() as u64;
insn_data.extend(&arglen.to_le_bytes());
for a in _args {
for a in args {
// serialize each move value.
// TODO: sui-graphql-rpc/src/types/move_value.rs has more
// advanced serialization methods to convert to json etc.
Expand Down

0 comments on commit bc5249a

Please sign in to comment.