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
7c69d530
Commit
7c69d530
authored
Oct 27, 2021
by
George Hotz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
second broken trie test
parent
3a6ed525
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
6 deletions
+12
-6
mips_test_memory.js
test/mips_test_memory.js
+12
-3
mips_test_trie.js
test/mips_test_trie.js
+0
-3
No files found.
test/mips_test_memory.js
View file @
7c69d530
...
...
@@ -15,18 +15,27 @@ async function write(mm, root, addr, data) {
}
describe
(
"
MIPSMemory contract
"
,
function
()
{
it
(
"
reads and write should work
"
,
async
function
()
{
beforeEach
(
async
function
()
{
const
MIPSMemory
=
await
ethers
.
getContractFactory
(
"
MIPSMemory
"
)
const
mm
=
await
MIPSMemory
.
deploy
()
mm
=
await
MIPSMemory
.
deploy
()
})
it
(
"
write from new should work
"
,
async
function
()
{
await
mm
.
AddTrieNode
(
new
Uint8Array
([
0x80
]))
let
root
=
"
0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421
"
root
=
await
write
(
mm
,
root
,
0
,
0
)
root
=
await
write
(
mm
,
root
,
4
,
0
)
})
it
(
"
write three should work
"
,
async
function
()
{
for
(
k
in
trieAdd
[
'
preimages
'
])
{
const
bin
=
Uint8Array
.
from
(
Buffer
.
from
(
trieAdd
[
'
preimages
'
][
k
],
'
base64
'
).
toString
(
'
binary
'
),
c
=>
c
.
charCodeAt
(
0
))
await
mm
.
AddTrieNode
(
bin
)
}
let
root
=
trieAdd
[
'
root
'
]
root
=
await
write
(
mm
,
root
,
0x7fffd010
,
1000
)
root
=
await
write
(
mm
,
root
,
0x7fffd00c
,
6
)
root
=
await
write
(
mm
,
root
,
0x7fffc
ffc
,
0x85a24
)
root
=
await
write
(
mm
,
root
,
0x7fffc
000
,
0x85a24
)
})
})
test/mips_test_trie.js
View file @
7c69d530
...
...
@@ -26,7 +26,4 @@ describe("MIPS contract", function () {
console
.
log
(
i
,
root
)
}
});
it
(
"
reads and write should work
"
,
async
function
()
{
const
mm
=
await
ethers
.
getContractFactory
(
"
MIPSMemory
"
)
})
});
\ No newline at end of file
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