Skip to content

Commit 59bf86c

Browse files
committed
TEST: make test; path fixes
1 parent 04d9d5f commit 59bf86c

File tree

12 files changed

+57
-5862
lines changed

12 files changed

+57
-5862
lines changed

Cargo.lock

Lines changed: 30 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Each major sub-repository in this monorepo has their own Makefiles;
2+
# instead of making an even more compilicated common one, let's delegate to them.
3+
4+
test:
5+
make -C fvm-utils test
6+
make -C ipc test
7+
make -C ipld-resolver test
8+
make -C fendermint test

fendermint/Makefile

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,9 @@
22

33
BUILTIN_ACTORS_TAG ?= v11.0.0
44
BUILTIN_ACTORS_BUNDLE := $(PWD)/builtin-actors/output/bundle.car
5-
BUILTIN_ACTORS_DIR := ../builtin-actors
5+
BUILTIN_ACTORS_DIR := ../../builtin-actors
66

7-
# Make sure this tag matches the one in Cargo.toml
8-
IPC_ACTORS_TAG ?= origin/dev
9-
IPC_ACTORS_DIR := $(PWD)/../ipc-solidity-actors
10-
IPC_ACTORS_CODE := $(shell find $(IPC_ACTORS_DIR) -type f -name "*.sol")
11-
IPC_ACTORS_ABI := .make/.ipc-actors-abi
7+
IPC_ACTORS_DIR := $(PWD)/../contracts
128
IPC_ACTORS_OUT := $(IPC_ACTORS_DIR)/out
139

1410
FENDERMINT_CODE := $(shell find . -type f \( -name "*.rs" -o -name "Cargo.toml" \) | grep -v target)
@@ -37,10 +33,10 @@ install:
3733
cargo install --locked --path fendermint/app
3834

3935
# Using --release for testing because wasm can otherwise be slow.
40-
test: $(IPC_ACTORS_ABI) $(BUILTIN_ACTORS_BUNDLE) $(BUILTIN_ACTORS_DIR)
36+
test: $(BUILTIN_ACTORS_BUNDLE) $(BUILTIN_ACTORS_DIR)
4137
FM_BUILTIN_ACTORS_BUNDLE=$(BUILTIN_ACTORS_BUNDLE) \
4238
FM_CONTRACTS_DIR=$(IPC_ACTORS_OUT) \
43-
cargo test --release --workspace --exclude smoke-test
39+
cargo test --release --package 'fendermint_*'
4440

4541
e2e: docker-build $(BUILTIN_ACTORS_DIR)
4642
cd fendermint/testing/smoke-test && cargo make --profile $(PROFILE)
@@ -65,7 +61,7 @@ check-fmt:
6561
check-clippy:
6662
cargo clippy --all --tests -- -D clippy::all
6763

68-
docker-deps: $(BUILTIN_ACTORS_BUNDLE) $(FENDERMINT_CODE) $(IPC_ACTORS_ABI)
64+
docker-deps: $(BUILTIN_ACTORS_BUNDLE) $(FENDERMINT_CODE)
6965
rm -rf docker/.artifacts
7066
mkdir -p docker/.artifacts/contracts
7167
cp -r $(IPC_ACTORS_OUT)/* docker/.artifacts/contracts
@@ -109,24 +105,6 @@ $(BUILTIN_ACTORS_DIR):
109105
git clone https://github.com/filecoin-project/builtin-actors.git . && \
110106
git checkout $(BUILTIN_ACTORS_TAG)
111107

112-
113-
# Compile the ABI artifacts of the IPC Solidity actors.
114-
ipc-actors-abi: $(IPC_ACTORS_ABI)
115-
116-
# Check out the IPC Solidity actors if necessary so we get the ABI artifacts, putting down a marker at the end.
117-
$(IPC_ACTORS_ABI): $(IPC_ACTORS_CODE)
118-
if [ ! -d $(IPC_ACTORS_DIR) ]; then \
119-
mkdir -p $(IPC_ACTORS_DIR) && \
120-
cd $(IPC_ACTORS_DIR) && \
121-
git clone https://github.com/consensus-shipyard/ipc-solidity-actors.git .; \
122-
fi
123-
cd $(IPC_ACTORS_DIR) && \
124-
git fetch origin && \
125-
git checkout $(IPC_ACTORS_TAG)
126-
@# The ABI are already checked in; otherwise we'd have to compile with foundry
127-
@# make -C $(IPC_ACTORS_DIR) compile-abi
128-
mkdir -p $(dir $@) && touch $@
129-
130108
.PHONY: protoc
131109
protoc:
132110
@if [ -z "$(shell which protoc)" ]; then \

fendermint/fendermint/eth/api/examples/ethers.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ type TestContractCall<C, T> = ContractCall<TestMiddleware<C>, T>;
6161
// This assumes that https://github.com/filecoin-project/builtin-actors is checked out next to this project,
6262
// which the Makefile in the root takes care of with `make actor-bundle`, a dependency of creating docker images.
6363
const SIMPLECOIN_HEX: &'static str =
64-
include_str!("../../../../../builtin-actors/actors/evm/tests/contracts/SimpleCoin.bin");
64+
include_str!("../../../../../../builtin-actors/actors/evm/tests/contracts/SimpleCoin.bin");
6565

6666
// const SIMPLECOIN_ABI: &'static str =
67-
// include_str!("../../../../../builtin-actors/actors/evm/tests/contracts/SimpleCoin.abi");
67+
// include_str!("../../../../../../builtin-actors/actors/evm/tests/contracts/SimpleCoin.abi");
6868

6969
/// Gas limit to set for transactions.
7070
const ENOUGH_GAS: u64 = 10_000_000_000u64;
@@ -76,7 +76,7 @@ const FILTERS_ENABLED: bool = true;
7676
// An example of what it looks like is at https://github.com/filecoin-project/ref-fvm/blob/evm-integration-tests/testing/integration/tests/evm/src/simple_coin/simple_coin.rs
7777
abigen!(
7878
SimpleCoin,
79-
"../../../../builtin-actors/actors/evm/tests/contracts/SimpleCoin.abi"
79+
"../../../../../builtin-actors/actors/evm/tests/contracts/SimpleCoin.abi"
8080
);
8181

8282
#[derive(Parser, Debug)]

fendermint/fendermint/rpc/examples/simplecoin.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ type MockProvider = ethers::providers::Provider<ethers::providers::MockProvider>
4040
type MockContractCall<T> = ethers::prelude::ContractCall<MockProvider, T>;
4141

4242
const CONTRACT_HEX: &'static str =
43-
include_str!("../../../../builtin-actors/actors/evm/tests/contracts/SimpleCoin.bin");
43+
include_str!("../../../../../builtin-actors/actors/evm/tests/contracts/SimpleCoin.bin");
4444

4545
lazy_static! {
4646
/// Default gas params based on the testkit.
@@ -56,7 +56,7 @@ lazy_static! {
5656
// which the `make actor-bundle` command takes care of if it wasn't.
5757
abigen!(
5858
SimpleCoin,
59-
"../../../builtin-actors/actors/evm/tests/contracts/SimpleCoin.abi"
59+
"../../../../builtin-actors/actors/evm/tests/contracts/SimpleCoin.abi"
6060
);
6161

6262
// Alternatively we can generate the ABI code as follows:

fendermint/fendermint/testing/contract-test/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "contract-test"
2+
name = "fendermint_contract_test"
33
description = "Model based testing for smart contracts"
44
version = "0.1.0"
55
authors.workspace = true

fendermint/fendermint/testing/contract-test/tests/staking/machine.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use std::{cell::RefCell, collections::HashSet, sync::Arc};
44

55
use arbitrary::{Arbitrary, Unstructured};
6-
use contract_test::ipc::{registry::RegistryCaller, subnet::SubnetCaller};
6+
use fendermint_contract_test::ipc::{registry::RegistryCaller, subnet::SubnetCaller};
77
use ethers::types as et;
88
use fendermint_crypto::{PublicKey, SecretKey};
99
use fendermint_testing::smt::StateMachine;
@@ -29,7 +29,7 @@ use super::{
2929
choose_amount,
3030
state::{StakingAccount, StakingState},
3131
};
32-
use contract_test::ipc::registry::SubnetConstructorParams;
32+
use fendermint_contract_test::ipc::registry::SubnetConstructorParams;
3333

3434
/// System Under Test for staking.
3535
pub struct StakingSystem {
@@ -85,7 +85,7 @@ impl StateMachine for StakingMachine {
8585
let rt = tokio::runtime::Runtime::new().expect("create tokio runtime for init");
8686

8787
let (mut exec_state, _) = rt
88-
.block_on(contract_test::init_exec_state(
88+
.block_on(fendermint_contract_test::init_exec_state(
8989
self.multi_engine.clone(),
9090
state.parent_genesis.clone(),
9191
))

fendermint/fendermint/testing/smoke-test/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "smoke-test"
2+
name = "fendermint_smoke_test"
33
description = "Provides some end-to-end integration testing between Fendermint and a full Tendermint node."
44
version = "0.1.0"
55
authors.workspace = true

fvm-utils/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
test:
2+
cargo test --release --package primitives --package "fil_*"

0 commit comments

Comments
 (0)