Merge pull request #1663 from zcash/pczt-no-std
pczt: Enable the base crate to be no-std compatible
This commit is contained in:
commit
8c59e25d79
|
@ -21,7 +21,7 @@ rand_core = { workspace = true, optional = true }
|
|||
# Encoding
|
||||
postcard = { version = "1", features = ["alloc"] }
|
||||
serde.workspace = true
|
||||
serde_with = "3"
|
||||
serde_with = { version = "3", default-features = false, features = ["alloc", "macros"] }
|
||||
|
||||
# Payment protocols
|
||||
# - Transparent
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
use std::collections::BTreeMap;
|
||||
use alloc::collections::BTreeMap;
|
||||
use alloc::string::String;
|
||||
use alloc::vec::Vec;
|
||||
|
||||
use getset::Getters;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
@ -199,7 +201,7 @@ pub(crate) struct Zip32Derivation {
|
|||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::collections::BTreeMap;
|
||||
use alloc::collections::BTreeMap;
|
||||
|
||||
use super::Global;
|
||||
|
||||
|
|
|
@ -41,6 +41,13 @@
|
|||
//! - Transaction Extractor (anyone can execute)
|
||||
//! - Creates bindingSig and extracts the final transaction.
|
||||
|
||||
#![no_std]
|
||||
|
||||
#[macro_use]
|
||||
extern crate alloc;
|
||||
|
||||
use alloc::vec::Vec;
|
||||
|
||||
use getset::Getters;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
use std::{cmp::Ordering, collections::BTreeMap};
|
||||
use alloc::collections::BTreeMap;
|
||||
use alloc::string::String;
|
||||
use alloc::vec::Vec;
|
||||
use core::cmp::Ordering;
|
||||
|
||||
#[cfg(feature = "orchard")]
|
||||
use ff::PrimeField;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
use std::collections::BTreeMap;
|
||||
use alloc::collections::BTreeMap;
|
||||
use alloc::vec::Vec;
|
||||
|
||||
use crate::Pczt;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use std::collections::BTreeMap;
|
||||
use alloc::collections::BTreeMap;
|
||||
|
||||
use crate::{
|
||||
common::{
|
||||
|
|
|
@ -278,7 +278,7 @@ impl Authorization for EffectsOnly {
|
|||
type SaplingAuth = sapling::bundle::EffectsOnly;
|
||||
type OrchardAuth = orchard::bundle::EffectsOnly;
|
||||
#[cfg(zcash_unstable = "zfuture")]
|
||||
type TzeAuth = std::convert::Infallible;
|
||||
type TzeAuth = core::convert::Infallible;
|
||||
}
|
||||
|
||||
/// Errors that can occur while creating signatures for a PCZT.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use std::marker::PhantomData;
|
||||
use core::marker::PhantomData;
|
||||
|
||||
use rand_core::OsRng;
|
||||
use zcash_primitives::{
|
||||
|
@ -155,7 +155,7 @@ impl Authorization for Unbound {
|
|||
type SaplingAuth = ::sapling::pczt::Unbound;
|
||||
type OrchardAuth = ::orchard::pczt::Unbound;
|
||||
#[cfg(zcash_unstable = "zfuture")]
|
||||
type TzeAuth = std::convert::Infallible;
|
||||
type TzeAuth = core::convert::Infallible;
|
||||
}
|
||||
|
||||
/// Errors that can occur while extracting a transaction from a PCZT.
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
use alloc::string::String;
|
||||
use alloc::vec::Vec;
|
||||
|
||||
use crate::{common::Global, Pczt};
|
||||
|
||||
#[cfg(feature = "orchard")]
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
use std::cmp::Ordering;
|
||||
use std::collections::BTreeMap;
|
||||
use alloc::collections::BTreeMap;
|
||||
use alloc::string::String;
|
||||
use alloc::vec::Vec;
|
||||
use core::cmp::Ordering;
|
||||
|
||||
use getset::Getters;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
use std::{cmp::Ordering, collections::BTreeMap};
|
||||
use alloc::collections::BTreeMap;
|
||||
use alloc::string::String;
|
||||
use alloc::vec::Vec;
|
||||
use core::cmp::Ordering;
|
||||
|
||||
use crate::{
|
||||
common::{Global, Zip32Derivation},
|
||||
|
|
Loading…
Reference in New Issue