From 0648533bf50c0b5ae1787e5ae3c2941f2556a581 Mon Sep 17 00:00:00 2001 From: beer-1 <147697694+beer-1@users.noreply.github.com> Date: Wed, 20 Mar 2024 14:24:25 +0900 Subject: [PATCH 1/2] fix oracle view function to use value not reference --- precompile/binaries/minlib/oracle.mv | Bin 217 -> 221 bytes .../modules/minitia_stdlib/sources/oracle.move | 8 ++++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/precompile/binaries/minlib/oracle.mv b/precompile/binaries/minlib/oracle.mv index 7274989f908a8bff263e9697546413f53e386556..500afac619a95d1abc8a9b630ef9593cb620c3d4 100644 GIT binary patch delta 58 zcmcb~c$aa42(K`^mIX(Wf): (u256, u64, u64); @@ -33,12 +33,12 @@ module minitia_std::oracle { set_price(&btc_usd_pair_id, btc_price, btc_updated_at, btc_decimals); set_price(ð_usd_pair_id, eth_price, eth_updated_at, eth_decimals); - let (price, updated_at, decimals) = get_price(&btc_usd_pair_id); + let (price, updated_at, decimals) = get_price(btc_usd_pair_id); assert!(btc_price == price, 0); assert!(btc_updated_at == updated_at, 0); assert!(btc_decimals == decimals, 0); - let (price, updated_at, decimals) = get_price(ð_usd_pair_id); + let (price, updated_at, decimals) = get_price(eth_usd_pair_id); assert!(eth_price == price, 0); assert!(eth_updated_at == updated_at, 0); assert!(eth_decimals == decimals, 0); From f61225c152f5fe71144bdf0bfc3bcea7ab1db982 Mon Sep 17 00:00:00 2001 From: beer-1 <147697694+beer-1@users.noreply.github.com> Date: Wed, 20 Mar 2024 14:42:20 +0900 Subject: [PATCH 2/2] fix compiler to report error at extended check --- crates/compiler/src/built_package.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/compiler/src/built_package.rs b/crates/compiler/src/built_package.rs index 58ab279f..b06d56a5 100644 --- a/crates/compiler/src/built_package.rs +++ b/crates/compiler/src/built_package.rs @@ -84,6 +84,7 @@ impl BuiltPackage { // Run extended checks as well derive runtime metadata let model = &model_opt.expect("move model"); + let runtime_metadata = extended_checks::run_extended_checks(model); if model.diag_count(Severity::Warning) > 0 { let mut error_writer = StandardStream::stderr(ColorChoice::Auto); model.report_diag(&mut error_writer, Severity::Warning); @@ -92,7 +93,6 @@ impl BuiltPackage { } } - let runtime_metadata = extended_checks::run_extended_checks(model); let compiled_pkg_path = package .compiled_package_info .build_flags