Skip to content

Commit

Permalink
rusk: Rename execution-core to dusk-core
Browse files Browse the repository at this point in the history
  • Loading branch information
moCello committed Dec 18, 2024
1 parent 31f133e commit 2357fd6
Show file tree
Hide file tree
Showing 32 changed files with 50 additions and 50 deletions.
2 changes: 1 addition & 1 deletion rusk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ tokio-rustls = { workspace = true }
rustls-pemfile = { workspace = true }
async-trait = { workspace = true }

execution-core = { workspace = true, features = ["zk"] }
dusk-core = { workspace = true, features = ["zk"] }
rusk-profile = { workspace = true }
rusk-abi = { workspace = true, features = ["host"] }
rusk-prover = { workspace = true, features = ["std"], optional = true }
Expand Down
2 changes: 1 addition & 1 deletion rusk/benches/block_ingestion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use criterion::measurement::WallTime;
use criterion::{
criterion_group, criterion_main, BenchmarkGroup, BenchmarkId, Criterion,
};
use execution_core::transfer::Transaction as ProtocolTransaction;
use dusk_core::transfer::Transaction as ProtocolTransaction;
use node_data::bls::PublicKey;
use node_data::ledger::Transaction;
use rand::prelude::StdRng;
Expand Down
2 changes: 1 addition & 1 deletion rusk/src/lib/bloom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use blake3::{Hasher, OUT_LEN};
use dusk_bytes::Serializable;
use execution_core::Event;
use dusk_core::Event;

const BLOOM_BYTE_LEN: usize = 256;

Expand Down
4 changes: 2 additions & 2 deletions rusk/src/lib/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use std::{fmt, io};

use dusk_bytes::Serializable;
use execution_core::{
use dusk_core::{
signatures::bls::PublicKey as BlsPublicKey, transfer::phoenix::CoreError,
BlsScalar, Error as ExecErr,
};
Expand Down Expand Up @@ -74,7 +74,7 @@ impl From<PiecrustError> for Error {
}
}

impl From<execution_core::Error> for Error {
impl From<dusk_core::Error> for Error {
fn from(err: ExecErr) -> Self {
match err {
ExecErr::InsufficientBalance => {
Expand Down
2 changes: 1 addition & 1 deletion rusk/src/lib/gen_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Copyright (c) DUSK NETWORK. All rights reserved.

use blake2b_simd::Params;
use execution_core::{ContractId, CONTRACT_ID_BYTES};
use dusk_core::{ContractId, CONTRACT_ID_BYTES};

/// Generate a [`ContractId`] address from:
/// - slice of bytes,
Expand Down
4 changes: 2 additions & 2 deletions rusk/src/lib/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub(crate) use event::{
RequestData, Target,
};

use execution_core::Event;
use dusk_core::Event;
use tokio::task::JoinError;
use tracing::{debug, info, warn};

Expand Down Expand Up @@ -944,7 +944,7 @@ mod tests {
use super::*;
use event::Event as EventRequest;

use execution_core::ContractId;
use dusk_core::ContractId;
use node_data::events::contract::{
ContractEvent, ContractTxEvent, WrappedContractId,
};
Expand Down
4 changes: 2 additions & 2 deletions rusk/src/lib/http/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::collections::HashMap;
use std::net::SocketAddr;
use std::sync::Arc;

use execution_core::transfer::Transaction as ProtocolTransaction;
use dusk_core::transfer::Transaction as ProtocolTransaction;
use node::database::rocksdb::{Backend, DBTransaction};
use node::database::{Mempool, DB};
use node::mempool::MempoolSrv;
Expand Down Expand Up @@ -178,7 +178,7 @@ impl RuskNode {
&self,
data: &[u8],
) -> anyhow::Result<ResponseData> {
let tx = execution_core::transfer::Transaction::from_slice(data)
let tx = dusk_core::transfer::Transaction::from_slice(data)
.map_err(|e| anyhow::anyhow!("Invalid Data {e:?}"))?;
let db = self.inner().database();
let vm = self.inner().vm_handler();
Expand Down
4 changes: 2 additions & 2 deletions rusk/src/lib/http/chain/graphql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ use data::*;
use tx::*;

use async_graphql::{Context, FieldError, FieldResult, Object};
use execution_core::transfer::TRANSFER_CONTRACT;
use execution_core::ContractId;
use dusk_core::transfer::TRANSFER_CONTRACT;
use dusk_core::ContractId;
use node::database::rocksdb::Backend;
use node::database::{Ledger, DB};
use node_data::ledger::Label;
Expand Down
10 changes: 5 additions & 5 deletions rusk/src/lib/http/chain/graphql/archive/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use async_graphql::Object;
use dusk_bytes::Serializable;
use execution_core::signatures::bls::PublicKey as AccountPublicKey;
use dusk_core::signatures::bls::PublicKey as AccountPublicKey;
use node::archive::MoonlightGroup;

pub struct MoonlightTransfers(pub Vec<MoonlightGroup>);
Expand Down Expand Up @@ -46,12 +46,12 @@ impl ContractEvents {
}

/// Interim solution for sending out deserialized event data
/// TODO: #2773 add serde feature to execution-core
/// TODO: #2773 add serde feature to dusk-core
pub mod deserialized_archive_data {
use super::*;
use execution_core::stake::STAKE_CONTRACT;
use execution_core::transfer::withdraw::WithdrawReceiver;
use execution_core::transfer::{
use dusk_core::stake::STAKE_CONTRACT;
use dusk_core::transfer::withdraw::WithdrawReceiver;
use dusk_core::transfer::{
ConvertEvent, DepositEvent, MoonlightTransactionEvent, WithdrawEvent,
CONVERT_TOPIC, DEPOSIT_TOPIC, MINT_TOPIC, MOONLIGHT_TOPIC,
TRANSFER_CONTRACT, WITHDRAW_TOPIC,
Expand Down
2 changes: 1 addition & 1 deletion rusk/src/lib/http/chain/graphql/archive/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//! Module for GraphQL that relates to stored events in the archive.
use async_graphql::{Context, FieldError, FieldResult, Object};
use execution_core::CONTRACT_ID_BYTES;
use dusk_core::CONTRACT_ID_BYTES;
use node_data::events::contract::WrappedContractId;

use super::data::ContractEvents;
Expand Down
4 changes: 2 additions & 2 deletions rusk/src/lib/http/chain/graphql/archive/moonlight.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
//! Module for GraphQL that is used for moonlight related data in the archive.
use dusk_bytes::Serializable;
use execution_core::signatures::bls::PublicKey as AccountPublicKey;
use execution_core::transfer::{
use dusk_core::signatures::bls::PublicKey as AccountPublicKey;
use dusk_core::transfer::{
ConvertEvent, DepositEvent, MoonlightTransactionEvent, WithdrawEvent,
CONVERT_TOPIC, MINT_TOPIC, MOONLIGHT_TOPIC, TRANSFER_CONTRACT,
WITHDRAW_TOPIC,
Expand Down
4 changes: 2 additions & 2 deletions rusk/src/lib/http/chain/graphql/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,8 @@ impl Transaction<'_> {

pub async fn tx_type(&self) -> String {
match self.0.inner {
execution_core::transfer::Transaction::Phoenix(_) => "Phoenix",
execution_core::transfer::Transaction::Moonlight(_) => "Moonlight",
dusk_core::transfer::Transaction::Phoenix(_) => "Phoenix",
dusk_core::transfer::Transaction::Moonlight(_) => "Moonlight",
}
.into()
}
Expand Down
2 changes: 1 addition & 1 deletion rusk/src/lib/http/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use super::RUSK_VERSION_HEADER;

use base64::engine::{general_purpose::STANDARD as BASE64, Engine};
use bytecheck::CheckBytes;
use execution_core::ContractId;
use dusk_core::ContractId;
use futures_util::stream::Iter as StreamIter;
use futures_util::{stream, Stream, StreamExt};
use http_body_util::{BodyExt, Either, Full, StreamBody};
Expand Down
2 changes: 1 addition & 1 deletion rusk/src/lib/http/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use anyhow::anyhow;

use execution_core::transfer::phoenix::Prove;
use dusk_core::transfer::phoenix::Prove;
use rusk_prover::LocalProver;

use super::*;
Expand Down
2 changes: 1 addition & 1 deletion rusk/src/lib/http/rusk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use std::thread;
use tokio::task;
use tungstenite::http::request;

use execution_core::ContractId;
use dusk_core::ContractId;

use crate::node::Rusk;

Expand Down
2 changes: 1 addition & 1 deletion rusk/src/lib/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use std::path::PathBuf;
use std::sync::Arc;
use std::time::Duration;

use execution_core::{dusk, Dusk};
use dusk_core::{dusk, Dusk};

use node::database::rocksdb::{self, Backend};
use node::network::Kadcast;
Expand Down
6 changes: 3 additions & 3 deletions rusk/src/lib/node/rusk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ use std::sync::{mpsc, Arc, LazyLock};
use std::time::{Duration, Instant};
use std::{fs, io};

use execution_core::stake::StakeKeys;
use execution_core::transfer::PANIC_NONCE_NOT_READY;
use dusk_core::stake::StakeKeys;
use dusk_core::transfer::PANIC_NONCE_NOT_READY;
use parking_lot::RwLock;
use tracing::info;

Expand All @@ -21,7 +21,7 @@ use dusk_consensus::config::{
RATIFICATION_COMMITTEE_CREDITS, VALIDATION_COMMITTEE_CREDITS,
};
use dusk_consensus::operations::{CallParams, VerificationOutput, Voter};
use execution_core::{
use dusk_core::{
signatures::bls::PublicKey as BlsPublicKey,
stake::{Reward, RewardReason, StakeData, STAKE_CONTRACT},
transfer::{
Expand Down
2 changes: 1 addition & 1 deletion rusk/src/lib/node/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use dusk_bytes::DeserializableSlice;
use dusk_consensus::operations::{CallParams, VerificationOutput, Voter};
use dusk_consensus::user::provisioners::Provisioners;
use dusk_consensus::user::stake::Stake;
use execution_core::{
use dusk_core::{
signatures::bls::PublicKey as BlsPublicKey, stake::StakeData,
transfer::Transaction as ProtocolTransaction,
};
Expand Down
2 changes: 1 addition & 1 deletion rusk/src/lib/node/vm/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::Result;
use std::sync::mpsc;

use bytecheck::CheckBytes;
use execution_core::{ContractId, StandardBufSerializer};
use dusk_core::{ContractId, StandardBufSerializer};
use rkyv::validation::validators::DefaultValidator;
use rkyv::{Archive, Deserialize, Infallible, Serialize};

Expand Down
2 changes: 1 addition & 1 deletion rusk/src/lib/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use futures::Stream;
use tokio::spawn;
use tracing::{error, info};

use execution_core::{
use dusk_core::{
signatures::bls::PublicKey as BlsPublicKey,
stake::{StakeData, STAKE_CONTRACT},
transfer::{
Expand Down
2 changes: 1 addition & 1 deletion rusk/src/lib/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use crate::error::Error;
use crate::Result;

use execution_core::transfer::{
use dusk_core::transfer::{
moonlight::Transaction as MoonlightTransaction,
phoenix::Transaction as PhoenixTransaction,
};
Expand Down
2 changes: 1 addition & 1 deletion rusk/tests/common/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use dusk_consensus::{
config::{RATIFICATION_COMMITTEE_CREDITS, VALIDATION_COMMITTEE_CREDITS},
operations::CallParams,
};
use execution_core::{
use dusk_core::{
signatures::bls::PublicKey as BlsPublicKey, transfer::Transaction,
};
use node_data::{
Expand Down
2 changes: 1 addition & 1 deletion rusk/tests/common/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::sync::{Arc, RwLock};
use crate::common::block::Block as BlockAwait;

use dusk_bytes::Serializable;
use execution_core::{
use dusk_core::{
signatures::bls::PublicKey as BlsPublicKey,
stake::StakeData,
transfer::{
Expand Down
2 changes: 1 addition & 1 deletion rusk/tests/rusk-state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::common::*;
use std::path::Path;
use std::sync::{mpsc, Arc};

use execution_core::{
use dusk_core::{
transfer::{
phoenix::{
Note, NoteLeaf, PublicKey as PhoenixPublicKey,
Expand Down
2 changes: 1 addition & 1 deletion rusk/tests/services/contract_deployment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::collections::HashMap;
use std::path::{Path, PathBuf};
use std::sync::{Arc, RwLock};

use execution_core::{
use dusk_core::{
transfer::data::{ContractBytecode, ContractDeploy, TransactionData},
ContractId,
};
Expand Down
10 changes: 5 additions & 5 deletions rusk/tests/services/contract_stake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
use std::path::Path;
use std::sync::{Arc, RwLock};

use execution_core::stake::{self, Stake, EPOCH, MINIMUM_STAKE};
use dusk_core::stake::{self, Stake, EPOCH, MINIMUM_STAKE};

use dusk_bytes::Serializable;
use execution_core::transfer::data::ContractCall;
use execution_core::transfer::{self, Transaction};
use execution_core::ContractId;
use dusk_core::transfer::data::ContractCall;
use dusk_core::transfer::{self, Transaction};
use dusk_core::ContractId;
use node_data::ledger::SpentTransaction;
use rand::prelude::*;
use rand::rngs::StdRng;
Expand Down Expand Up @@ -266,7 +266,7 @@ fn execute_transaction<'a, E: Into<Option<&'a str>>>(
rusk: &Rusk,
block_height: u64,
expected_error: E,
generator: Option<execution_core::signatures::bls::PublicKey>,
generator: Option<dusk_core::signatures::bls::PublicKey>,
) -> SpentTransaction {
let (executed_txs, _) = generator_procedure2(
&rusk,
Expand Down
4 changes: 2 additions & 2 deletions rusk/tests/services/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub async fn deploy_fail() -> Result<()> {
let raw = t.get("tx").unwrap().get("raw").unwrap().as_str().unwrap();
let raw = hex::decode(raw).unwrap();
let tx =
execution_core::transfer::Transaction::from_slice(&raw).unwrap();
dusk_core::transfer::Transaction::from_slice(&raw).unwrap();
let txs = txs_by_height.entry(block_height).or_insert(vec![]);
txs.push(tx);
}
Expand Down Expand Up @@ -105,7 +105,7 @@ pub async fn deploy_fail() -> Result<()> {
let raw = t.get("raw").unwrap().as_str().unwrap();
let raw = hex::decode(raw).unwrap();
let tx =
execution_core::transfer::Transaction::from_slice(&raw).unwrap();
dusk_core::transfer::Transaction::from_slice(&raw).unwrap();
mempool.push(tx);
}

Expand Down
2 changes: 1 addition & 1 deletion rusk/tests/services/gas_behavior.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::collections::HashMap;
use std::path::Path;
use std::sync::{Arc, RwLock};

use execution_core::transfer::{
use dusk_core::transfer::{
data::{ContractCall, TransactionData},
TRANSFER_CONTRACT,
};
Expand Down
2 changes: 1 addition & 1 deletion rusk/tests/services/moonlight_stake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use std::path::Path;
use std::sync::{Arc, RwLock};

use execution_core::stake::MINIMUM_STAKE;
use dusk_core::stake::MINIMUM_STAKE;

use rand::prelude::*;
use rand::rngs::StdRng;
Expand Down
2 changes: 1 addition & 1 deletion rusk/tests/services/owner_calls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use std::collections::HashMap;
use std::path::{Path, PathBuf};
use std::sync::{Arc, RwLock};

use execution_core::{
use dusk_core::{
signatures::bls::{
PublicKey as BlsPublicKey, SecretKey as BlsSecretKey,
Signature as BlsSignature,
Expand Down
4 changes: 2 additions & 2 deletions rusk/tests/services/phoenix_stake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
use std::path::Path;
use std::sync::{Arc, RwLock};

use execution_core::stake::MINIMUM_STAKE;
use execution_core::{
use dusk_core::stake::MINIMUM_STAKE;
use dusk_core::{
dusk,
signatures::bls::PublicKey as BlsPublicKey,
stake::{StakeAmount, STAKE_CONTRACT},
Expand Down
2 changes: 1 addition & 1 deletion rusk/tests/services/unspendable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::collections::HashMap;
use std::path::Path;
use std::sync::{Arc, RwLock};

use execution_core::transfer::{
use dusk_core::transfer::{
data::{ContractCall, TransactionData},
TRANSFER_CONTRACT,
};
Expand Down

0 comments on commit 2357fd6

Please sign in to comment.