Skip to content

Commit

Permalink
Merge branch 'main' into update-v1.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshOrndorff committed Apr 16, 2024
2 parents 0fcf2f0 + 0963bf9 commit 328481e
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 180 deletions.
44 changes: 16 additions & 28 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
Expand Up @@ -128,7 +128,7 @@ sp-externalities = { branch = "tuxedo-v1.6.0", default_features = false, git = "
sp-state-machine = { branch = "tuxedo-v1.6.0", default_features = false, git = "https://github.com/Off-Narrative-Labs/polkadot-sdk" }
sp-tracing = { branch = "tuxedo-v1.6.0", default_features = false, git = "https://github.com/Off-Narrative-Labs/polkadot-sdk" }
sp-trie = { branch = "tuxedo-v1.6.0", default_features = false, git = "https://github.com/Off-Narrative-Labs/polkadot-sdk" }
trie-db = { version = "0.29.0", default-features = false }
trie-db = { version = "0.28.0", default-features = false }

# We need to depend on this explicitly so we can enable the "full-node" feature
# See https://github.com/paritytech/polkadot-sdk/issues/2551 for more details
Expand Down
4 changes: 2 additions & 2 deletions tuxedo-core/src/executive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ where
requires: missing_inputs,
provides,
priority: 0,
longevity: TransactionLongevity::max_value(),
longevity: TransactionLongevity::MAX,
propagate: true,
});
}
Expand All @@ -181,7 +181,7 @@ where
requires: Vec::new(),
provides,
priority: 0,
longevity: TransactionLongevity::max_value(),
longevity: TransactionLongevity::MAX,
propagate: true,
})
}
Expand Down
2 changes: 1 addition & 1 deletion tuxedo-parachain-core/src/validate_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use polkadot_parachain_primitives::primitives::{
};
use tuxedo_core::{
types::{Block, Header, Transaction},
ConstraintChecker, Executive, Verifier,
Executive, Verifier,
};

use parity_scale_codec::Encode;
Expand Down
3 changes: 1 addition & 2 deletions wallet/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ mod amoeba;
mod cli;
mod keystore;
mod money;
mod output_filter;
mod parachain;
mod rpc;
mod sync;
Expand Down Expand Up @@ -76,7 +75,7 @@ async fn main() -> anyhow::Result<()> {
matches![v,
OuterVerifier::Sr25519Signature(Sr25519Signature { owner_pubkey })
if crate::keystore::has_key(&keystore, owner_pubkey)
] || matches![v, OuterVerifier::UpForGrabs(UpForGrabs)] // used for timestamp
]
};

if !sled::Db::was_recovered(&db) {
Expand Down
137 changes: 0 additions & 137 deletions wallet/src/output_filter.rs

This file was deleted.

11 changes: 4 additions & 7 deletions wallet/src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,16 +280,13 @@ async fn apply_transaction<F: Fn(&OuterVerifier) -> bool, C: ConstraintChecker>(
let tx = Transaction::<OuterVerifier, C>::decode(&mut &encoded_extrinsic[..])?;

// Insert all new outputs
for (index, output) in tx
.outputs
.iter()
.filter(|o| filter(&o.verifier))
.enumerate()
{
for (index, output) in tx.outputs.iter().enumerate() {
// For now the wallet only supports simple coins and timestamp
match output.payload.type_id {
Coin::<0>::TYPE_ID => {
crate::money::apply_transaction(db, tx_hash, index as u32, output)?;
if filter(&output.verifier) {
crate::money::apply_transaction(db, tx_hash, index as u32, output)?;
}
}
Timestamp::TYPE_ID => {
crate::timestamp::apply_transaction(db, output)?;
Expand Down
4 changes: 2 additions & 2 deletions wardrobe/money/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,10 @@ impl<const ID: u8> SimpleConstraintChecker for MoneyConstraintChecker<ID> {
// Priority is based on how many token are burned
// Type stuff is kinda ugly. Maybe division would be better?
let burned = total_input_value - total_output_value;
Ok(if burned < u64::max_value() as u128 {
Ok(if burned < u64::MAX as u128 {
burned as u64
} else {
u64::max_value()
u64::MAX
})
}
Self::Mint => {
Expand Down

0 comments on commit 328481e

Please sign in to comment.