Commit e816460f authored by Mark Tyneway's avatar Mark Tyneway

mipsevm: run gofmt

parent c6d34ab5
...@@ -133,9 +133,9 @@ func (s *StateDB) GetState(fakeaddr common.Address, hash common.Hash) common.Has ...@@ -133,9 +133,9 @@ func (s *StateDB) GetState(fakeaddr common.Address, hash common.Hash) common.Has
} }
key := fmt.Sprintf("%s/%s", s.root, hash) key := fmt.Sprintf("%s/%s", s.root, hash)
value, err := ioutil.ReadFile(key) value, err := ioutil.ReadFile(key)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
WriteRam(ram, 0x31000000, uint32(len(value))) WriteRam(ram, 0x31000000, uint32(len(value)))
value = append(value, 0, 0, 0) value = append(value, 0, 0, 0)
......
...@@ -84,7 +84,7 @@ func GetHookedUnicorn(root string, ram map[uint32](uint32), callback func(int, u ...@@ -84,7 +84,7 @@ func GetHookedUnicorn(root string, ram map[uint32](uint32), callback func(int, u
hash := common.BytesToHash(oracle_hash) hash := common.BytesToHash(oracle_hash)
key := fmt.Sprintf("%s/%s", root, hash) key := fmt.Sprintf("%s/%s", root, hash)
value, err := ioutil.ReadFile(key) value, err := ioutil.ReadFile(key)
check(err) check(err)
tmp := []byte{0, 0, 0, 0} tmp := []byte{0, 0, 0, 0}
binary.BigEndian.PutUint32(tmp, uint32(len(value))) binary.BigEndian.PutUint32(tmp, uint32(len(value)))
...@@ -181,7 +181,7 @@ func RunUnicorn(fn string, ram map[uint32](uint32), checkIO bool, callback func( ...@@ -181,7 +181,7 @@ func RunUnicorn(fn string, ram map[uint32](uint32), checkIO bool, callback func(
// inputs // inputs
inputs, err := ioutil.ReadFile(fmt.Sprintf("%s/input", root)) inputs, err := ioutil.ReadFile(fmt.Sprintf("%s/input", root))
check(err) check(err)
mu.MemWrite(0x30000000, inputs[0:0xc0]) mu.MemWrite(0x30000000, inputs[0:0xc0])
...@@ -195,7 +195,7 @@ func RunUnicorn(fn string, ram map[uint32](uint32), checkIO bool, callback func( ...@@ -195,7 +195,7 @@ func RunUnicorn(fn string, ram map[uint32](uint32), checkIO bool, callback func(
if checkIO { if checkIO {
outputs, err := ioutil.ReadFile(fmt.Sprintf("%s/output", root)) outputs, err := ioutil.ReadFile(fmt.Sprintf("%s/output", root))
check(err) check(err)
real := append([]byte{0x13, 0x37, 0xf0, 0x0d}, outputs...) real := append([]byte{0x13, 0x37, 0xf0, 0x0d}, outputs...)
output, _ := mu.MemRead(0x30000800, 0x44) output, _ := mu.MemRead(0x30000800, 0x44)
if bytes.Compare(real, output) != 0 { if bytes.Compare(real, output) != 0 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment