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

update symbol #432

Merged
merged 4 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
132 changes: 66 additions & 66 deletions Cargo.lock

Large diffs are not rendered by default.

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

[workspace.dependencies]
# Avail core
avail-core = { git = "https://github.com/availproject/avail-core", branch = "main", default-features = false, features = [
avail-core = { git = "https://github.com/availproject/avail-core", branch = "ghali/rename-symbol", default-features = false, features = [
"runtime",
] }
kate = { git = "https://github.com/availproject/avail-core", branch = "main", default-features = false }
kate-recovery = { git = "https://github.com/availproject/avail-core", branch = "main", default-features = false }
kate = { git = "https://github.com/availproject/avail-core", branch = "ghali/rename-symbol", default-features = false }
kate-recovery = { git = "https://github.com/availproject/avail-core", branch = "ghali/rename-symbol", default-features = false }

# Substrate
sp-std = { git = "https://github.com/availproject/polkadot-sdk.git", tag = "polkadot-v1.6.0-patch", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion avail-js/examples/next-example/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function Home() {
chain: api.runtimeChain.toString(),
specVersion: api.runtimeVersion.specVersion.toNumber(),
tokenDecimals: api.registry.chainDecimals[0] || 18,
tokenSymbol: api.registry.chainTokens[0] || "AVL",
tokenSymbol: api.registry.chainTokens[0] || "AVAIL",
genesisHash: api.genesisHash.toHex(),
ss58Format: isNumber(api.registry.chainSS58) ? api.registry.chainSS58 : 0,
chainType: "substrate" as "substrate",
Expand Down
2 changes: 1 addition & 1 deletion avail-subxt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ curve25519-dalek = "2.1.3"
schnorrkel = "0.9.1"
serde = { version = "1.0.195", features = ["derive"] }
serde-hex = "0.1"
avail-core = { git = "https://github.com/availproject/avail-core", branch = "main", features = ["serde"]}
avail-core = { git = "https://github.com/availproject/avail-core", branch = "ghali/rename-symbol", features = ["serde"]}

# Substrate
subxt = { version = "0.29" }
Expand Down
2 changes: 1 addition & 1 deletion avail-subxt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub mod avail {
pub type Bounded =
api::runtime_types::frame_support::traits::preimages::Bounded<RuntimeCall, BlakeTwo256>;

pub const AVL: u128 = 1_000_000_000_000_000_000;
pub const AVAIL: u128 = 1_000_000_000_000_000_000;

pub type MaxCells = ConstU32<64>;
pub type Cells = bounded_collections::BoundedVec<Cell, MaxCells>;
Expand Down
6 changes: 3 additions & 3 deletions e2e/Cargo.lock

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

6 changes: 3 additions & 3 deletions e2e/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ sp-keyring = { git = "https://github.com/availproject/polkadot-sdk.git", tag = "
subxt = "0.29"
anyhow = "1.0.66"
codec = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive", "full", "bit-vec"] }
kate-recovery = { git = "https://github.com/availproject/avail-core", branch = "main" }
kate = { git = "https://github.com/availproject/avail-core", branch = "main" }
avail-core = { git = "https://github.com/availproject/avail-core", branch = "main" }
kate-recovery = { git = "https://github.com/availproject/avail-core", branch = "ghali/rename-symbol" }
kate = { git = "https://github.com/availproject/avail-core", branch = "ghali/rename-symbol" }
avail-core = { git = "https://github.com/availproject/avail-core", branch = "ghali/rename-symbol" }
binary-merkle-tree = { git = "https://github.com/availproject/polkadot-sdk.git", tag = "polkadot-v1.6.0-patch" }
serde = { version = "1.0.163", default-features = false, features = ["derive", "alloc"] }

Expand Down
2 changes: 1 addition & 1 deletion misc/genesis/devnet.chain.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"protocolId": "Avail",
"properties": {
"tokenDecimals": 18,
"tokenSymbol": "AVL"
"tokenSymbol": "AVAIL"
},
"forkBlocks": null,
"badBlocks": null,
Expand Down
2 changes: 1 addition & 1 deletion misc/genesis/devnet.chain.raw.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"protocolId": "Avail",
"properties": {
"tokenDecimals": 18,
"tokenSymbol": "AVL"
"tokenSymbol": "AVAIL"
},
"forkBlocks": null,
"badBlocks": null,
Expand Down
4 changes: 2 additions & 2 deletions node/src/chains/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use avail_core::{BLOCK_CHUNK_SIZE, NORMAL_DISPATCH_RATIO};
use kate::config::{MAX_BLOCK_COLUMNS, MAX_BLOCK_ROWS};

use da_runtime::{
constants, AccountId, Balance, DataAvailabilityConfig, SessionKeys, StakerStatus, AVL,
constants, AccountId, Balance, DataAvailabilityConfig, SessionKeys, StakerStatus, AVAIL,
};
use frame_system::limits::BlockLength;
use pallet_vector::constants::{
Expand All @@ -19,7 +19,7 @@ use sp_core::sr25519::Public;
pub const PROTOCOL_ID: &str = "Avail";
pub const TELEMETRY_URL: &str = "ws://telemetry.avail.tools:8001/submit";

const ENDOWMENT: Balance = 1_000_000 * AVL;
const ENDOWMENT: Balance = 1_000_000 * AVAIL;
const STASH_BOND: Balance = ENDOWMENT / 100;
const DEFAULT_ENDOWED_SEEDS: [&str; 12] = [
"Alice",
Expand Down
2 changes: 1 addition & 1 deletion node/src/chains/definitions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub fn get_from_seed<TPublic: Public>(seed: &str) -> <TPublic::Pair as Pair>::Pu

/// Common properties for chains
pub fn chain_properties() -> Properties {
serde_json::json!({ "tokenDecimals": 18, "tokenSymbol": "AVL" })
serde_json::json!({ "tokenDecimals": 18, "tokenSymbol": "AVAIL" })
.as_object()
.expect("Map given; qed")
.clone()
Expand Down
4 changes: 2 additions & 2 deletions pallets/dactr/src/mock.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![cfg(test)]

use avail_core::currency::{Balance, AVL};
use avail_core::currency::{Balance, AVAIL};
use frame_support::{
derive_impl, parameter_types,
weights::{ConstantMultiplier, IdentityFee},
Expand Down Expand Up @@ -125,7 +125,7 @@ pub fn new_test_ext() -> sp_io::TestExternalities {
.unwrap();

pallet_balances::GenesisConfig::<Test> {
balances: vec![(1, 10_000 * AVL), (2, 5_000 * AVL), (3, 1_000 * AVL)],
balances: vec![(1, 10_000 * AVAIL), (2, 5_000 * AVAIL), (3, 1_000 * AVAIL)],
}
.assimilate_storage(&mut storage)
.unwrap();
Expand Down
4 changes: 2 additions & 2 deletions runtime/fuzz/header/kate_commit_size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use avail_core::{header::HeaderExtension, InvalidTransactionCustomId as TxAvailE
use da_control::{pallet::Call as DaControlCall, AppDataFor, CheckAppId};
use da_runtime::{
AppId, Executive, Header, Runtime, RuntimeCall, RuntimeGenesisConfig, SignedExtra,
SignedPayload, Timestamp, UncheckedExtrinsic, AVL,
SignedPayload, Timestamp, UncheckedExtrinsic, AVAIL,
};

use codec::Encode;
Expand Down Expand Up @@ -49,7 +49,7 @@ fn runtime_ext(total_app_ids: NonZeroUsize) -> TestExternalities {

// Alice has all the money
pallet_balances::GenesisConfig::<Runtime> {
balances: vec![(alice.clone(), 100_000_000 * AVL)],
balances: vec![(alice.clone(), 100_000_000 * AVAIL)],
}
.assimilate_storage(&mut t)
.unwrap();
Expand Down
24 changes: 12 additions & 12 deletions runtime/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//! A set of constant values used in substrate runtime.

#![allow(clippy::identity_op)]
use avail_core::currency::{Balance, AVL};
use avail_core::currency::{Balance, AVAIL};
use frame_election_provider_support::bounds::{ElectionBounds, ElectionBoundsBuilder};
use frame_support::{
dispatch::DispatchClass,
Expand Down Expand Up @@ -163,15 +163,15 @@ pub mod indices {
use super::*;

parameter_types! {
pub const IndexDeposit :Balance = 1 * AVL;
pub const IndexDeposit :Balance = 1 * AVAIL;
}
}

pub mod balances {
use super::{currency::*, *};

parameter_types! {
pub const ExistentialDeposit :Balance = 10 * CENTS; // 0.1 AVLs
pub const ExistentialDeposit :Balance = 10 * CENTS; // 0.1 AVAILs
}
}

Expand Down Expand Up @@ -201,8 +201,8 @@ pub mod council {
pub mod nomination_pools {
use super::*;

pub const MIN_CREATE_BOND: Balance = 10 * AVL;
pub const MIN_JOIN_BOND: Balance = 1 * AVL;
pub const MIN_CREATE_BOND: Balance = 10 * AVAIL;
pub const MIN_JOIN_BOND: Balance = 1 * AVAIL;
pub const MAX_POOLS: u32 = 16;
pub const MAX_MEMBERS_PER_POOL: u32 = 100;
pub const MAX_MEMBERS: u32 = MAX_POOLS * MAX_MEMBERS_PER_POOL;
Expand Down Expand Up @@ -259,9 +259,9 @@ pub mod staking {
pub const SignedPhase: u32 = EPOCH_DURATION_IN_SLOTS / 4;
pub const UnsignedPhase: u32 = EPOCH_DURATION_IN_SLOTS / 4;

pub const SignedRewardBase: Balance = AVL;
pub const SignedRewardBase: Balance = AVAIL;
pub const SignedDepositByte: Balance = CENTS;
pub const SignedFixedDeposit: Balance = AVL;
pub const SignedFixedDeposit: Balance = AVAIL;
pub const SignedDepositIncreaseFactor: Percent = Percent::from_percent(10);

pub SolutionImprovementThreshold: Perbill = Perbill::from_rational(1u32, 10_000);
Expand Down Expand Up @@ -342,7 +342,7 @@ pub mod preimage {
use super::{currency::*, *};

parameter_types! {
pub const PreimageBaseDeposit: Balance = 1 * AVL;
pub const PreimageBaseDeposit: Balance = 1 * AVAIL;
// One cent: $10,000 / MB
pub const PreimageByteDeposit: Balance = 1 * CENTS;
pub const PreimageHoldReason: RuntimeHoldReason = RuntimeHoldReason::Preimage(pallet_preimage::HoldReason::Preimage);
Expand All @@ -365,11 +365,11 @@ pub mod bounty {
}

parameter_types! {
pub const ValueMinimum: Balance = 5 * AVL;
pub const DepositBase: Balance = AVL;
pub const ValueMinimum: Balance = 5 * AVAIL;
pub const DepositBase: Balance = AVAIL;
pub const CuratorDepositMultiplier: Permill = Permill::from_percent(50);
pub const CuratorDepositMin: Balance = 1 * AVL;
pub const CuratorDepositMax: Balance = 100 * AVL;
pub const CuratorDepositMin: Balance = 1 * AVAIL;
pub const CuratorDepositMax: Balance = 100 * AVAIL;
}
}

Expand Down
28 changes: 14 additions & 14 deletions runtime/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::{
System, TechnicalCommittee, Timestamp, TransactionPayment, Treasury, TxPause,
UncheckedExtrinsic, VoterList, MINUTES, VERSION,
};
use avail_core::currency::{Balance, AVL, CENTS, NANO_AVL, PICO_AVL};
use avail_core::currency::{Balance, AVAIL, CENTS, NANO_AVAIL, PICO_AVAIL};
use avail_core::AppId;
use avail_core::OpaqueExtrinsic;
use avail_core::NORMAL_DISPATCH_RATIO;
Expand Down Expand Up @@ -116,9 +116,9 @@ impl pallet_vector::Config for Runtime {
}

parameter_types! {
pub const BasicDeposit: Balance = 10 * AVL;
pub const BasicDeposit: Balance = 10 * AVAIL;
pub const ByteDeposit: Balance = constants::currency::deposit(0,1);
pub const SubAccountDeposit: Balance = 2 * AVL;
pub const SubAccountDeposit: Balance = 2 * AVAIL;
pub const MaxSubAccounts: u32 = 100;
pub const MaxAdditionalFields: u32 = 100;
pub const MaxRegistrars: u32 = 20;
Expand Down Expand Up @@ -176,12 +176,12 @@ impl pallet_authority_discovery::Config for Runtime {

parameter_types! {
pub const ProposalBond: Permill = Permill::from_percent(5);
pub const ProposalBondMinimum: Balance = AVL;
pub const ProposalBondMinimum: Balance = AVAIL;
pub const SpendPeriod: BlockNumber = DAYS;
pub const Burn: Permill = Permill::from_percent(0); // Not burning any funds for now
pub const TipCountdown: BlockNumber = DAYS;
pub const TipFindersFee: Percent = Percent::from_percent(20);
pub const TipReportDepositBase: Balance = AVL;
pub const TipReportDepositBase: Balance = AVAIL;
pub const DataDepositPerByte: Balance = CENTS;
pub const TreasuryPalletId: PalletId = PalletId(*b"py/trsry");
pub const MaximumReasonLength: u32 = 16384;
Expand Down Expand Up @@ -227,7 +227,7 @@ impl ContainsLengthBound for Tippers {

impl pallet_tips::Config for Runtime {
type DataDepositPerByte = DataDepositPerByte;
type MaxTipAmount = ConstU128<{ 500 * AVL }>;
type MaxTipAmount = ConstU128<{ 500 * AVAIL }>;
type MaximumReasonLength = MaximumReasonLength;
type RuntimeEvent = RuntimeEvent;
type TipCountdown = TipCountdown;
Expand All @@ -239,8 +239,8 @@ impl pallet_tips::Config for Runtime {

parameter_types! {
// Temporary increased price of all transactions by 10x
pub const WeightFee: Balance = PICO_AVL;
pub const TransactionByteFee: Balance = 100 * NANO_AVL; // 100 nanoAVL
pub const WeightFee: Balance = PICO_AVAIL;
pub const TransactionByteFee: Balance = 100 * NANO_AVAIL; // 100 nanoAVAIL
pub const OperationalFeeMultiplier: u8 = 5u8;
pub const TargetBlockFullness: Perquintill = Perquintill::from_percent(50); // target_utilization 50%
pub AdjustmentVariable: Multiplier = Multiplier::saturating_from_rational(1, 1_000_000); // 0.000001
Expand Down Expand Up @@ -269,7 +269,7 @@ impl pallet_transaction_payment::Config for Runtime {
type OnChargeTransaction = CurrencyAdapter<Balances, DealWithFees<Runtime>>;
type OperationalFeeMultiplier = OperationalFeeMultiplier;
type RuntimeEvent = RuntimeEvent;
type WeightToFee = ConstantMultiplier<Balance, WeightFee>; // 1 weight = 1 picoAVL -> second_price = 1 AVL
type WeightToFee = ConstantMultiplier<Balance, WeightFee>; // 1 weight = 1 picoAVAIL -> second_price = 1 AVAIL
}

parameter_types! {
Expand Down Expand Up @@ -354,7 +354,7 @@ impl pallet_utility::Config for Runtime {
}

parameter_types! {
pub const DepositBase: Balance = 2 * AVL;
pub const DepositBase: Balance = 2 * AVAIL;
// Additional storage item size of 32 bytes.
pub const DepositFactor: Balance = 5 * CENTS;
}
Expand Down Expand Up @@ -822,11 +822,11 @@ impl InstanceFilter<RuntimeCall> for ProxyType {

parameter_types! {
// One storage item; key size 32, value size 8; .
pub const ProxyDepositBase: Balance = 10 * AVL;
pub const ProxyDepositBase: Balance = 10 * AVAIL;
// Additional storage item size of 33 bytes.
pub const ProxyDepositFactor: Balance = 3 * AVL;
pub const AnnouncementDepositBase: Balance = 10 * AVL;
pub const AnnouncementDepositFactor: Balance = 5 * AVL;
pub const ProxyDepositFactor: Balance = 3 * AVAIL;
pub const AnnouncementDepositBase: Balance = 10 * AVAIL;
pub const AnnouncementDepositFactor: Balance = 5 * AVAIL;
}

impl pallet_proxy::Config for Runtime {
Expand Down
18 changes: 9 additions & 9 deletions runtime/src/impls_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
mod multiplier_tests {
use crate::impls::*;
use crate::*;
use avail_core::currency::{CENTS, MICRO_AVL, MILLICENTS};
use avail_core::currency::{CENTS, MICRO_AVAIL, MILLICENTS};
use frame_support::{
dispatch::{DispatchClass, DispatchInfo, Pays},
traits::OnFinalize,
Expand Down Expand Up @@ -303,11 +303,11 @@ mod multiplier_tests {
};
let tx_fee = TransactionPayment::compute_fee(tx_len as u32, &dispatch_info, 0);
println!(
"Iteration: {}, wm: {:?}, Fee: {} units / {} MICRO_AVL",
"Iteration: {}, wm: {:?}, Fee: {} units / {} MICRO_AVAIL",
0,
wm,
tx_fee,
tx_fee / MICRO_AVL,
tx_fee / MICRO_AVAIL,
);
run_with_system_weight(block_weight, || {
let mut iterations: u32 = 0;
Expand All @@ -322,11 +322,11 @@ mod multiplier_tests {
if iterations % EPOCH_DURATION_IN_SLOTS == 0 {
day_count += 1;
println!(
"Iteration: {}, wm: {:?}, Fee: {} units / {} MICRO_AVL",
"Iteration: {}, wm: {:?}, Fee: {} units / {} MICRO_AVAIL",
day_count,
wm,
tx_fee,
tx_fee / MICRO_AVL,
tx_fee / MICRO_AVAIL,
);
}
if day_count == 7u32 {
Expand Down Expand Up @@ -359,11 +359,11 @@ mod multiplier_tests {
};
let tx_fee = TransactionPayment::compute_fee(tx_len as u32, &dispatch_info, 0);
println!(
"Epoch: {}, lm: {:?}, Fee: {} units / {} MICRO_AVL",
"Epoch: {}, lm: {:?}, Fee: {} units / {} MICRO_AVAIL",
0,
lm,
tx_fee,
tx_fee / MICRO_AVL,
tx_fee / MICRO_AVAIL,
);
run_with_system_length(max_padded_length, || {
let mut iterations: u32 = 0;
Expand All @@ -378,11 +378,11 @@ mod multiplier_tests {
if iterations % EPOCH_DURATION_IN_SLOTS == 0 {
day_count += 1;
println!(
"Epoch: {}, lm: {:?}, Fee: {} units / {} MICRO_AVL",
"Epoch: {}, lm: {:?}, Fee: {} units / {} MICRO_AVAIL",
day_count,
lm,
tx_fee,
tx_fee / MICRO_AVL,
tx_fee / MICRO_AVAIL,
);
}
if day_count == 7u32 {
Expand Down
Loading
Loading