Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
remove C test
Browse files Browse the repository at this point in the history
  • Loading branch information
rachel-bousfield committed Oct 3, 2023
1 parent 162cf32 commit 730c5e3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 48 deletions.
7 changes: 1 addition & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,8 @@ stylus_test_erc20_wasm = $(call get_stylus_test_wasm,erc20)
stylus_test_erc20_src = $(call get_stylus_test_rust,erc20)
stylus_test_read-return-data_wasm = $(call get_stylus_test_wasm,read-return-data)
stylus_test_read-return-data_src = $(call get_stylus_test_rust,read-return-data)
stylus_test_siphash_wasm = $(c_sdk)/examples/siphash/siphash.wasm
stylus_test_siphash_src = $(call get_stylus_test_c,siphash)

stylus_test_wasms = $(stylus_test_keccak_wasm) $(stylus_test_keccak-100_wasm) $(stylus_test_fallible_wasm) $(stylus_test_storage_wasm) $(stylus_test_siphash_wasm) $(stylus_test_multicall_wasm) $(stylus_test_log_wasm) $(stylus_test_create_wasm) $(stylus_test_sdk-storage_wasm) $(stylus_test_erc20_wasm) $(stylus_test_read-return-data_wasm) $(stylus_test_evm-data_wasm) $(stylus_test_bfs:.b=.wasm)
stylus_test_wasms = $(stylus_test_keccak_wasm) $(stylus_test_keccak-100_wasm) $(stylus_test_fallible_wasm) $(stylus_test_storage_wasm) $(stylus_test_multicall_wasm) $(stylus_test_log_wasm) $(stylus_test_create_wasm) $(stylus_test_sdk-storage_wasm) $(stylus_test_erc20_wasm) $(stylus_test_read-return-data_wasm) $(stylus_test_evm-data_wasm) $(stylus_test_bfs:.b=.wasm)
stylus_benchmarks = $(wildcard $(stylus_dir)/*.toml $(stylus_dir)/src/*.rs) $(stylus_test_wasms)
stylus_files = $(wildcard $(stylus_dir)/*.toml $(stylus_dir)/src/*.rs) $(rust_prover_files)

Expand Down Expand Up @@ -409,9 +407,6 @@ $(stylus_test_erc20_wasm): $(stylus_test_erc20_src)
$(cargo_nightly) --manifest-path $< --release --config $(stylus_cargo)
@touch -c $@ # cargo might decide to not rebuild the binary

$(stylus_test_siphash_wasm): $(stylus_test_siphash_src)
cd $(c_sdk)/examples/siphash/ && make

contracts/test/prover/proofs/float%.json: $(arbitrator_cases)/float%.wasm $(prover_bin) $(output_latest)/soft-float.wasm
$(prover_bin) $< -l $(output_latest)/soft-float.wasm -o $@ -b --allow-hostapi --require-success --always-merkleize

Expand Down
42 changes: 0 additions & 42 deletions arbitrator/stylus/src/test/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,48 +310,6 @@ fn test_rust() -> Result<()> {
check_instrumentation(native, machine)
}

#[test]
fn test_c() -> Result<()> {
// in siphash.c
// the inputs are a hash, key, and plaintext
// the output is whether the hash was valid

let filename = "../langs/c/examples/siphash/siphash.wasm";
let (compile, config, ink) = test_configs();

let text: Vec<u8> = (0..63).collect();
let key: Vec<u8> = (0..16).collect();
let key: [u8; 16] = key.try_into().unwrap();
let hash = crypto::siphash(&text, &key);

let mut args = key.to_vec();
args.extend(text);

let mut native = TestInstance::new_linked(filename, &compile, config)?;
let output = run_native(&mut native, &args, ink)?;
assert_eq!(output, hash.to_le_bytes());

let mut machine = Machine::from_user_path(Path::new(filename), &compile)?;
let output = run_machine(&mut machine, &args, config, ink)?;
assert_eq!(output, hash.to_le_bytes());

check_instrumentation(native, machine)
}

#[test]
fn test_bf() -> Result<()> {
// in cat.b
// the output is the input

let (compile, config, ink) = test_configs();
let args = "Hello world!".as_bytes();

let mut native = TestInstance::new_linked("tests/bf/cat.wasm", &compile, config)?;
let output = run_native(&mut native, args, ink)?;
assert_eq!(output, args);
Ok(())
}

#[test]
fn test_fallible() -> Result<()> {
// in fallible.rs
Expand Down

0 comments on commit 730c5e3

Please sign in to comment.