Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions forc-plugins/forc-client/tests/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ async fn test_simple_deploy() {
node.kill().unwrap();
let expected = vec![DeployedPackage::Contract(DeployedContract {
id: ContractId::from_str(
"677a9eefe864cde328b1f6e58a0d9829fc3b683fca48e36e9bcb4863179ae174",
"307a59fbb6888da41942653ca21d9c71e06d72edb58b8d775eea87c7e755ebdb",
)
.unwrap(),
proxy: None,
Expand Down Expand Up @@ -421,7 +421,7 @@ async fn test_deploy_submit_only() {
node.kill().unwrap();
let expected = vec![DeployedPackage::Contract(DeployedContract {
id: ContractId::from_str(
"677a9eefe864cde328b1f6e58a0d9829fc3b683fca48e36e9bcb4863179ae174",
"307a59fbb6888da41942653ca21d9c71e06d72edb58b8d775eea87c7e755ebdb",
)
.unwrap(),
proxy: None,
Expand Down Expand Up @@ -468,12 +468,12 @@ async fn test_deploy_fresh_proxy() {
node.kill().unwrap();
let impl_contract = DeployedPackage::Contract(DeployedContract {
id: ContractId::from_str(
"677a9eefe864cde328b1f6e58a0d9829fc3b683fca48e36e9bcb4863179ae174",
"307a59fbb6888da41942653ca21d9c71e06d72edb58b8d775eea87c7e755ebdb",
)
.unwrap(),
proxy: Some(
ContractId::from_str(
"fedbb732b17cf256aa378584438a154d11d413d5cfbdeca63a00128530aa0ebb",
"70a447780b00c9725859bbef1cd327a9455cc62fbe607a0524b2c82a5846f5a9",
)
.unwrap(),
),
Expand Down
6 changes: 3 additions & 3 deletions sway-lib-std/src/storage/storage_api.sw
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
library;

use ::alloc::alloc;
use ::alloc::alloc_bytes;
use ::option::Option::{self, *};
use ::ops::*;
use ::primitive_conversions::{b256::*, u256::*, u64::*};
Expand Down Expand Up @@ -52,7 +52,7 @@ pub fn write<T>(slot: b256, offset: u64, value: T) {

// Allocate enough memory on the heap for `value` as well as any potential padding required due
// to `offset`.
let padded_value = alloc::<u64>(number_of_slots * 32);
let padded_value = alloc_bytes(number_of_slots * 32);

// Read the values that currently exist in the affected storage slots.
let _ = __state_load_quad(offset_slot, padded_value, number_of_slots);
Expand Down Expand Up @@ -105,7 +105,7 @@ pub fn read<T>(slot: b256, offset: u64) -> Option<T> {

// Allocate a buffer for the result. Its size needs to be a multiple of 32 bytes so we can
// make the 'quad' storage instruction read without overflowing.
let result_ptr = alloc::<u64>(number_of_slots * 32);
let result_ptr = alloc_bytes(number_of_slots * 32);

// Read `number_of_slots * 32` bytes starting at storage slot `slot` and return an `Option`
// wrapping the value stored at `result_ptr + offset` if all the slots are valid. Otherwise,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use basic_storage_abi::{BasicStorage, Quad};
#[cfg(experimental_new_encoding = false)]
const CONTRACT_ID = 0x94db39f409a31b9f2ebcadeea44378e419208c20de90f5d8e1e33dc1523754cb;
#[cfg(experimental_new_encoding = true)]
const CONTRACT_ID = 0x49d9bdf1aaba3772e9dd2f87c970bcab4d3e5b8a15d03267e5697312e4bfbf01; // AUTO-CONTRACT-ID ../../test_contracts/basic_storage --release
const CONTRACT_ID = 0x5b200b16a332ccf2be472f4e027c587bdbe9504618d88c97b5f151c9b84a6763; // AUTO-CONTRACT-ID ../../test_contracts/basic_storage --release

fn main() -> u64 {
let addr = abi(BasicStorage, CONTRACT_ID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use dynamic_contract_call::*;
#[cfg(experimental_new_encoding = false)]
const CONTRACT_ID = 0xd1b4047af7ef111c023ab71069e01dc2abfde487c0a0ce1268e4f447e6c6e4c2;
#[cfg(experimental_new_encoding = true)]
const CONTRACT_ID = 0xbf495d4b4a2ee955073433b736a44e445b280cb0a7113408d1441515510b52aa; // AUTO-CONTRACT-ID ../../test_contracts/increment_contract --release
const CONTRACT_ID = 0x2831f6a4598517a3e1de7ee8430b3e232d3b480c26cd2f36bea7e2838732c313; // AUTO-CONTRACT-ID ../../test_contracts/increment_contract --release

fn main() -> bool {
let the_abi = abi(Incrementor, CONTRACT_ID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use storage_enum_abi::*;
#[cfg(experimental_new_encoding = false)]
const CONTRACT_ID = 0xc601d11767195485a6654d566c67774134668863d8c797a8c69e8778fb1f89e9;
#[cfg(experimental_new_encoding = true)]
const CONTRACT_ID = 0x49753ced6c53395e8506fd429a397e644adb08db5d436def77231256630e94b6; // AUTO-CONTRACT-ID ../../test_contracts/storage_enum_contract --release
const CONTRACT_ID = 0x0b8fc40c515e04d925fde7200b42f1e86108b4227de412bf245be24bbe3e2d5f; // AUTO-CONTRACT-ID ../../test_contracts/storage_enum_contract --release

fn main() -> u64 {
let caller = abi(StorageEnum, CONTRACT_ID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::hash::*;
#[cfg(experimental_new_encoding = false)]
const CONTRACT_ID = 0x3bc28acd66d327b8c1b9624c1fabfc07e9ffa1b5d71c2832c3bfaaf8f4b805e9;
#[cfg(experimental_new_encoding = true)]
const CONTRACT_ID = 0x09055b9ec4efa2651fc5b753caf18a251af41f97ff25c60f8cc39ececa4a3364; // AUTO-CONTRACT-ID ../../test_contracts/storage_access_contract --release
const CONTRACT_ID = 0x5f28104f4eb74dff6b73fd0a66bcfdd89d608005abc4196c1ffb5bc54092afca; // AUTO-CONTRACT-ID ../../test_contracts/storage_access_contract --release

fn main() -> bool {
let caller = abi(StorageAccess, CONTRACT_ID);
Expand Down
Loading