From 7ab65352bea4d881269cc43e8bb1dde2972dc30a Mon Sep 17 00:00:00 2001 From: jackcmay Date: Fri, 26 Oct 2018 11:53:44 -0700 Subject: [PATCH] Fix featurized integration test (#1621) Fix featurized integration test --- tests/programs.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/programs.rs b/tests/programs.rs index 54b58ae961..380f535134 100644 --- a/tests/programs.rs +++ b/tests/programs.rs @@ -1,9 +1,11 @@ extern crate bincode; extern crate elf; +extern crate serde_derive; extern crate solana; extern crate solana_sdk; use bincode::serialize; +use serde_derive::Serialize; use solana::bank::Bank; #[cfg(feature = "bpf_c")] use solana::bpf_loader; @@ -13,8 +15,6 @@ use solana::mint::Mint; use solana::native_loader; use solana::signature::{Keypair, KeypairUtil}; use solana::system_transaction::SystemTransaction; -#[cfg(feature = "bpf_c")] -use solana::tictactoe_program::Command; use solana::transaction::Transaction; use solana_sdk::pubkey::Pubkey; #[cfg(feature = "bpf_c")] @@ -334,6 +334,15 @@ fn test_program_bpf_noop_c() { ); } +#[derive(Debug, Serialize)] +#[repr(C)] +pub enum Command { + Init, // player X initializes a new game + Join(i64), // player O wants to join (seconds since UNIX epoch) + KeepAlive(i64), // player X/O keep alive (seconds since UNIX epoch) + Move(u8, u8), // player X/O mark board position (x, y) +} + #[cfg(feature = "bpf_c")] struct TicTacToe { game: Keypair,