Skip to content

casper-client=3.1.0 doesn't compile #257

@zie1ony

Description

@zie1ony

Underlaying casper-types introduces breaking changes and the client no longer compiles. Link: casper-network/casper-node#5275

To reproduce, add casper-client as dependency:

[dependencies]
casper-client = "3.1.0"

Errors:

   Compiling casper-client v3.1.0
error[E0599]: no variant or associated item named `new_package_with_key` found for enum `TransactionInvocationTarget` in the current scope
   --> /Users/ziel/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/casper-client-3.1.0/lib/cli/transaction_v1_builder.rs:374:47
    |
374 |         let id = TransactionInvocationTarget::new_package_with_key(hash, version);
    |                                               ^^^^^^^^^^^^^^^^^^^^ variant or associated item not found in `TransactionInvocationTarget`
    |
note: if you're trying to build a new `TransactionInvocationTarget` consider using one of the following associated functions:
      TransactionInvocationTarget::new_invocable_entity
      TransactionInvocationTarget::new_invocable_entity_alias
      TransactionInvocationTarget::new_package
      TransactionInvocationTarget::new_package_with_major
      and 2 others
   --> /Users/ziel/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/casper-types-6.0.1/src/transaction/transaction_invocation_target.rs:86:5
    |
86  |       pub fn new_invocable_entity(hash: AddressableEntityHash) -> Self {
    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
91  |       pub fn new_invocable_entity_alias(alias: String) -> Self {
    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
97  |       pub fn new_package(hash: PackageHash, version: Option<EntityVersion>) -> Self {
    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
106 | /     pub fn new_package_with_major(
107 | |         hash: PackageHash,
108 | |         version: Option<EntityVersion>,
109 | |         protocol_version_major: Option<ProtocolVersionMajor>,
110 | |     ) -> Self {
    | |_____________^
help: there is an associated function `new_package` with a similar name
    |
374 -         let id = TransactionInvocationTarget::new_package_with_key(hash, version);
374 +         let id = TransactionInvocationTarget::new_package(hash, version);
    |

error[E0599]: no variant or associated item named `new_package_alias_with_key` found for enum `TransactionInvocationTarget` in the current scope
   --> /Users/ziel/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/casper-client-3.1.0/lib/cli/transaction_v1_builder.rs:399:47
    |
399 |         let id = TransactionInvocationTarget::new_package_alias_with_key(alias.into(), version);
    |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^ variant or associated item not found in `TransactionInvocationTarget`
    |
note: if you're trying to build a new `TransactionInvocationTarget` consider using one of the following associated functions:
      TransactionInvocationTarget::new_invocable_entity
      TransactionInvocationTarget::new_invocable_entity_alias
      TransactionInvocationTarget::new_package
      TransactionInvocationTarget::new_package_with_major
      and 2 others
   --> /Users/ziel/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/casper-types-6.0.1/src/transaction/transaction_invocation_target.rs:86:5
    |
86  |       pub fn new_invocable_entity(hash: AddressableEntityHash) -> Self {
    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
91  |       pub fn new_invocable_entity_alias(alias: String) -> Self {
    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
97  |       pub fn new_package(hash: PackageHash, version: Option<EntityVersion>) -> Self {
    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
106 | /     pub fn new_package_with_major(
107 | |         hash: PackageHash,
108 | |         version: Option<EntityVersion>,
109 | |         protocol_version_major: Option<ProtocolVersionMajor>,
110 | |     ) -> Self {
    | |_____________^
help: there is an associated function `new_package_alias` with a similar name
    |
399 -         let id = TransactionInvocationTarget::new_package_alias_with_key(alias.into(), version);
399 +         let id = TransactionInvocationTarget::new_package_alias(alias.into(), version);
    |

For more information about this error, try `rustc --explain E0599`.
warning: casper-client@3.1.0: Note: Failed to get git commit hash: Git command failed
error: could not compile `casper-client` (lib) due to 2 previous errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions