Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
lit_node_unit_tests:
needs: build-if-needed
runs-on: warp-ubuntu-latest-x64-8x # change to LargeRunner to run on github. Change to self-hosted to run on our own runner. Change to buildjet-8vcpu-ubuntu-2204 to run on buildjet with 8 cpus
timeout-minutes: 40
timeout-minutes: 30

services:
anvil:
Expand Down Expand Up @@ -105,7 +105,62 @@ jobs:
timeout-minutes: 45
strategy:
matrix:
partition: [1, 2, 3]
partition: [1, 2, 3, 4]

services:
anvil:
image: litptcl/anvil-lit:latest
ports:
- 8545:8545
- 8549:8549
credentials:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

steps:
- name: Install deps
working-directory: ${{ github.workspace }}
run: sudo apt-get update && sudo apt-get install -y zstd libudev-dev libsqlite3-dev cmake protobuf-compiler
- name: Checkout lit-assets
uses: actions/checkout@v6
with:
submodules: recursive
- uses: de-vri-es/setup-git-credentials@v2
with:
credentials: https://glitch003:${{secrets.READ_ONLY_PAT}}@github.com/
- name: Use Node.js
uses: WarpBuilds/setup-node@v4
with:
node-version: 18.17.0
cache: npm
cache-dependency-path: ${{ github.workspace }}/blockchain/contracts/package-lock.json
- name: Install dependencies for blockchain/contracts
working-directory: ${{ github.workspace }}/blockchain/contracts
run: npm install
- name: Run npx hardhat compile for blockchain/contracts
working-directory: ${{ github.workspace }}/blockchain/contracts
run: npx hardhat compile
- run: mkdir -p ~/.cargo/bin
- name: Install nextest
run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C "${CARGO_HOME:-$HOME/.cargo}/bin"
- name: Download archive
uses: WarpBuilds/cache@v1
with:
path: rust/lit-node/lit-node/nextest-archive.tar.zst
key: nextest-archive-${{ github.sha }}-lit-actions|testing
- name: Unzip archive so that we can get the lit_node binary
run: zstd -d -c nextest-archive.tar.zst | tar xf -
- name: Setup local files for testing
run: make setup-local-files
- name: Run acceptance, component and integration tests.
run: "~/.cargo/bin/cargo-nextest nextest run --archive-file nextest-archive.tar.zst --final-status-level pass --profile integration-tests -E 'test(/^acceptance|^component|^integration|^sdk/) - test(/long/)' --partition count:${{ matrix.partition }}/4 --nocapture --"


# after the standard build is done, run the other integration tests
lit_node_other_tests:
needs: build-if-needed
runs-on: warp-ubuntu-latest-x64-8x # change to LargeRunner to run on github. Change to self-hosted to run on our own runner. Change to buildjet-8vcpu-ubuntu-2204 to run on buildjet with 8 cpus
timeout-minutes: 45

services:
anvil:
Expand Down Expand Up @@ -162,14 +217,16 @@ jobs:
cargo nextest run --final-status-level pass --no-capture --
working-directory: ${{github.workspace}}/rust/lit-node/shiva
- name: Run acceptance, component and integration tests.
run: "~/.cargo/bin/cargo-nextest nextest run --archive-file nextest-archive.tar.zst --final-status-level pass --profile integration-tests -E 'test(/^acceptance|^component|^integration|^sdk/) - test(/long/)' --partition count:${{ matrix.partition }}/3 --nocapture --"
run: "~/.cargo/bin/cargo-nextest nextest run --archive-file nextest-archive.tar.zst --final-status-level pass --profile integration-tests -E 'test(/^edge/) - test(/long/)' --nocapture --"


# AND together the results
check_status:
needs:
[
lit_node_unit_tests,
lit_node_integration_tests,
lit_node_other_tests,
]
runs-on: ubuntu-latest
steps:
Expand Down
104 changes: 19 additions & 85 deletions rust/lit-node/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions rust/lit-node/lit-node-testnet/src/end_user/datil_pkp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ impl Pkp {

let pkpnft_address = end_user.actions().datil_contracts().pkpnft.address();

info!(
"Datil signing provider: {:?}",
end_user.datil_signing_provider()
);

let client = Arc::new(SignerMiddleware::new(
end_user.datil_signing_provider(),
end_user.wallet.clone(),
Expand Down
23 changes: 6 additions & 17 deletions rust/lit-node/lit-node-testnet/src/end_user/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub struct EndUser {
actions: Actions,
pkps: Vec<Pkp>,
provider: Arc<Provider<Http>>,
datil_provider: Option<Arc<Provider<Http>>>,
datil_provider: Arc<Provider<Http>>,
}

#[derive(Debug, Clone)]
Expand All @@ -45,12 +45,7 @@ impl EndUser {
let new_wallet = LocalWallet::new(&mut OsRng).with_chain_id(testnet.chain_id);

let provider = testnet.provider.clone();

let datil_provider = if testnet.datil_testnet.is_some() {
Some(testnet.datil_testnet.as_ref().unwrap().provider.clone())
} else {
None
};
let datil_provider = testnet.datil_testnet.provider.clone();

info!("New wallet: {:?}", new_wallet.address());
Self {
Expand Down Expand Up @@ -97,11 +92,9 @@ impl EndUser {
self.set_wallet_balance_with_provider(provider, amount)
.await;

if self.datil_provider.is_some() {
let provider = self.datil_provider.as_ref().unwrap().clone();
self.set_wallet_balance_with_provider(provider, amount)
.await;
}
let provider = self.datil_provider.clone();
self.set_wallet_balance_with_provider(provider, amount)
.await;
}

async fn set_wallet_balance_with_provider(&self, provider: Arc<Provider<Http>>, amount: &str) {
Expand Down Expand Up @@ -228,12 +221,8 @@ impl EndUser {
pub fn datil_signing_provider(
&self,
) -> Arc<SignerMiddleware<Arc<Provider<Http>>, Wallet<SigningKey>>> {
if self.datil_provider.is_none() {
panic!("Secondary Datil network not found.");
}

Arc::new(SignerMiddleware::new(
self.datil_provider.as_ref().unwrap().clone(),
self.datil_provider.clone(),
self.wallet.clone(),
))
}
Expand Down
Loading