11use cargo_near_build:: BuildOpts ;
22use lazy_static:: lazy_static;
3- use near_sdk:: base64:: prelude:: BASE64_STANDARD ;
4- use near_sdk:: base64:: { engine:: general_purpose, Engine as _} ;
3+ use near_sdk:: base64:: { engine:: general_purpose:: STANDARD as BASE64_STANDARD , Engine as _} ;
54use near_sdk:: serde:: Deserialize ;
65use near_sdk:: { AccountId , NearToken } ;
76use near_workspaces:: types:: AccessKeyPermission ;
@@ -39,7 +38,7 @@ fn create_preload_result(
3938) -> serde_json:: Value {
4039 let preload_url = format ! (
4140 "/web4/contract/social.near/get?keys.json=%5B%22{}/widget/app/metadata/**%22%5D" ,
42- account_id. as_str ( )
41+ account_id
4342 ) ;
4443 let body_string = serde_json:: json!( { account_id: { "widget" : { "app" : { "metadata" : {
4544 "description" : description,
@@ -50,10 +49,10 @@ fn create_preload_result(
5049
5150 let body_base64 = BASE64_STANDARD . encode ( body_string) ;
5251 return serde_json:: json!( {
53- String :: from ( preload_url) : {
54- "contentType" : "application/json" ,
55- "body" : body_base64
56- }
52+ preload_url: {
53+ "contentType" : "application/json" ,
54+ "body" : body_base64
55+ }
5756 } ) ;
5857}
5958
@@ -100,8 +99,7 @@ async fn test_web4() -> Result<(), Box<dyn std::error::Error>> {
10099 let response = result. json :: < Web4Response > ( ) . unwrap ( ) ;
101100 assert_eq ! ( "text/html; charset=UTF-8" , response. content_type) ;
102101
103- let body_string =
104- String :: from_utf8 ( general_purpose:: STANDARD . decode ( response. body ) . unwrap ( ) ) . unwrap ( ) ;
102+ let body_string = String :: from_utf8 ( BASE64_STANDARD . decode ( response. body ) . unwrap ( ) ) . unwrap ( ) ;
105103 assert ! ( body_string. contains( "near-social-viewer" ) ) ;
106104
107105 Ok ( ( ) )
@@ -325,7 +323,7 @@ async fn test_factory() -> Result<(), Box<dyn std::error::Error>> {
325323 "social_db_account_id" : SOCIALDB_ACCOUNT ,
326324 "widget_reference_account_id" : WIDGET_REFERENCE_ACCOUNT_ID ,
327325 "name" : instance_name,
328- "create_dao_args" : general_purpose :: STANDARD . encode( create_dao_args. to_string( ) )
326+ "create_dao_args" : BASE64_STANDARD . encode( create_dao_args. to_string( ) )
329327 }
330328 ) )
331329 . max_gas ( )
@@ -394,8 +392,7 @@ async fn test_factory() -> Result<(), Box<dyn std::error::Error>> {
394392 let response = result. json :: < Web4Response > ( ) . unwrap ( ) ;
395393 assert_eq ! ( "text/html; charset=UTF-8" , response. content_type) ;
396394
397- let body_string =
398- String :: from_utf8 ( general_purpose:: STANDARD . decode ( response. body ) . unwrap ( ) ) . unwrap ( ) ;
395+ let body_string = String :: from_utf8 ( BASE64_STANDARD . decode ( response. body ) . unwrap ( ) ) . unwrap ( ) ;
399396
400397 assert ! ( body_string. contains( "near-social-viewer" ) ) ;
401398 assert ! ( body_string. contains( "\" test treasury title\" " ) ) ;
@@ -494,14 +491,14 @@ async fn test_factory() -> Result<(), Box<dyn std::error::Error>> {
494491 let social_metadata_json: Value =
495492 Value :: from_str ( String :: from_utf8 ( social_metadata. result ) . unwrap ( ) . as_str ( ) ) . unwrap ( ) ;
496493 let metadata = & social_metadata_json[ instance_account_id. clone ( ) ] [ "widget" ] [ "app" ] [ "metadata" ] ;
497- assert_eq ! ( metadata[ "name" ] , "NEAR treasury " ) ;
494+ assert_eq ! ( metadata[ "name" ] , "NEAR Treasury " ) ;
498495 assert_eq ! (
499496 metadata[ "description" ] ,
500- format!( "NEAR treasury for {}" , instance_account_id)
497+ format!( "NEAR Treasury / {}" , instance_account_id)
501498 ) ;
502499 assert_eq ! (
503500 metadata[ "image" ] [ "ipfs_cid" ] ,
504- "bafkreiboarigt5w26y5jyxyl4au7r2dl76o5lrm2jqjgqpooakck5xsojq "
501+ "bafkreiefdkigadpkpccreqfnhut2li2nmf3alhz7c3wadveconelisnksu "
505502 ) ;
506503
507504 Ok ( ( ) )
@@ -680,7 +677,7 @@ async fn test_factory_should_refund_if_failing_because_of_existing_account(
680677 "social_db_account_id" : SOCIALDB_ACCOUNT ,
681678 "widget_reference_account_id" : WIDGET_REFERENCE_ACCOUNT_ID ,
682679 "name" : instance_name,
683- "create_dao_args" : general_purpose :: STANDARD . encode( create_dao_args. to_string( ) )
680+ "create_dao_args" : BASE64_STANDARD . encode( create_dao_args. to_string( ) )
684681 }
685682 ) )
686683 . max_gas ( )
@@ -893,7 +890,7 @@ async fn test_factory_should_refund_if_failing_because_of_existing_dao(
893890 "social_db_account_id" : SOCIALDB_ACCOUNT ,
894891 "widget_reference_account_id" : WIDGET_REFERENCE_ACCOUNT_ID ,
895892 "name" : instance_name,
896- "create_dao_args" : general_purpose :: STANDARD . encode( create_dao_args. to_string( ) )
893+ "create_dao_args" : BASE64_STANDARD . encode( create_dao_args. to_string( ) )
897894 }
898895 ) )
899896 . max_gas ( )
0 commit comments