-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Closed
Description
The following example
contract;
use std::hash::*;
abi MyContract {
fn test() -> bool;
}
struct SentinelTransaction {
to: b256,
value: b256,
data: b256,
executed: b256,
approvals: b256,
}
storage {
sentinel: SentinelTransaction,
}
impl MyContract for Contract {
fn test() -> bool {
storage.sentinel = SentinelTransaction {
to: hash_u64(1, HashMethod::Sha256),
value: hash_u64(2, HashMethod::Sha256),
data: hash_u64(3, HashMethod::Sha256),
executed: hash_u64(4, HashMethod::Sha256),
approvals: hash_u64(5, HashMethod::Sha256)
};
true
}
}
formats into
contract;
use std::hash::*;
abi MyContract {
fn test() -> bool;
}
struct SentinelTransaction {
to: b256,
value: b256,
data: b256,
executed: b256,
approvals: b256,
}
storage {
sentinel: SentinelTransaction,
}
impl MyContract for Contract {
fn test() -> bool {
storage.sentinel = SentinelTransaction {
to: hash_u64(1, HashMethod::Sha256), value: hash_u64(2, HashMethod::Sha256), data: hash_u64(3, HashMethod::Sha256), executed: hash_u64(4, HashMethod::Sha256), approvals: hash_u64(5, HashMethod::Sha256)
};
true
}
}
Preferably it will remain the same as in the "before".
Related: #1210
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done