Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: 🤖 legacy interface support #56

Merged
merged 1 commit into from
Sep 28, 2022

Conversation

heldrida
Copy link
Member

Why?

Should provide support for none snakecase version of the interface

@heldrida
Copy link
Member Author

⚠️ Requires fix

error[E0658]: use of unstable library feature 'bool_to_option'
   --> src/main.rs:351:14
    |
351 |             .then_some(())
    |              ^^^^^^^^^
    |
    = note: see issue #80967 <https://github.com/rust-lang/rust/issues/80967> for more information

error[E0658]: use of unstable library feature 'bool_to_option'
   --> src/main.rs:585:14
    |
585 |             .then_some(())
    |              ^^^^^^^^^
    |
    = note: see issue #80967 <https://github.com/rust-lang/rust/issues/80967> for more information

error[E0658]: use of unstable library feature 'bool_to_option'
   --> src/main.rs:590:14
    |
590 |             .then_some(())
    |              ^^^^^^^^^
    |
    = note: see issue #80967 <https://github.com/rust-lang/rust/issues/80967> for more information

error[E0283]: type annotations needed
   --> src/main.rs:611:28
    |
611 |         Ok(ledger.inc_tx() - 1)
    |                            ^ cannot infer type for type `{integer}`
    |
    = note: multiple `impl`s satisfying `ic_cdk::export::candid::Nat: Sub<{integer}>` found in the `candid` crate:
            - impl Sub<i32> for ic_cdk::export::candid::Nat;
            - impl Sub<u128> for ic_cdk::export::candid::Nat;
            - impl Sub<u16> for ic_cdk::export::candid::Nat;
            - impl Sub<u32> for ic_cdk::export::candid::Nat;
            and 3 more

error[E0658]: use of unstable library feature 'bool_to_option'
   --> src/main.rs:625:14
    |
625 |             .then_some(())
    |              ^^^^^^^^^
    |
    = note: see issue #80967 <https://github.com/rust-lang/rust/issues/80967> for more information

error[E0283]: type annotations needed
   --> src/main.rs:651:28
    |
651 |         Ok(ledger.inc_tx() - 1)
    |                            ^ cannot infer type for type `{integer}`
    |
    = note: multiple `impl`s satisfying `ic_cdk::export::candid::Nat: Sub<{integer}>` found in the `candid` crate:
            - impl Sub<i32> for ic_cdk::export::candid::Nat;
            - impl Sub<u128> for ic_cdk::export::candid::Nat;
            - impl Sub<u16> for ic_cdk::export::candid::Nat;
            - impl Sub<u32> for ic_cdk::export::candid::Nat;
            and 3 more

error[E0658]: use of unstable library feature 'bool_to_option'
   --> src/main.rs:660:24
    |
660 |         to.ne(&caller).then_some(()).ok_or(NftError::SelfTransfer)?;
    |                        ^^^^^^^^^
    |
    = note: see issue #80967 <https://github.com/rust-lang/rust/issues/80967> for more information

error[E0658]: use of unstable library feature 'bool_to_option'
   --> src/main.rs:665:14
    |
665 |             .then_some(())
    |              ^^^^^^^^^
    |
    = note: see issue #80967 <https://github.com/rust-lang/rust/issues/80967> for more information

error[E0283]: type annotations needed
   --> src/main.rs:684:28
    |
684 |         Ok(ledger.inc_tx() - 1)
    |                            ^ cannot infer type for type `{integer}`
    |
    = note: multiple `impl`s satisfying `ic_cdk::export::candid::Nat: Sub<{integer}>` found in the `candid` crate:
            - impl Sub<i32> for ic_cdk::export::candid::Nat;
            - impl Sub<u128> for ic_cdk::export::candid::Nat;
            - impl Sub<u16> for ic_cdk::export::candid::Nat;
            - impl Sub<u32> for ic_cdk::export::candid::Nat;
            and 3 more

error[E0658]: use of unstable library feature 'bool_to_option'
   --> src/main.rs:697:23
    |
697 |         owner.ne(&to).then_some(()).ok_or(NftError::SelfTransfer)?;
    |                       ^^^^^^^^^
    |
    = note: see issue #80967 <https://github.com/rust-lang/rust/issues/80967> for more information

error[E0658]: use of unstable library feature 'bool_to_option'
   --> src/main.rs:702:14
    |
702 |             .then_some(())
    |              ^^^^^^^^^
    |
    = note: see issue #80967 <https://github.com/rust-lang/rust/issues/80967> for more information

error[E0658]: use of unstable library feature 'bool_to_option'
   --> src/main.rs:706:14
    |
706 |             .then_some(())
    |              ^^^^^^^^^
    |
    = note: see issue #80967 <https://github.com/rust-lang/rust/issues/80967> for more information

error[E0283]: type annotations needed
   --> src/main.rs:725:28
    |
725 |         Ok(ledger.inc_tx() - 1)
    |                            ^ cannot infer type for type `{integer}`
    |
    = note: multiple `impl`s satisfying `ic_cdk::export::candid::Nat: Sub<{integer}>` found in the `candid` crate:
            - impl Sub<i32> for ic_cdk::export::candid::Nat;
            - impl Sub<u128> for ic_cdk::export::candid::Nat;
            - impl Sub<u16> for ic_cdk::export::candid::Nat;
            - impl Sub<u32> for ic_cdk::export::candid::Nat;
            and 3 more

error[E0658]: use of unstable library feature 'bool_to_option'
   --> src/main.rs:741:14
    |
741 |             .then_some(())
    |              ^^^^^^^^^
    |
    = note: see issue #80967 <https://github.com/rust-lang/rust/issues/80967> for more information

error[E0283]: type annotations needed
   --> src/main.rs:775:28
    |
775 |         Ok(ledger.inc_tx() - 1)
    |                            ^ cannot infer type for type `{integer}`
    |
    = note: multiple `impl`s satisfying `ic_cdk::export::candid::Nat: Sub<{integer}>` found in the `candid` crate:
            - impl Sub<i32> for ic_cdk::export::candid::Nat;
            - impl Sub<u128> for ic_cdk::export::candid::Nat;
            - impl Sub<u16> for ic_cdk::export::candid::Nat;
            - impl Sub<u32> for ic_cdk::export::candid::Nat;
            and 3 more

error[E0658]: use of unstable library feature 'bool_to_option'
   --> src/main.rs:787:14
    |
787 |             .then_some(())
    |              ^^^^^^^^^
    |
    = note: see issue #80967 <https://github.com/rust-lang/rust/issues/80967> for more information

error[E0283]: type annotations needed
   --> src/main.rs:803:28
    |
803 |         Ok(ledger.inc_tx() - 1)
    |                            ^ cannot infer type for type `{integer}`
    |
    = note: multiple `impl`s satisfying `ic_cdk::export::candid::Nat: Sub<{integer}>` found in the `candid` crate:
            - impl Sub<i32> for ic_cdk::export::candid::Nat;
            - impl Sub<u128> for ic_cdk::export::candid::Nat;
            - impl Sub<u16> for ic_cdk::export::candid::Nat;
            - impl Sub<u32> for ic_cdk::export::candid::Nat;
            and 3 more

Some errors have detailed explanations: E0283, E0658.
For more information about an error, try `rustc --explain E0283`.
error: could not compile `crowns` due to 17 previous errors
Optimizing WASM module.
Original:          1.08 MiB
Stripping Unused Data Segments...
Pass did not result in smaller WASM... Skipping.
Executing a binaryen optimization...
    Size:          1.08 MiB (0.0% smaller)

Final Size: 1.08 MiB (0.0% smaller)
Error: Failed while trying to build all canisters.
Caused by: Failed while trying to build all canisters.
  The build step failed for canister 'vlhm2-4iaaa-aaaam-qaatq-cai' (crowns) with an embedded error: Failed to build Rust canister 'crowns'.: Failed to compile the rust package: crowns
Error: Failed while trying to deploy canisters.
Caused by: Failed while trying to deploy canisters.
  Failed to build call canisters.
    Failed while trying to build all canisters.
      The build step failed for canister 'renrk-eyaaa-aaaaa-aaada-cai' (crowns) with an embedded error: Failed to build custom canister crowns.: Failed to run sh -c 'cd dependencies/crowns && dfx build --network ic crowns'.: The custom tool failed.
Error: Failed update call.
Caused by: Failed update call.
  The replica returned an HTTP Error: Http Error: status 503 Service Unavailable, content type "", content: Requested canister has no wasm module

@ozwaldorf
Copy link
Collaborator

ozwaldorf commented Sep 23, 2022

rust-lang/rust#80967

looks like this was stabilized, what version of rust are you running ? I have 1.63

@heldrida heldrida merged commit 533ad98 into main Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants