clean up
This commit is contained in:
parent
3502632909
commit
e80b5b80ef
|
@ -20,17 +20,10 @@ library Mappings {
|
|||
mapping(ValueId => Value) _values;
|
||||
}
|
||||
struct Key {
|
||||
string name;
|
||||
bool delux;
|
||||
uint price;
|
||||
|
||||
EnumerableSetExtensions.ClearableBytes32Set _values;
|
||||
}
|
||||
struct Value {
|
||||
string name;
|
||||
bool delux;
|
||||
uint price;
|
||||
|
||||
struct Value {
|
||||
KeyId _keyId;
|
||||
}
|
||||
|
||||
|
@ -118,10 +111,9 @@ library Mappings {
|
|||
success = insertKey(map, key);
|
||||
assert (success); // key insertion failure
|
||||
}
|
||||
map._valueIds.add(ValueId.unwrap(value));
|
||||
map._values[value]._keyId = key;
|
||||
|
||||
success = map._keys[key]._values.add(ValueId.unwrap(value));
|
||||
if (!exists(map, key, value)) {
|
||||
success = insertValue(map, key, value);
|
||||
}
|
||||
}
|
||||
|
||||
function deleteKey(Mapping storage map, KeyId key)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import "./libs/Mappings.sol";
|
||||
import "./Mappings.sol";
|
||||
|
||||
// exposes public functions for testing
|
||||
contract TestMappings {
|
Loading…
Reference in New Issue