-
Notifications
You must be signed in to change notification settings - Fork 251
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: use
insta
crate for testing macro generated code (#1090)
- Loading branch information
Showing
48 changed files
with
1,149 additions
and
944 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
near-sdk-macros/src/core_impl/abi/snapshots/generate_abi_callback_args.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
source: near-sdk-macros/src/core_impl/abi/abi_generator.rs | ||
expression: pretty_print_fn_body_syn_str(actual) | ||
--- | ||
::near_sdk::__private::AbiFunction { | ||
name: ::std::string::String::from("method"), | ||
doc: ::std::option::Option::None, | ||
kind: ::near_sdk::__private::AbiFunctionKind::View, | ||
modifiers: ::std::vec![], | ||
params: ::near_sdk::__private::AbiParameters::Borsh { | ||
args: ::std::vec![ | ||
::near_sdk::__private::AbiBorshParameter { name : | ||
::std::string::String::from("y"), type_schema : < String as | ||
::near_sdk::borsh::BorshSchema > ::schema_container(), } | ||
], | ||
}, | ||
callbacks: ::std::vec![ | ||
::near_sdk::__private::AbiType::Borsh { type_schema : < u64 as | ||
::near_sdk::borsh::BorshSchema > ::schema_container(), }, | ||
::near_sdk::__private::AbiType::Json { type_schema : gen.subschema_for:: < | ||
Vec < u8 > > (), } | ||
], | ||
callbacks_vec: ::std::option::Option::None, | ||
result: ::std::option::Option::None, | ||
} | ||
|
23 changes: 23 additions & 0 deletions
23
near-sdk-macros/src/core_impl/abi/snapshots/generate_abi_fallible_borsh.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
source: near-sdk-macros/src/core_impl/abi/abi_generator.rs | ||
expression: pretty_print_fn_body_syn_str(actual) | ||
--- | ||
::near_sdk::__private::AbiFunction { | ||
name: ::std::string::String::from("f3"), | ||
doc: ::std::option::Option::None, | ||
kind: ::near_sdk::__private::AbiFunctionKind::Call, | ||
modifiers: ::std::vec![::near_sdk::__private::AbiFunctionModifier::Payable], | ||
params: ::near_sdk::__private::AbiParameters::Borsh { | ||
args: ::std::vec![ | ||
::near_sdk::__private::AbiBorshParameter { name : | ||
::std::string::String::from("arg0"), type_schema : < FancyStruct as | ||
::near_sdk::borsh::BorshSchema > ::schema_container(), } | ||
], | ||
}, | ||
callbacks: ::std::vec![], | ||
callbacks_vec: ::std::option::Option::None, | ||
result: ::std::option::Option::Some(::near_sdk::__private::AbiType::Borsh { | ||
type_schema: <IsOk as ::near_sdk::borsh::BorshSchema>::schema_container(), | ||
}), | ||
} | ||
|
27 changes: 27 additions & 0 deletions
27
near-sdk-macros/src/core_impl/abi/snapshots/generate_abi_fallible_json.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
source: near-sdk-macros/src/core_impl/abi/abi_generator.rs | ||
expression: pretty_print_fn_body_syn_str(actual) | ||
--- | ||
::near_sdk::__private::AbiFunction { | ||
name: ::std::string::String::from("f3"), | ||
doc: ::std::option::Option::Some( | ||
::std::string::String::from(" I am a function."), | ||
), | ||
kind: ::near_sdk::__private::AbiFunctionKind::Call, | ||
modifiers: ::std::vec![], | ||
params: ::near_sdk::__private::AbiParameters::Json { | ||
args: ::std::vec![ | ||
::near_sdk::__private::AbiJsonParameter { name : | ||
::std::string::String::from("arg0"), type_schema : gen.subschema_for:: < | ||
FancyStruct > (), }, ::near_sdk::__private::AbiJsonParameter { name : | ||
::std::string::String::from("arg1"), type_schema : gen.subschema_for:: < | ||
u64 > (), } | ||
], | ||
}, | ||
callbacks: ::std::vec![], | ||
callbacks_vec: ::std::option::Option::None, | ||
result: ::std::option::Option::Some(::near_sdk::__private::AbiType::Json { | ||
type_schema: gen.subschema_for::<IsOk>(), | ||
}), | ||
} | ||
|
17 changes: 17 additions & 0 deletions
17
near-sdk-macros/src/core_impl/abi/snapshots/generate_abi_init_ignore_state.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
source: near-sdk-macros/src/core_impl/abi/abi_generator.rs | ||
expression: pretty_print_fn_body_syn_str(actual) | ||
--- | ||
::near_sdk::__private::AbiFunction { | ||
name: ::std::string::String::from("new"), | ||
doc: ::std::option::Option::None, | ||
kind: ::near_sdk::__private::AbiFunctionKind::Call, | ||
modifiers: ::std::vec![::near_sdk::__private::AbiFunctionModifier::Init], | ||
params: ::near_sdk::__private::AbiParameters::Json { | ||
args: ::std::vec![], | ||
}, | ||
callbacks: ::std::vec![], | ||
callbacks_vec: ::std::option::Option::None, | ||
result: ::std::option::Option::None, | ||
} | ||
|
17 changes: 17 additions & 0 deletions
17
near-sdk-macros/src/core_impl/abi/snapshots/generate_abi_no_return.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
source: near-sdk-macros/src/core_impl/abi/abi_generator.rs | ||
expression: pretty_print_fn_body_syn_str(actual) | ||
--- | ||
::near_sdk::__private::AbiFunction { | ||
name: ::std::string::String::from("method"), | ||
doc: ::std::option::Option::None, | ||
kind: ::near_sdk::__private::AbiFunctionKind::View, | ||
modifiers: ::std::vec![], | ||
params: ::near_sdk::__private::AbiParameters::Json { | ||
args: ::std::vec![], | ||
}, | ||
callbacks: ::std::vec![], | ||
callbacks_vec: ::std::option::Option::None, | ||
result: ::std::option::Option::None, | ||
} | ||
|
21 changes: 21 additions & 0 deletions
21
near-sdk-macros/src/core_impl/abi/snapshots/generate_abi_private_callback_vec.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
source: near-sdk-macros/src/core_impl/abi/abi_generator.rs | ||
expression: pretty_print_fn_body_syn_str(actual) | ||
--- | ||
::near_sdk::__private::AbiFunction { | ||
name: ::std::string::String::from("method"), | ||
doc: ::std::option::Option::None, | ||
kind: ::near_sdk::__private::AbiFunctionKind::View, | ||
modifiers: ::std::vec![::near_sdk::__private::AbiFunctionModifier::Private], | ||
params: ::near_sdk::__private::AbiParameters::Json { | ||
args: ::std::vec![], | ||
}, | ||
callbacks: ::std::vec![], | ||
callbacks_vec: ::std::option::Option::Some(::near_sdk::__private::AbiType::Json { | ||
type_schema: gen.subschema_for::<String>(), | ||
}), | ||
result: ::std::option::Option::Some(::near_sdk::__private::AbiType::Json { | ||
type_schema: gen.subschema_for::<bool>(), | ||
}), | ||
} | ||
|
Oops, something went wrong.