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

community metadata extension migration #341

Merged
merged 9 commits into from
Jul 30, 2023
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
128 changes: 64 additions & 64 deletions Cargo.lock

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,24 @@ members = [

#only while debugging
#[patch."https://github.com/encointer/pallets"]
# encointer-balances-tx-payment = { path = "../encointer-pallets/balances-tx-payment" }
# encointer-balances-tx-payment-rpc = { path = "../encointer-pallets/balances-tx-payment/rpc" }
# encointer-balances-tx-payment-rpc-runtime-api = { path = "../encointer-pallets/balances-tx-payment/rpc/runtime-api" }
# encointer-ceremonies-assignment = { path = "../encointer-pallets/ceremonies/assignment" }
# encointer-primitives = { path = "../encointer-pallets/primitives" }
# pallet-encointer-balances = { path = "../encointer-pallets/balances" }
# pallet-encointer-bazaar = { path = "../encointer-pallets/bazaar" }
# pallet-encointer-bazaar-rpc = { path = "../encointer-pallets/bazaar/rpc" }
# pallet-encointer-bazaar-rpc-runtime-api = { path = "../encointer-pallets/bazaar/rpc/runtime-api" }
# pallet-encointer-ceremonies = { path = "../encointer-pallets/ceremonies" }
# pallet-encointer-ceremonies-rpc = { path = "../encointer-pallets/ceremonies/rpc" }
# pallet-encointer-ceremonies-rpc-runtime-api = { path = "../encointer-pallets/ceremonies/rpc/runtime-api" }
# pallet-encointer-communities = { path = "../encointer-pallets/communities" }
# pallet-encointer-communities-rpc = { path = "../encointer-pallets/communities/rpc" }
# pallet-encointer-communities-rpc-runtime-api = { path = "../encointer-pallets/communities/rpc/runtime-api" }
# pallet-encointer-faucet = { path = "../encointer-pallets/faucet" }
# pallet-encointer-reputation-commitments = { path = "../encointer-pallets/reputation-commitments" }
# pallet-encointer-scheduler = { path = "../encointer-pallets/scheduler" }
#encointer-balances-tx-payment = { path = "../pallets/balances-tx-payment" }
#encointer-balances-tx-payment-rpc = { path = "../pallets/balances-tx-payment/rpc" }
#encointer-balances-tx-payment-rpc-runtime-api = { path = "../pallets/balances-tx-payment/rpc/runtime-api" }
#encointer-ceremonies-assignment = { path = "../pallets/ceremonies/assignment" }
#encointer-primitives = { path = "../pallets/primitives" }
#pallet-encointer-balances = { path = "../pallets/balances" }
#pallet-encointer-bazaar = { path = "../pallets/bazaar" }
#pallet-encointer-bazaar-rpc = { path = "../pallets/bazaar/rpc" }
#pallet-encointer-bazaar-rpc-runtime-api = { path = "../pallets/bazaar/rpc/runtime-api" }
#pallet-encointer-ceremonies = { path = "../pallets/ceremonies" }
#pallet-encointer-ceremonies-rpc = { path = "../pallets/ceremonies/rpc" }
#pallet-encointer-ceremonies-rpc-runtime-api = { path = "../pallets/ceremonies/rpc/runtime-api" }
#pallet-encointer-communities = { path = "../pallets/communities" }
#pallet-encointer-communities-rpc = { path = "../pallets/communities/rpc" }
#pallet-encointer-communities-rpc-runtime-api = { path = "../pallets/communities/rpc/runtime-api" }
#pallet-encointer-faucet = { path = "../pallets/faucet" }
#pallet-encointer-reputation-commitments = { path = "../pallets/reputation-commitments" }
#pallet-encointer-scheduler = { path = "../pallets/scheduler" }

# [patch."https://github.com/scs/substrate-api-client"]
# substrate-api-client = { path = "../substrate-api-client" }
Expand Down
14 changes: 7 additions & 7 deletions client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "encointer-client-notee"
authors = ["encointer.org <alain@encointer.org>"]
edition = "2021"
#keep with node version. major, minor and patch
version = "1.4.2"
version = "1.5.0"

[dependencies]
clap = "2.33"
Expand All @@ -21,12 +21,12 @@ encointer-api-client-extension = { path = "./encointer-api-client-extension" }
encointer-node-notee-runtime = { path = "../runtime" }

# encointer deps
encointer-ceremonies-assignment = { git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42" }
encointer-primitives = { git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42" }
pallet-encointer-balances = { git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42" }
pallet-encointer-ceremonies = { git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42" }
pallet-encointer-communities = { git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42" }
pallet-encointer-scheduler = { git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42" }
encointer-ceremonies-assignment = { git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42-pallets-v1.3.0" }
encointer-primitives = { git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42-pallets-v1.3.0" }
pallet-encointer-balances = { git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42-pallets-v1.3.0" }
pallet-encointer-ceremonies = { git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42-pallets-v1.3.0" }
pallet-encointer-communities = { git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42-pallets-v1.3.0" }
pallet-encointer-scheduler = { git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42-pallets-v1.3.0" }

# scs deps
substrate-api-client = { git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.42" }
Expand Down
4 changes: 2 additions & 2 deletions client/encointer-api-client-extension/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ serde = { features = ["derive"], version = "1.0.132" }
serde_json = { version = "1.0.79" }

# encointer deps
encointer-ceremonies-assignment = { git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42" }
encointer-ceremonies-assignment = { git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42-pallets-v1.3.0" }
encointer-node-notee-runtime = { path = "../../runtime" }
encointer-primitives = { git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42" }
encointer-primitives = { git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42-pallets-v1.3.0" }

substrate-api-client = { git = "https://github.com/scs/substrate-api-client.git", branch = "polkadot-v0.9.42", features = ["ws-client"] }
# scs deps
Expand Down
4 changes: 3 additions & 1 deletion client/src/community_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use encointer_node_notee_runtime::AccountId;
use encointer_primitives::{
balances::{BalanceType, Demurrage},
common::{BoundedIpfsCid, FromStr, PalletString},
communities::{CommunityIdentifier, CommunityMetadata, Degree, Location},
communities::{CommunityIdentifier, CommunityMetadata, CommunityRules, Degree, Location},
fixed::transcendental::ln,
};
use geojson::GeoJson;
Expand Down Expand Up @@ -94,6 +94,8 @@ impl CommunitySpec for serde_json::Value {
Ok(url) => Some(BoundedIpfsCid::from_str(&url).unwrap()),
Err(_) => None,
},
announcement_signer: None,
rules: CommunityRules::default(),
}
}

Expand Down
2 changes: 1 addition & 1 deletion client/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ async fn main() {
println!("number of communities: {}", names.len());
for n in names.iter() {
let loc = api.get_locations(n.cid).unwrap();
println!("{}: {} locations: {}", n.cid, n.name, loc.len());
println!("{}: {} locations: {}", n.cid, String::from_utf8(n.name.to_vec()).unwrap(), loc.len());
}
Ok(())
}),
Expand Down
18 changes: 9 additions & 9 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repository = "https://github.com/encointer/encointer-node"
# * Align minor version with the runtime.
# * Bump patch version for new releases, and make it the release tag.
# * The client should follow this version.
version = "1.4.2"
version = "1.5.0"

[[bin]]
name = "encointer-node-notee"
Expand Down Expand Up @@ -70,14 +70,14 @@ frame-benchmarking-cli = { version = "4.0.0-dev", git = "https://github.com/pari
# encointer dependencies
encointer-node-notee-runtime = { path = "../runtime" }

encointer-balances-tx-payment-rpc = { git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42" }
encointer-balances-tx-payment-rpc-runtime-api = { git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42" }
pallet-encointer-bazaar-rpc = { git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42" }
pallet-encointer-bazaar-rpc-runtime-api = { git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42" }
pallet-encointer-ceremonies-rpc = { git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42" }
pallet-encointer-ceremonies-rpc-runtime-api = { git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42" }
pallet-encointer-communities-rpc = { git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42" }
pallet-encointer-communities-rpc-runtime-api = { git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42" }
encointer-balances-tx-payment-rpc = { git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42-pallets-v1.3.0" }
encointer-balances-tx-payment-rpc-runtime-api = { git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42-pallets-v1.3.0" }
pallet-encointer-bazaar-rpc = { git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42-pallets-v1.3.0" }
pallet-encointer-bazaar-rpc-runtime-api = { git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42-pallets-v1.3.0" }
pallet-encointer-ceremonies-rpc = { git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42-pallets-v1.3.0" }
pallet-encointer-ceremonies-rpc-runtime-api = { git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42-pallets-v1.3.0" }
pallet-encointer-communities-rpc = { git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42-pallets-v1.3.0" }
pallet-encointer-communities-rpc-runtime-api = { git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42-pallets-v1.3.0" }

# CLI-specific dependencies
frame-try-runtime = { optional = true, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" }
Expand Down
28 changes: 14 additions & 14 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "encointer-node-notee-runtime"
repository = "https://github.com/encointer/encointer-node/"
# minor revision must match node/client
# patch revision must match runtime spec_version
version = "1.4.25"
version = "1.5.26"

[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
Expand All @@ -16,19 +16,19 @@ scale-info = { version = "2.1.1", default-features = false, features = ["derive"
serde = { features = ["derive"], optional = true, version = "1.0.136" }

# encointer deps
encointer-balances-tx-payment = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42" }
encointer-balances-tx-payment-rpc-runtime-api = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42" }
encointer-primitives = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42" }
pallet-encointer-balances = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42" }
pallet-encointer-bazaar = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42" }
pallet-encointer-bazaar-rpc-runtime-api = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42" }
pallet-encointer-ceremonies = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42" }
pallet-encointer-ceremonies-rpc-runtime-api = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42" }
pallet-encointer-communities = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42" }
pallet-encointer-communities-rpc-runtime-api = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42" }
pallet-encointer-faucet = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42" }
pallet-encointer-reputation-commitments = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42" }
pallet-encointer-scheduler = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42" }
encointer-balances-tx-payment = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42-pallets-v1.3.0" }
encointer-balances-tx-payment-rpc-runtime-api = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42-pallets-v1.3.0" }
encointer-primitives = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42-pallets-v1.3.0" }
pallet-encointer-balances = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42-pallets-v1.3.0" }
pallet-encointer-bazaar = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42-pallets-v1.3.0" }
pallet-encointer-bazaar-rpc-runtime-api = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42-pallets-v1.3.0" }
pallet-encointer-ceremonies = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42-pallets-v1.3.0" }
pallet-encointer-ceremonies-rpc-runtime-api = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42-pallets-v1.3.0" }
pallet-encointer-communities = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42-pallets-v1.3.0" }
pallet-encointer-communities-rpc-runtime-api = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42-pallets-v1.3.0" }
pallet-encointer-faucet = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42-pallets-v1.3.0" }
pallet-encointer-reputation-commitments = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42-pallets-v1.3.0" }
pallet-encointer-scheduler = { default-features = false, git = "https://github.com/encointer/pallets", branch = "polkadot-v0.9.42-pallets-v1.3.0" }

# substrate deps
frame-executive = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.42" }
Expand Down
10 changes: 6 additions & 4 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("encointer-node-notee"),
impl_name: create_runtime_str!("encointer-node-notee"),
authoring_version: 0,
spec_version: 25,
spec_version: 26,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 4,
transaction_version: 5,
state_version: 0,
};

Expand Down Expand Up @@ -590,8 +590,10 @@ pub type Executive = frame_executive::Executive<
Runtime,
AllPalletsWithSystem,
(
pallet_encointer_communities::migrations::v1::Migration<Runtime>,
pallet_encointer_ceremonies::migrations::v1::Migration<Runtime>,
// can migrate from v0 or v1 to v2
pallet_encointer_communities::migrations::v2::MigrateV0orV1toV2<Runtime>,
// expected to be noop. but need to try-runtime checks first!
pallet_encointer_ceremonies::migrations::v1::MigrateToV1<Runtime>,
),
>;

Expand Down
Loading