Skip to content

Commit

Permalink
release v1.4.0 (#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
abhath-labs authored Mar 31, 2024
1 parent ae25813 commit c690fc4
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 47 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

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

70 changes: 35 additions & 35 deletions pallets/carbon-credits/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,41 +257,41 @@ impl<T: Config> Pallet<T> {
carbon_forwards_group.total_supply = group_total_supply;
},

BatchGroup::Shares(ref mut carbon_shares_group) => {
let mut group_total_supply: T::Balance = Zero::zero();
for batch in carbon_shares_group.batches.iter() {
ensure!(
batch.total_supply > Zero::zero(),
Error::<T>::CannotCreateProjectWithoutCredits
);

ensure!(
batch.minted == Zero::zero(),
Error::<T>::CannotCreateProjectWithoutCredits
);

ensure!(
batch.retired == Zero::zero(),
Error::<T>::CannotCreateProjectWithoutCredits
);

group_total_supply = group_total_supply
.checked_add(&batch.total_supply)
.ok_or(Error::<T>::Overflow)?;
}

ensure!(
group_total_supply > Zero::zero(),
Error::<T>::CannotCreateProjectWithoutCredits
);

// sort batch data in ascending order of issuance year
carbon_shares_group
.batches
.sort_by(|x, y| x.issuance_year.cmp(&y.issuance_year));
carbon_shares_group.total_supply = group_total_supply;
},
_ => Default::default(),
// BatchGroup::Shares(ref mut carbon_shares_group) => {
// let mut group_total_supply: T::Balance = Zero::zero();
// for batch in carbon_shares_group.batches.iter() {
// ensure!(
// batch.total_supply > Zero::zero(),
// Error::<T>::CannotCreateProjectWithoutCredits
// );

// ensure!(
// batch.minted == Zero::zero(),
// Error::<T>::CannotCreateProjectWithoutCredits
// );

// ensure!(
// batch.retired == Zero::zero(),
// Error::<T>::CannotCreateProjectWithoutCredits
// );

// group_total_supply = group_total_supply
// .checked_add(&batch.total_supply)
// .ok_or(Error::<T>::Overflow)?;
// }

// ensure!(
// group_total_supply > Zero::zero(),
// Error::<T>::CannotCreateProjectWithoutCredits
// );

// // sort batch data in ascending order of issuance year
// carbon_shares_group
// .batches
// .sort_by(|x, y| x.issuance_year.cmp(&y.issuance_year));
// carbon_shares_group.total_supply = group_total_supply;
// },
_ => return Err(Error::<T>::NotSupported.into()),
}

// insert the group to BTreeMap
Expand Down
2 changes: 2 additions & 0 deletions pallets/carbon-credits/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,8 @@ pub mod pallet {
RetirementReasonOutOfBounds,
/// Carbon asset type mismatch
CarbonAssetTypeMismatch,
/// Not supported asset type
NotSupported,
}

#[pallet::call]
Expand Down
2 changes: 1 addition & 1 deletion parachain/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = 'bitgreen-parachain'
version = '0.0.1'
version = '1.4.0'
authors = ['BitGreen <https://www.bitgreen.org>']
build = 'build.rs'
edition = '2021'
Expand Down
8 changes: 4 additions & 4 deletions parachain/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fn load_spec(id: &str) -> std::result::Result<Box<dyn ChainSpec>, String> {

impl SubstrateCli for Cli {
fn impl_name() -> String {
"Parachain Collator Template".into()
"Bitgreen Collator".into()
}

fn impl_version() -> String {
Expand All @@ -37,7 +37,7 @@ impl SubstrateCli for Cli {

fn description() -> String {
format!(
"Parachain Collator Template\n\nThe command-line arguments provided first will be \
"Bitgreen Collator\n\nThe command-line arguments provided first will be \
passed to the parachain node, while the arguments provided after -- will be passed \
to the relay chain node.\n\n\
{} <parachain-args> -- <relay-chain-args>",
Expand All @@ -64,7 +64,7 @@ impl SubstrateCli for Cli {

impl SubstrateCli for RelayChainCli {
fn impl_name() -> String {
"Parachain Collator Template".into()
"Bitgreen Collator".into()
}

fn impl_version() -> String {
Expand All @@ -73,7 +73,7 @@ impl SubstrateCli for RelayChainCli {

fn description() -> String {
format!(
"Parachain Collator Template\n\nThe command-line arguments provided first will be \
"Bitgreen Collator\n\nThe command-line arguments provided first will be \
passed to the parachain node, while the arguments provided after -- will be passed \
to the relay chain node.\n\n\
{} <parachain-args> -- <relay-chain-args>",
Expand Down
2 changes: 1 addition & 1 deletion runtime/bitgreen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = 'bitgreen-runtime'
version = '0.1.0'
version = '1.4.0'
authors = ['BitGreen <https://www.bitgreen.org>']
edition = '2021'
homepage = 'https://www.bitgreen.org'
Expand Down
2 changes: 1 addition & 1 deletion runtime/bitgreen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ parameter_types! {
pub const SessionLength: BlockNumber = 6 * HOURS;
pub const MaxInvulnerables: u32 = 100;
#[derive(Clone, TypeInfo, Debug, PartialOrd, Ord, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
pub const MaxDelegators : u32 = 20;
pub const MaxDelegators : u32 = 50;
pub const MinDelegationAmount : u32 = 100;
pub const ExecutiveBody: BodyId = BodyId::Executive;
pub const UnbondingDelay : BlockNumber = 7 * DAYS;
Expand Down
2 changes: 1 addition & 1 deletion runtime/rococo/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = 'bitgreen-rococo-runtime'
version = '0.1.0'
version = '1.4.0'
authors = ['BitGreen <https://www.bitgreen.org>']
edition = '2021'
homepage = 'https://www.bitgreen.org'
Expand Down
2 changes: 1 addition & 1 deletion runtime/rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ parameter_types! {
pub const SessionLength: BlockNumber = 6 * HOURS;
pub const MaxInvulnerables: u32 = 100;
#[derive(Clone, TypeInfo, Debug, PartialOrd, Ord, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
pub const MaxDelegators : u32 = 20;
pub const MaxDelegators : u32 = 50;
pub const MinDelegationAmount : u32 = 100;
pub const ExecutiveBody: BodyId = BodyId::Executive;
pub const UnbondingDelay : BlockNumber = 7 * DAYS;
Expand Down

0 comments on commit c690fc4

Please sign in to comment.