Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
5244cf21
Commit
5244cf21
authored
Oct 16, 2021
by
George Hotz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove atob, make test fail
parent
1b3bc386
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
MIPS.sol
contracts/MIPS.sol
+3
-1
mips_test_trie.js
test/mips_test_trie.js
+1
-1
No files found.
contracts/MIPS.sol
View file @
5244cf21
...
...
@@ -43,7 +43,9 @@ contract MIPS {
function WriteMemory(bytes32 stateHash, uint32 addr, uint32 value) internal returns (bytes32) {
if (address(m) != address(0)) {
emit DidWriteMemory(addr, value);
return m.WriteMemory(stateHash, addr, value);
bytes32 newStateHash = m.WriteMemory(stateHash, addr, value);
require(ReadMemory(newStateHash, addr) == value, "memory readback check failed");
return newStateHash;
} else {
assembly {
// TODO: this is actually doing an SLOAD first
...
...
test/mips_test_trie.js
View file @
5244cf21
...
...
@@ -9,7 +9,7 @@ describe("MIPS contract", function () {
const
mm
=
await
ethers
.
getContractAt
(
"
MIPSMemory
"
,
await
m
.
m
())
for
(
k
in
trieAdd
[
'
preimages
'
])
{
const
bin
=
Uint8Array
.
from
(
atob
(
trieAdd
[
'
preimages
'
][
k
]
),
c
=>
c
.
charCodeAt
(
0
))
const
bin
=
Uint8Array
.
from
(
Buffer
.
from
(
trieAdd
[
'
preimages
'
][
k
],
'
base64
'
).
toString
(
'
binary
'
),
c
=>
c
.
charCodeAt
(
0
))
await
mm
.
AddTrieNode
(
bin
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment