Emirhan-Cavusoglu-sftw 1532a3b0a4 call first function
2024-10-13 00:06:20 +01:00

8 lines
18 KiB
Plaintext

{"$message_type":"diagnostic","message":"cannot find type `EscrowClient` in this scope","code":{"code":"E0412","explanation":"A used type name is not in scope.\n\nErroneous code examples:\n\n```compile_fail,E0412\nimpl Something {} // error: type name `Something` is not in scope\n\n// or:\n\ntrait Foo {\n fn bar(N); // error: type name `N` is not in scope\n}\n\n// or:\n\nfn foo(x: T) {} // type name `T` is not in scope\n```\n\nTo fix this error, please verify you didn't misspell the type name, you did\ndeclare it or imported it into the scope. Examples:\n\n```\nstruct Something;\n\nimpl Something {} // ok!\n\n// or:\n\ntrait Foo {\n type N;\n\n fn bar(_: Self::N); // ok!\n}\n\n// or:\n\nfn foo<T>(x: T) {} // ok!\n```\n\nAnother case that causes this error is when a type is imported into a parent\nmodule. To fix this, you can follow the suggestion and use File directly or\n`use super::File;` which will import the types from the parent namespace. An\nexample that causes this error is below:\n\n```compile_fail,E0412\nuse std::fs::File;\n\nmod foo {\n fn some_function(f: File) {}\n}\n```\n\n```\nuse std::fs::File;\n\nmod foo {\n // either\n use super::File;\n // or\n // use std::fs::File;\n fn foo(f: File) {}\n}\n# fn main() {} // don't insert it for us; that'll break imports\n```\n"},"level":"error","spans":[{"file_name":"escrow/src/lib.rs","byte_start":736,"byte_end":751,"line_start":41,"line_end":41,"column_start":1,"column_end":16,"is_primary":true,"text":[{"text":"#[contractimpl]","highlight_start":1,"highlight_end":16}],"label":"not found in this scope","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"escrow/src/lib.rs","byte_start":736,"byte_end":751,"line_start":41,"line_end":41,"column_start":1,"column_end":16,"is_primary":false,"text":[{"text":"#[contractimpl]","highlight_start":1,"highlight_end":16}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"#[soroban_sdk::contractclient]","def_site_span":{"file_name":"/Users/emirhancavusoglu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/soroban-sdk-macros-20.5.0/src/lib.rs","byte_start":17088,"byte_end":17167,"line_start":554,"line_end":554,"column_start":1,"column_end":80,"is_primary":false,"text":[{"text":"pub fn contractclient(metadata: TokenStream, input: TokenStream) -> TokenStream {","highlight_start":1,"highlight_end":80}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;9merror[E0412]\u001b[0m\u001b[0m\u001b[1m: cannot find type `EscrowClient` in this scope\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0mescrow/src/lib.rs:41:1\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m41\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m#[contractimpl]\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9m^^^^^^^^^^^^^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9mnot found in this scope\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mnote\u001b[0m\u001b[0m: this error originates in the attribute macro `soroban_sdk::contractclient` (in Nightly builds, run with -Z macro-backtrace for more info)\u001b[0m\n\n"}
{"$message_type":"diagnostic","message":"unused import: `Vec`","code":{"code":"unused_imports","explanation":null},"level":"warning","spans":[{"file_name":"escrow/src/lib.rs","byte_start":118,"byte_end":121,"line_start":5,"line_end":5,"column_start":27,"column_end":30,"is_primary":true,"text":[{"text":" Address, Env, String, Vec,","highlight_start":27,"highlight_end":30}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`#[warn(unused_imports)]` on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"remove the unused import","code":null,"level":"help","spans":[{"file_name":"escrow/src/lib.rs","byte_start":116,"byte_end":121,"line_start":5,"line_end":5,"column_start":25,"column_end":30,"is_primary":true,"text":[{"text":" Address, Env, String, Vec,","highlight_start":25,"highlight_end":30}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[33mwarning\u001b[0m\u001b[0m\u001b[1m: unused import: `Vec`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0mescrow/src/lib.rs:5:27\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m5\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m Address, Env, String, Vec,\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[33m^^^\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mnote\u001b[0m\u001b[0m: `#[warn(unused_imports)]` on by default\u001b[0m\n\n"}
{"$message_type":"diagnostic","message":"the trait bound `soroban_sdk::xdr::ScVal: From<soroban_sdk::String>` is not satisfied","code":{"code":"E0277","explanation":"You tried to use a type which doesn't implement some trait in a place which\nexpected that trait.\n\nErroneous code example:\n\n```compile_fail,E0277\n// here we declare the Foo trait with a bar method\ntrait Foo {\n fn bar(&self);\n}\n\n// we now declare a function which takes an object implementing the Foo trait\nfn some_func<T: Foo>(foo: T) {\n foo.bar();\n}\n\nfn main() {\n // we now call the method with the i32 type, which doesn't implement\n // the Foo trait\n some_func(5i32); // error: the trait bound `i32 : Foo` is not satisfied\n}\n```\n\nIn order to fix this error, verify that the type you're using does implement\nthe trait. Example:\n\n```\ntrait Foo {\n fn bar(&self);\n}\n\n// we implement the trait on the i32 type\nimpl Foo for i32 {\n fn bar(&self) {}\n}\n\nfn some_func<T: Foo>(foo: T) {\n foo.bar(); // we can now use this method since i32 implements the\n // Foo trait\n}\n\nfn main() {\n some_func(5i32); // ok!\n}\n```\n\nOr in a generic context, an erroneous code example would look like:\n\n```compile_fail,E0277\nfn some_func<T>(foo: T) {\n println!(\"{:?}\", foo); // error: the trait `core::fmt::Debug` is not\n // implemented for the type `T`\n}\n\nfn main() {\n // We now call the method with the i32 type,\n // which *does* implement the Debug trait.\n some_func(5i32);\n}\n```\n\nNote that the error here is in the definition of the generic function. Although\nwe only call it with a parameter that does implement `Debug`, the compiler\nstill rejects the function. It must work with all possible input types. In\norder to make this example compile, we need to restrict the generic type we're\naccepting:\n\n```\nuse std::fmt;\n\n// Restrict the input type to types that implement Debug.\nfn some_func<T: fmt::Debug>(foo: T) {\n println!(\"{:?}\", foo);\n}\n\nfn main() {\n // Calling the method is still fine, as i32 implements Debug.\n some_func(5i32);\n\n // This would fail to compile now:\n // struct WithoutDebug;\n // some_func(WithoutDebug);\n}\n```\n\nRust only looks at the signature of the called function, as such it must\nalready specify all requirements that will be used for every type parameter.\n"},"level":"error","spans":[{"file_name":"escrow/src/lib.rs","byte_start":264,"byte_end":279,"line_start":17,"line_end":17,"column_start":1,"column_end":16,"is_primary":true,"text":[{"text":"#[contracttype]","highlight_start":1,"highlight_end":16}],"label":"the trait `From<soroban_sdk::String>` is not implemented for `soroban_sdk::xdr::ScVal`, which is required by `&core::option::Option<soroban_sdk::String>: TryInto<_>`","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"escrow/src/lib.rs","byte_start":264,"byte_end":279,"line_start":17,"line_end":17,"column_start":1,"column_end":16,"is_primary":false,"text":[{"text":"#[contracttype]","highlight_start":1,"highlight_end":16}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"#[contracttype]","def_site_span":{"file_name":"/Users/emirhancavusoglu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/soroban-sdk-macros-20.5.0/src/lib.rs","byte_start":11266,"byte_end":11343,"line_start":377,"line_end":377,"column_start":1,"column_end":78,"is_primary":false,"text":[{"text":"pub fn contracttype(metadata: TokenStream, input: TokenStream) -> TokenStream {","highlight_start":1,"highlight_end":78}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[{"message":"the following other types implement trait `From<T>`:\n <soroban_sdk::xdr::ScVal as From<bool>>\n <soroban_sdk::xdr::ScVal as From<i32>>\n <soroban_sdk::xdr::ScVal as From<i64>>\n <soroban_sdk::xdr::ScVal as From<i128>>\n <soroban_sdk::xdr::ScVal as From<u32>>\n <soroban_sdk::xdr::ScVal as From<u64>>\n <soroban_sdk::xdr::ScVal as From<u128>>\n <soroban_sdk::xdr::ScVal as From<soroban_env_common::object::ScValObject>>\nand 16 others","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"required for `soroban_sdk::String` to implement `Into<soroban_sdk::xdr::ScVal>`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required for `soroban_sdk::xdr::ScVal` to implement `From<&core::option::Option<soroban_sdk::String>>`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"1 redundant requirement hidden","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required for `&core::option::Option<soroban_sdk::String>` to implement `Into<soroban_sdk::xdr::ScVal>`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required for `soroban_sdk::xdr::ScVal` to implement `TryFrom<&core::option::Option<soroban_sdk::String>>`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required for `&core::option::Option<soroban_sdk::String>` to implement `TryInto<soroban_sdk::xdr::ScVal>`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;9merror[E0277]\u001b[0m\u001b[0m\u001b[1m: the trait bound `soroban_sdk::xdr::ScVal: From<soroban_sdk::String>` is not satisfied\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0mescrow/src/lib.rs:17:1\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m17\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m#[contracttype]\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9m^^^^^^^^^^^^^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9mthe trait `From<soroban_sdk::String>` is not implemented for `soroban_sdk::xdr::ScVal`, which is required by `&core::option::Option<soroban_sdk::String>: TryInto<_>`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mhelp\u001b[0m\u001b[0m: the following other types implement trait `From<T>`:\u001b[0m\n\u001b[0m <soroban_sdk::xdr::ScVal as From<bool>>\u001b[0m\n\u001b[0m <soroban_sdk::xdr::ScVal as From<i32>>\u001b[0m\n\u001b[0m <soroban_sdk::xdr::ScVal as From<i64>>\u001b[0m\n\u001b[0m <soroban_sdk::xdr::ScVal as From<i128>>\u001b[0m\n\u001b[0m <soroban_sdk::xdr::ScVal as From<u32>>\u001b[0m\n\u001b[0m <soroban_sdk::xdr::ScVal as From<u64>>\u001b[0m\n\u001b[0m <soroban_sdk::xdr::ScVal as From<u128>>\u001b[0m\n\u001b[0m <soroban_sdk::xdr::ScVal as From<soroban_env_common::object::ScValObject>>\u001b[0m\n\u001b[0m and 16 others\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mnote\u001b[0m\u001b[0m: required for `soroban_sdk::String` to implement `Into<soroban_sdk::xdr::ScVal>`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mnote\u001b[0m\u001b[0m: required for `soroban_sdk::xdr::ScVal` to implement `From<&core::option::Option<soroban_sdk::String>>`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mnote\u001b[0m\u001b[0m: 1 redundant requirement hidden\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mnote\u001b[0m\u001b[0m: required for `&core::option::Option<soroban_sdk::String>` to implement `Into<soroban_sdk::xdr::ScVal>`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mnote\u001b[0m\u001b[0m: required for `soroban_sdk::xdr::ScVal` to implement `TryFrom<&core::option::Option<soroban_sdk::String>>`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mnote\u001b[0m\u001b[0m: required for `&core::option::Option<soroban_sdk::String>` to implement `TryInto<soroban_sdk::xdr::ScVal>`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mnote\u001b[0m\u001b[0m: this error originates in the attribute macro `contracttype` (in Nightly builds, run with -Z macro-backtrace for more info)\u001b[0m\n\n"}
{"$message_type":"diagnostic","message":"failed to resolve: use of undeclared crate or module `__Escrow_fn_set_registry`","code":{"code":"E0433","explanation":"An undeclared crate, module, or type was used.\n\nErroneous code example:\n\n```compile_fail,E0433\nlet map = HashMap::new();\n// error: failed to resolve: use of undeclared type `HashMap`\n```\n\nPlease verify you didn't misspell the type/module's name or that you didn't\nforget to import it:\n\n```\nuse std::collections::HashMap; // HashMap has been imported.\nlet map: HashMap<u32, u32> = HashMap::new(); // So it can be used!\n```\n\nIf you've expected to use a crate name:\n\n```compile_fail\nuse ferris_wheel::BigO;\n// error: failed to resolve: use of undeclared crate or module `ferris_wheel`\n```\n\nMake sure the crate has been added as a dependency in `Cargo.toml`.\n\nTo use a module from your current crate, add the `crate::` prefix to the path.\n"},"level":"error","spans":[{"file_name":"escrow/src/lib.rs","byte_start":736,"byte_end":751,"line_start":41,"line_end":41,"column_start":1,"column_end":16,"is_primary":true,"text":[{"text":"#[contractimpl]","highlight_start":1,"highlight_end":16}],"label":"use of undeclared crate or module `__Escrow_fn_set_registry`","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"escrow/src/lib.rs","byte_start":736,"byte_end":751,"line_start":41,"line_end":41,"column_start":1,"column_end":16,"is_primary":false,"text":[{"text":"#[contractimpl]","highlight_start":1,"highlight_end":16}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"#[contractimpl]","def_site_span":{"file_name":"/Users/emirhancavusoglu/.cargo/registry/src/index.crates.io-6f17d22bba15001f/soroban-sdk-macros-20.5.0/src/lib.rs","byte_start":5863,"byte_end":5940,"line_start":197,"line_end":197,"column_start":1,"column_end":78,"is_primary":false,"text":[{"text":"pub fn contractimpl(metadata: TokenStream, input: TokenStream) -> TokenStream {","highlight_start":1,"highlight_end":78}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}}}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;9merror[E0433]\u001b[0m\u001b[0m\u001b[1m: failed to resolve: use of undeclared crate or module `__Escrow_fn_set_registry`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0mescrow/src/lib.rs:41:1\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m41\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m#[contractimpl]\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9m^^^^^^^^^^^^^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9muse of undeclared crate or module `__Escrow_fn_set_registry`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mnote\u001b[0m\u001b[0m: this error originates in the attribute macro `contractimpl` (in Nightly builds, run with -Z macro-backtrace for more info)\u001b[0m\n\n"}
{"$message_type":"diagnostic","message":"aborting due to 3 previous errors; 1 warning emitted","code":null,"level":"error","spans":[],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;9merror\u001b[0m\u001b[0m\u001b[1m: aborting due to 3 previous errors; 1 warning emitted\u001b[0m\n\n"}
{"$message_type":"diagnostic","message":"Some errors have detailed explanations: E0277, E0412, E0433.","code":null,"level":"failure-note","spans":[],"children":[],"rendered":"\u001b[0m\u001b[1mSome errors have detailed explanations: E0277, E0412, E0433.\u001b[0m\n"}
{"$message_type":"diagnostic","message":"For more information about an error, try `rustc --explain E0277`.","code":null,"level":"failure-note","spans":[],"children":[],"rendered":"\u001b[0m\u001b[1mFor more information about an error, try `rustc --explain E0277`.\u001b[0m\n"}