Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor state crate #2606

Merged
merged 30 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
1f06661
refactor finalize_block token updates
tzemanovic Jan 30, 2024
b57211c
refactor finalize_block governance updates
tzemanovic Jan 30, 2024
000ae70
refactor finalize_block PoS updates
tzemanovic Jan 31, 2024
fdafaa6
changelog: add #2482
tzemanovic Jan 31, 2024
4476583
replace namada_state usage with namada_storage in token crates
tzemanovic Jan 31, 2024
99808f1
move inflation from core to trans_token
tzemanovic Jan 31, 2024
0c4756b
move shielded params from core into shielded_token
tzemanovic Jan 31, 2024
5e30366
benches: fix the shell to update conversions on new epochs
tzemanovic Feb 1, 2024
00cddd4
changelog: add #2493
tzemanovic Feb 1, 2024
5cf8d07
core: refactor out ledger::eth_bridge mod
tzemanovic Feb 1, 2024
2900e3d
core: factor out the ledger::replay_protection mod into a new crate
tzemanovic Feb 1, 2024
45cb6b9
update replay_protection usage
tzemanovic Feb 1, 2024
c9d2ba9
core: flatten types mod
tzemanovic Feb 1, 2024
d7aedea
update all core types usages
tzemanovic Feb 1, 2024
94d1a0b
changelog: add #2503
tzemanovic Feb 2, 2024
8424f96
gov: replace namada_state dep with namada_storage
tzemanovic Feb 2, 2024
224798f
changelog: add #2506
tzemanovic Feb 2, 2024
8fdd83a
core: prevent from using addresses for testing in non-test code
tzemanovic Feb 2, 2024
d44bf1e
changelog: add #2507
tzemanovic Feb 2, 2024
79d6a2b
state: refactor everything
tzemanovic Feb 20, 2024
c4ba70d
ibc: update for new state API
tzemanovic Feb 20, 2024
2604763
eth_bridge: update for new state API
tzemanovic Feb 20, 2024
24fc0c9
sdk: update for new state API
tzemanovic Feb 20, 2024
533164b
namada: update for new state API, refactor tx and VP host envs
tzemanovic Feb 20, 2024
115049b
apps: update for new state API
tzemanovic Feb 20, 2024
c52e6ea
test/PoS: update for new state API
tzemanovic Feb 20, 2024
e508573
tests: update for new state API
tzemanovic Feb 20, 2024
da16c52
test/wasm: update for new state API
tzemanovic Feb 20, 2024
b9f4d56
benches: update for new state API
tzemanovic Feb 20, 2024
daffb53
changelog: add #2606
tzemanovic Feb 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Refactored sub-systems integration in the ABCI FinalizeBlock request handler.
([\#2482](https://github.com/anoma/namada/pull/2482))
1 change: 1 addition & 0 deletions .changelog/unreleased/improvements/2493-refactor-token.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Refactored token crates. ([\#2493](https://github.com/anoma/namada/pull/2493))
2 changes: 2 additions & 0 deletions .changelog/unreleased/improvements/2503-refactor-core.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Refactored core crate to flatten the modules structure.
([\#2503](https://github.com/anoma/namada/pull/2503))
2 changes: 2 additions & 0 deletions .changelog/unreleased/improvements/2506-refactor-gov.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Refactored governance crate dependencies.
([\#2506](https://github.com/anoma/namada/pull/2506))
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Hid addresses used for testing from public API.
([\#2507](https://github.com/anoma/namada/pull/2507))
2 changes: 2 additions & 0 deletions .changelog/unreleased/improvements/2606-refactor-state.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Refactored the state crate.
([\#2606](https://github.com/anoma/namada/pull/2606))
20 changes: 15 additions & 5 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ members = [
"crates/merkle_tree",
"crates/parameters",
"crates/proof_of_stake",
"crates/replay_protection",
"crates/sdk",
"crates/namada",
"crates/shielded_token",
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ crates += namada_macros
crates += namada_merkle_tree
crates += namada_parameters
crates += namada_proof_of_stake
crates += namada_replay_protection
crates += namada_sdk
crates += namada_shielded_token
crates += namada_state
Expand Down
6 changes: 3 additions & 3 deletions crates/account/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ mod storage_key;
mod types;

use borsh::{BorshDeserialize, BorshSerialize};
pub use namada_core::types::account::AccountPublicKeysMap;
use namada_core::types::address::Address;
use namada_core::types::key::common;
pub use namada_core::account::AccountPublicKeysMap;
use namada_core::address::Address;
use namada_core::key::common;
use serde::{Deserialize, Serialize};
pub use storage::*;
pub use storage_key::*;
Expand Down
6 changes: 3 additions & 3 deletions crates/account/src/storage.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//! Cryptographic signature keys storage API

use namada_core::types::address::Address;
use namada_core::types::key::common;
use namada_core::types::storage;
use namada_core::address::Address;
use namada_core::key::common;
use namada_core::storage;
use namada_storage::{Result, StorageRead, StorageWrite};

use super::*;
Expand Down
6 changes: 3 additions & 3 deletions crates/account/src/storage_key.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use namada_core::types::address::Address;
use namada_core::types::key::common;
use namada_core::types::storage::{self, DbKeySeg};
use namada_core::address::Address;
use namada_core::key::common;
use namada_core::storage::{self, DbKeySeg};
use namada_macros::StorageKeys;
use namada_storage::collections::lazy_map::LazyMap;
use namada_storage::collections::{lazy_map, LazyCollection};
Expand Down
12 changes: 6 additions & 6 deletions crates/account/src/types.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use namada_core::address::Address;
use namada_core::borsh::{BorshDeserialize, BorshSchema, BorshSerialize};
use namada_core::types::address::Address;
use namada_core::types::hash::Hash;
use namada_core::types::key::common;
use namada_core::hash::Hash;
use namada_core::key::common;
use serde::{Deserialize, Serialize};

/// A tx data type to initialize a new established account
Expand Down Expand Up @@ -53,9 +53,9 @@ pub struct UpdateAccount {
#[cfg(any(test, feature = "testing"))]
/// Tests and strategies for accounts
pub mod tests {
use namada_core::types::address::testing::arb_non_internal_address;
use namada_core::types::hash::testing::arb_hash;
use namada_core::types::key::testing::arb_common_pk;
use namada_core::address::testing::arb_non_internal_address;
use namada_core::hash::testing::arb_hash;
use namada_core::key::testing::arb_common_pk;
use proptest::prelude::Just;
use proptest::{collection, option, prop_compose};

Expand Down
2 changes: 1 addition & 1 deletion crates/apps/src/bin/namada-node/cli.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Namada node CLI.

use eyre::{Context, Result};
use namada::types::time::{DateTimeUtc, Utc};
use namada::core::time::{DateTimeUtc, Utc};
use namada_apps::cli::{self, cmds};
use namada_apps::config::ValidatorLocalConfig;
use namada_apps::node::ledger;
Expand Down
Loading
Loading