good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
584f9be7
Commit
584f9be7
authored
Jan 1, 2014
by
Jeffrey Wilcke
Browse files
Options
Downloads
Patches
Plain Diff
Moved some testing code
parent
5da78427
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ethereum.go
+15
-27
15 additions, 27 deletions
ethereum.go
trie_test.go
+0
-18
0 additions, 18 deletions
trie_test.go
with
15 additions
and
45 deletions
ethereum.go
+
15
−
27
View file @
584f9be7
...
@@ -4,10 +4,18 @@ import (
...
@@ -4,10 +4,18 @@ import (
"fmt"
"fmt"
"os"
"os"
"os/signal"
"os/signal"
"flag"
)
)
const
Debug
=
true
const
Debug
=
true
var
StartDBQueryInterface
bool
func
Init
()
{
flag
.
BoolVar
(
&
StartDBQueryInterface
,
"db"
,
false
,
"start db query interface"
)
flag
.
Parse
()
}
// Register interrupt handlers so we can stop the server
// Register interrupt handlers so we can stop the server
func
RegisterInterupts
(
s
*
Server
)
{
func
RegisterInterupts
(
s
*
Server
)
{
// Buffered chan of one is enough
// Buffered chan of one is enough
...
@@ -26,32 +34,12 @@ func RegisterInterupts(s *Server) {
...
@@ -26,32 +34,12 @@ func RegisterInterupts(s *Server) {
func
main
()
{
func
main
()
{
InitFees
()
InitFees
()
bm
:=
NewBlockManager
()
Init
()
tx
:=
NewTransaction
(
"
\x00
"
,
20
,
[]
string
{
"SET 10 6"
,
"LD 10 10"
,
"LT 10 1 20"
,
"SET 255 7"
,
"JMPI 20 255"
,
"STOP"
,
"SET 30 200"
,
"LD 30 31"
,
"SET 255 22"
,
"JMPI 31 255"
,
"SET 255 15"
,
"JMP 255"
,
})
txData
:=
tx
.
MarshalRlp
()
copyTx
:=
&
Transaction
{}
copyTx
.
UnmarshalRlp
(
txData
)
tx2
:=
NewTransaction
(
"
\x00
"
,
20
,
[]
string
{
"SET 10 6"
,
"LD 10 10"
})
if
StartDBQueryInterface
{
dbInterface
:=
NewDBInterface
()
blck
:=
CreateBlock
([]
*
Transaction
{
tx2
,
tx
})
dbInterface
.
Start
()
}
else
{
bm
.
ProcessBlock
(
blck
)
Testing
()
}
fmt
.
Println
(
"GenesisBlock:"
,
GenisisBlock
,
"hashed"
,
GenisisBlock
.
Hash
())
}
}
This diff is collapsed.
Click to expand it.
trie_test.go
+
0
−
18
View file @
584f9be7
...
@@ -5,24 +5,6 @@ import (
...
@@ -5,24 +5,6 @@ import (
"encoding/hex"
"encoding/hex"
)
)
type
MemDatabase
struct
{
db
map
[
string
][]
byte
}
func
NewMemDatabase
()
(
*
MemDatabase
,
error
)
{
db
:=
&
MemDatabase
{
db
:
make
(
map
[
string
][]
byte
)}
return
db
,
nil
}
func
(
db
*
MemDatabase
)
Put
(
key
[]
byte
,
value
[]
byte
)
{
db
.
db
[
string
(
key
)]
=
value
}
func
(
db
*
MemDatabase
)
Get
(
key
[]
byte
)
([]
byte
,
error
)
{
return
db
.
db
[
string
(
key
)],
nil
}
func
TestTriePut
(
t
*
testing
.
T
)
{
func
TestTriePut
(
t
*
testing
.
T
)
{
db
,
err
:=
NewMemDatabase
()
db
,
err
:=
NewMemDatabase
()
trie
:=
NewTrie
(
db
,
""
)
trie
:=
NewTrie
(
db
,
""
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment