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
c829d3a3
Commit
c829d3a3
authored
Oct 27, 2021
by
George Hotz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more minimal failing case
parent
facbd5cd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
11 deletions
+5
-11
mips_test_memory.js
test/mips_test_memory.js
+5
-11
No files found.
test/mips_test_memory.js
View file @
c829d3a3
const
{
expect
}
=
require
(
"
chai
"
);
const
{
expect
}
=
require
(
"
chai
"
);
const
trieAdd
=
{
"
root
"
:
"
0x22ffce7c56d926c2d8d6337d8917fa0e1880e1869e189c15385ead63c6c45b93
"
,
"
preimages
"
:{
"
0x044371dc86fb8c621bc84b69dce16de366de1126777250888b17416d0bd11279
"
:
"
+FPGIIQ8EL//xiCENhD/8MYghDQRAAHGIIQ8CP//xiCENQj//cYghDQJAAPGIIQBCVAgxiCELUIAAcYghK4CAAjGIISuEQAExiCEA+AACICAgICAgA==
"
,
"
0x0fdfcc24b1b21d78ef2b7c6503eb9354677743685c2d00a14a8b502a177911b0
"
:
"
+HGgL4Jb+u0gEWM4e9G4lO/GsyUEY/heVoGOAfiI04qPXfSgLCZprT7WBOLipiwJxxI0vy09rw9iPR+x0p/Xz1p3X5WgaNY/x30waJPsd6PWg76b094l8vUmmL6XB1XdUFy+xfWAgICAgICAgICAgICAgA==
"
,
"
0x11228d4f4a028a9088e6ec0aa6513e0d4731d9dc488e2af1957e46ba80624a69
"
:
"
5oQAAAAAoARDcdyG+4xiG8hLadzhbeNm3hEmd3JQiIsXQW0L0RJ5
"
,
"
0x22ffce7c56d926c2d8d6337d8917fa0e1880e1869e189c15385ead63c6c45b93
"
:
"
+FGgESKNT0oCipCI5uwKplE+DUcx2dxIjirxlX5GuoBiSmmAgKBv5gezlmGtxjQAs8Du76D93mAxExw5qWgAZjJQp1xmfICAgICAgICAgICAgIA=
"
,
"
0x2c2669ad3ed604e2e2a62c09c71234bf2d3daf0f623d1fb1d29fd7cf5a775f95
"
:
"
+HHGIIQAAAAAxiCEAAAAAMYghAAAAADGIIQAAAAAxiCEAAAAAMYghAAAAADGIIQAAAAAxiCEAAAAAMYghAAAAADGIIQAAAAAxiCEAAAAAMYghAAAAADGIIQAAAAAxiCEAAAAAMYghAAAAADGIIRerQAAgA==
"
,
"
0x2f825bfaed201163387bd1b894efc6b3250463f85e56818e01f888d38a8f5df4
"
:
"
+HHGIIQAAAAAxiCEAAAAAMYghAAAAADGIIQAAAAAxiCEAAAAAMYghAAAAADGIIQAAAAAxiCEAAAAAMYghAAAAADGIIQAAAAAxiCEAAAAAMYghAAAAADGIIQAAAAAxiCEAAAAAMYghAAAAADGIIQAAAAAgA==
"
,
"
0x68d63fc77d306893ec77a3d683be9bd3de25f2f52698be970755dd505cbec5f5
"
:
"
6cYghAAAAADGIIQAAAAAxiCEAAAAAMYghAAAAACAgICAgICAgICAgICA
"
,
"
0x6fe607b39661adc63400b3c0eeefa0fdde6031131c39a96800663250a75c667c
"
:
"
5YMQAACgD9/MJLGyHXjvK3xlA+uTVGd3Q2hcLQChSotQKhd5EbA=
"
}};
async
function
write
(
mm
,
root
,
addr
,
data
)
{
async
function
write
(
mm
,
root
,
addr
,
data
)
{
ret
=
await
mm
.
WriteMemoryWithReceipt
(
root
,
addr
,
data
)
ret
=
await
mm
.
WriteMemoryWithReceipt
(
root
,
addr
,
data
)
const
receipt
=
await
ret
.
wait
()
const
receipt
=
await
ret
.
wait
()
...
@@ -27,15 +25,11 @@ describe("MIPSMemory contract", function () {
...
@@ -27,15 +25,11 @@ describe("MIPSMemory contract", function () {
root
=
await
write
(
mm
,
root
,
4
,
0
)
root
=
await
write
(
mm
,
root
,
4
,
0
)
})
})
it
(
"
write three should work
"
,
async
function
()
{
it
(
"
write three should work
"
,
async
function
()
{
for
(
k
in
trieAdd
[
'
preimages
'
])
{
await
mm
.
AddTrieNode
(
new
Uint8Array
([
0x80
]))
const
bin
=
Uint8Array
.
from
(
Buffer
.
from
(
trieAdd
[
'
preimages
'
][
k
],
'
base64
'
).
toString
(
'
binary
'
),
c
=>
c
.
charCodeAt
(
0
))
let
root
=
"
0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421
"
await
mm
.
AddTrieNode
(
bin
)
}
let
root
=
trieAdd
[
'
root
'
]
root
=
await
write
(
mm
,
root
,
0x
7fffd010
,
100
0
)
root
=
await
write
(
mm
,
root
,
0x
44
,
0
)
root
=
await
write
(
mm
,
root
,
0x
7fffd00c
,
6
)
root
=
await
write
(
mm
,
root
,
0x
40
,
0
)
root
=
await
write
(
mm
,
root
,
0x
7fffc000
,
0x85a24
)
root
=
await
write
(
mm
,
root
,
0x
0
,
0
)
})
})
})
})
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