Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
burrow
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hang Yu
burrow
Commits
ab577828
Commit
ab577828
authored
8 years ago
by
Ethan Buchman
Browse files
Options
Downloads
Patches
Plain Diff
dear go, plz dont let ptr/non-ptr receivers satisfy one interface. thx
parent
acde9cd0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tmsp/erisdb.go
+8
-4
8 additions, 4 deletions
tmsp/erisdb.go
with
8 additions
and
4 deletions
tmsp/erisdb.go
+
8
−
4
View file @
ab577828
...
...
@@ -97,7 +97,8 @@ func (app *ErisDBApp) SetOption(key string, value string) (log string) {
}
// Implements tmsp.Application
func
(
app
ErisDBApp
)
AppendTx
(
txBytes
[]
byte
)
(
res
tmsp
.
Result
)
{
func
(
app
*
ErisDBApp
)
AppendTx
(
txBytes
[]
byte
)
(
res
tmsp
.
Result
)
{
app
.
nTxs
+=
1
// XXX: if we had tx ids we could cache the decoded txs on CheckTx
...
...
@@ -110,15 +111,17 @@ func (app ErisDBApp) AppendTx(txBytes []byte) (res tmsp.Result) {
return
tmsp
.
NewError
(
tmsp
.
CodeType_EncodingError
,
fmt
.
Sprintf
(
"Encoding error: %v"
,
err
))
}
log
.
Info
(
"AppendTx"
,
"tx"
,
*
tx
)
err
=
sm
.
ExecTx
(
app
.
cache
,
*
tx
,
true
,
app
.
evc
)
if
err
!=
nil
{
return
tmsp
.
NewError
(
tmsp
.
CodeType_InternalError
,
fmt
.
Sprintf
(
"
Encoding
error: %v"
,
err
))
return
tmsp
.
NewError
(
tmsp
.
CodeType_InternalError
,
fmt
.
Sprintf
(
"
Internal
error: %v"
,
err
))
}
return
tmsp
.
NewResultOK
(
nil
,
"Success"
)
}
// Implements tmsp.Application
func
(
app
ErisDBApp
)
CheckTx
(
txBytes
[]
byte
)
(
res
tmsp
.
Result
)
{
func
(
app
*
ErisDBApp
)
CheckTx
(
txBytes
[]
byte
)
(
res
tmsp
.
Result
)
{
var
n
int
var
err
error
tx
:=
new
(
types
.
Tx
)
...
...
@@ -128,7 +131,7 @@ func (app ErisDBApp) CheckTx(txBytes []byte) (res tmsp.Result) {
return
tmsp
.
NewError
(
tmsp
.
CodeType_EncodingError
,
fmt
.
Sprintf
(
"Encoding error: %v"
,
err
))
}
log
.
Info
(
"CheckTx"
,
"tx"
,
tx
)
log
.
Info
(
"CheckTx"
,
"tx"
,
*
tx
)
// TODO: make errors tmsp aware
err
=
sm
.
ExecTx
(
app
.
checkCache
,
*
tx
,
false
,
nil
)
...
...
@@ -156,6 +159,7 @@ func (app *ErisDBApp) Commit() (res tmsp.Result) {
// if there were any txs in the block,
// reset the check cache to the new height
if
app
.
nTxs
>
0
{
log
.
Info
(
"Reset checkCache"
,
"txs"
,
app
.
nTxs
)
app
.
checkCache
=
sm
.
NewBlockCache
(
app
.
state
)
}
app
.
nTxs
=
0
...
...
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