Open dengshuaige opened 7 months ago
Try rust 1.77.1 (7cf61ebde 2024-03-27), it works on my machine.
rust Copy code impl Address { pub fn from_slice(slice: &[u8]) -> Self { // Implementation goes here } } And you’d use it like this in your map:
rust Copy code .map(|account| (start_account, Address::from_slice(account)))
rust
Copy code
let mut account_diff: Vec
Error about no field from_block: This error means you're trying to access a field (from_block) that Rust doesn't recognize for the given data type. Double-check the type of the variable op. Ensure it’s the correct type that should have the from_block field. If op is indeed the correct type but still causing errors, there might be an issue with how it’s defined or used.
Warnings about unused imports: Rust is telling you that you've imported some modules or functions (ToBigInt, ToPrimitive) that you're not using anywhere in your code. You can safely remove these imports to clean up your code:
rust Copy code // Remove or comment out these lines // use num::bigint::ToBigInt; // use num::ToPrimitive; If any of these issues persist after you make changes, try running cargo check to get a quick overview of errors without compiling the whole project. This can help you catch issues faster.
When I use zk server,it returns failed, I used rust 1.66 1.70 1.72 1.74 1.75 1.76 How to compile success?
[u8]
cannot be known at compilation time --> core/lib/storage/src/chain/operations_ext/mod.rs:1444:15Vec<T>
--> core/lib/storage/src/chain/state/mod.rs:623:17help: consider giving = Vec::new();
| ++++++++
account_diff
an explicit type, where the type for type parameterT
is specified | 623 | let mut account_diff: Vecerror[E0609]: no field
from_block
on type&_
--> core/lib/storage/src/ethereum/mod.rs:520:46 | 520 | ... let (from_block, to_block) = (op.from_block as u32, op.to_block a... | ^^^^^^^^^^warning: unused import:
num::bigint::ToBigInt
--> core/lib/storage/src/chain/account/mod.rs:24:5 | 24 | use num::bigint::ToBigInt; | ^^^^^^^^^^^^^^^^^^^^^warning: unused import:
num::ToPrimitive
--> core/lib/storage/src/misc/mod.rs:9:5 | 9 | use num::ToPrimitive; | ^^^^^^^^^^^^^^^^Some errors have detailed explanations: E0277, E0282, E0609. For more information about an error, try
rustc --explain E0277
. warning:zksync_storage
(lib) generated 21 warnings error: could not compilezksync_storage
(lib) due to 319 previous errors; 21 warnings emitted