forked from cerc-io/laconicd-deprecated
evm: fix non-determinism (#352)
* evm: fix non-determinism * fixes * typo * fix tests * use Storage slice * more fixes * lint * merge development * additional tests
This commit is contained in:
+3
-31
@@ -1,40 +1,12 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
ethcmn "github.com/ethereum/go-ethereum/common"
|
||||
)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Code & Storage
|
||||
// Code
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
type (
|
||||
// Code is account Code type alias
|
||||
Code []byte
|
||||
// Storage is account storage type alias
|
||||
Storage map[ethcmn.Hash]ethcmn.Hash
|
||||
)
|
||||
// Code is account Code type alias
|
||||
type Code []byte
|
||||
|
||||
func (c Code) String() string {
|
||||
return string(c)
|
||||
}
|
||||
|
||||
func (c Storage) String() (str string) {
|
||||
for key, value := range c {
|
||||
str += fmt.Sprintf("%X : %X\n", key, value)
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// Copy returns a copy of storage.
|
||||
func (c Storage) Copy() Storage {
|
||||
cpy := make(Storage)
|
||||
for key, value := range c {
|
||||
cpy[key] = value
|
||||
}
|
||||
|
||||
return cpy
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user