git ssb

0+

wanderer🌟 / js-primea-hypervisor



Commit 218378ee81f2cf20c03ed1333553072db9dd4205

le -> be in U256

wanderer committed on 11/11/2016, 9:26:39 PM
Parent: dad20bcd931c58c818df618d3d2a5807bdea36f8

Files changed

EVMinterface.jschanged
deps/u256.jschanged
EVMinterface.jsView
@@ -426,9 +426,9 @@
426426 */
427427 _call (gasHigh, gasLow, addressOffset, valueOffset, dataOffset, dataLength, resultOffset, resultLength) {
428428 const gas = from64bit(gasHigh, gasLow)
429429 // Load the params from mem
430- const address = Address.fromMemory(this.getMemory(addressOffset, ADDRESS_SIZE_BYTES))
430+ const address = [...this.getMemory(addressOffset, ADDRESS_SIZE_BYTES)]
431431 const value = U256.fromMemory(this.getMemory(valueOffset, U128_SIZE_BYTES))
432432
433433 this.takeGas(40)
434434
@@ -516,9 +516,9 @@
516516 // FIXME: count properly
517517 this.takeGas(40)
518518
519519 const data = this.getMemory(dataOffset, dataLength).slice(0)
520- const address = Address.fromMemory(this.getMemory(addressOffset, ADDRESS_SIZE_BYTES))
520+ const address = [...this.getMemory(addressOffset, ADDRESS_SIZE_BYTES)]
521521 const [errorCode, result] = this.environment.callDelegate(gas, address, data)
522522 this.setMemory(resultOffset, resultLength, result)
523523 return errorCode
524524 }
deps/u256.jsView
@@ -12,14 +12,14 @@
1212 }
1313
1414 // This assumes Uint8Array in LSB (WASM code)
1515 static fromMemory (value) {
16- return new U256(new BN(value, 16, 'le'))
16+ return new U256(new BN(value, 16, 'be'))
1717 }
1818
1919 // This assumes Uint8Array in LSB (WASM code)
2020 toMemory (width) {
21- return this._value.toBuffer('le', width || 32)
21+ return this._value.toBuffer('be', width || 32)
2222 }
2323
2424 toString (radix = 10) {
2525 if (radix === 16) {

Built with git-ssb-web