Browse Source

Move helper functions back to VM

cl-refactor
Paweł Bylica 10 years ago
parent
commit
72552c4936
  1. 7
      libevm/VM.h
  2. 15
      libevm/VMFace.h

7
libevm/VM.h

@ -38,6 +38,13 @@ namespace eth
class VMFactory;
// Convert from a 256-bit integer stack/memory entry into a 160-bit Address hash.
// Currently we just pull out the right (low-order in BE) 160-bits.
inline Address asAddress(u256 _item)
{
return right160(h256(_item));
}
inline u256 fromAddress(Address _a)
{
return (u160)_a;

15
libevm/VMFace.h

@ -34,21 +34,6 @@ struct BadJumpDestination: virtual VMException {};
struct OutOfGas: virtual VMException {};
struct StackTooSmall: virtual public VMException {};
// Convert from a 256-bit integer stack/memory entry into a 160-bit Address hash.
// Currently we just pull out the right (low-order in BE) 160-bits.
inline Address asAddress(u256 _item)
{
return right160(h256(_item));
}
inline u256 fromAddress(Address _a)
{
return (u160)_a;
// h256 ret;
// memcpy(&ret, &_a, sizeof(_a));
// return ret;
}
/**
*/
class VMFace

Loading…
Cancel
Save