Skip to content

doesnt compile #3

Description

@venil7
  --> src/transaction.rs:36:43
   |
36 |                 self.signature = Some(key.sign(&self.calculate_hash()));
   |                                           ^^^^ method not found in `Keypair`
   |
  ::: /Users/user/.cargo/registry/src/github.com-1ecc6299db9ec823/signature-1.3.1/src/signer.rs:15:8
   |
15 |     fn sign(&self, msg: &[u8]) -> S {
   |        ---- the method is available for `Keypair` here
   |
   = help: items from traits can only be used if the trait is in scope
   = note: the following trait is implemented but not in scope; perhaps add a `use` for it:
           `use ed25519_dalek::Signer;`

error[E0599]: no method named `verify` found for struct `PublicKey` in the current scope
  --> src/transaction.rs:43:37
   |
43 |             (Some(p), Some(s)) if p.verify(&self.calculate_hash(), &s).is_ok() => true,
   |                                     ^^^^^^ method not found in `PublicKey`
   |
  ::: /Users/user/.cargo/registry/src/github.com-1ecc6299db9ec823/signature-1.3.1/src/verifier.rs:14:8
   |
14 |     fn verify(&self, msg: &[u8], signature: &S) -> Result<(), Error>;
   |        ------ the method is available for `PublicKey` here
   |
   = help: items from traits can only be used if the trait is in scope
   = note: the following trait is implemented but not in scope; perhaps add a `use` for it:
           `use ed25519_dalek::Verifier;`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0599`.
error: could not compile `rust_blockchain`

To learn more, run the command again with --verbose.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions