Skip to content

Commit

Permalink
Merge pull request #11 from opentensor/tensordot-v1.4.0-fixes/balance…
Browse files Browse the repository at this point in the history
…s_type_adjust

Adjust AccountData type to preserve old data layout
  • Loading branch information
welikethestock authored Feb 22, 2024
2 parents fcfdb98 + 345cc6a commit 5f9638e
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 36 deletions.
4 changes: 2 additions & 2 deletions .config/lychee.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ exclude = [
"http://visitme/",
"https://visitme/",

# TODO <https://github.com/paritytech/polkadot-sdk/issues/134>
# TODO <https://github.com/opentensor/polkadot-sdk/issues/134>
"https://docs.substrate.io/main-docs/build/custom-rpc/#public-rpcs",
"https://docs.substrate.io/rustdocs/latest/sp_api/macro.decl_runtime_apis.html",
"https://github.com/ipfs/js-ipfs-bitswap/blob/",
"https://github.com/paritytech/polkadot-sdk/substrate/frame/timestamp",
"https://github.com/opentensor/polkadot-sdk/substrate/frame/timestamp",
"https://github.com/paritytech/substrate/frame/fast-unstake",
"https://github.com/zkcrypto/bls12_381/blob/e224ad4ea1babfc582ccd751c2bf128611d10936/src/test-data/mod.rs",
"https://polkadot.network/the-path-of-a-parachain-block/",
Expand Down
2 changes: 1 addition & 1 deletion .config/zepter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ help:
It looks like one more more checks failed; please check the console output. You can try to automatically address them by running `zepter`.
Otherwise please ask directly in the Merge Request, GitHub Discussions or on Matrix Chat, thank you.
links:
- "https://github.com/paritytech/polkadot-sdk/issues/1831"
- "https://github.com/opentensor/polkadot-sdk/issues/1831"
- "https://github.com/ggwpez/zepter"
2 changes: 1 addition & 1 deletion .gitlab/pipeline/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ cargo-hfuzz:
- for target in $(cargo read-manifest | jq -r '.targets | .[] | .name'); do
cargo hfuzz run "$target" || { printf "fuzzing failure for %s\n" "$target"; exit 1; }; done

# cf https://github.com/paritytech/polkadot-sdk/issues/1652
# cf https://github.com/opentensor/polkadot-sdk/issues/1652
test-syscalls:
stage: test
extends:
Expand Down
50 changes: 25 additions & 25 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[workspace.package]
authors = ["Parity Technologies <[email protected]>"]
edition = "2021"
repository = "https://github.com/paritytech/polkadot-sdk.git"
repository = "https://github.com/opentensor/polkadot-sdk.git"
license = "GPL-3.0-only"

[workspace]
Expand Down
9 changes: 5 additions & 4 deletions substrate/frame/balances/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ pub mod pallet {
origin: OriginFor<T>,
who: Vec<T::AccountId>,
) -> DispatchResultWithPostInfo {
ensure_signed(origin)?;
/*ensure_signed(origin)?;
if who.is_empty() {
return Ok(Pays::Yes.into())
}
Expand All @@ -704,7 +704,8 @@ pub mod pallet {
Ok(Pays::No.into())
} else {
Ok(Pays::Yes.into())
}
}*/
Ok(Pays::No.into())
}

/// Set the regular balance of a given account.
Expand Down Expand Up @@ -756,10 +757,10 @@ pub mod pallet {
/// Returns `true` if the account did get upgraded, `false` if it didn't need upgrading.
pub fn ensure_upgraded(who: &T::AccountId) -> bool {
let mut a = T::AccountStore::get(who);
if a.flags.is_new_logic() {
if /*a.flags.is_new_logic()*/ true {
return false
}
a.flags.set_new_logic();
//a.flags.set_new_logic();
if !a.reserved.is_zero() && a.frozen.is_zero() {
if system::Pallet::<T>::providers(who) == 0 {
// Gah!! We have no provider refs :(
Expand Down
2 changes: 1 addition & 1 deletion substrate/frame/balances/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ pub struct AccountData<Balance> {
pub frozen: Balance,
/// Extra information about this account. The MSB is a flag indicating whether the new ref-
/// counting logic is in place for this account.
pub flags: ExtraFlags,
pub fee_frozen: Balance,
}

const IS_NEW_LOGIC: u128 = 0x80000000_00000000_00000000_00000000u128;
Expand Down
2 changes: 1 addition & 1 deletion substrate/primitives/consensus/sassafras/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description = "Primitives for Sassafras consensus"
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/polkadot-sdk/"
repository = "https://github.com/opentensor/polkadot-sdk/"
documentation = "https://docs.rs/sp-consensus-sassafras"
readme = "README.md"
publish = false
Expand Down

0 comments on commit 5f9638e

Please sign in to comment.