Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
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
link33
plugin
Commits
842dff87
Commit
842dff87
authored
Jan 30, 2019
by
Hugo
Committed by
vipwzw
Jan 30, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix gosec problem in oracle module
parent
6e50f002
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
238 additions
and
50 deletions
+238
-50
oracle.go
plugin/dapp/oracle/commands/oracle.go
+215
-43
oracledb.go
plugin/dapp/oracle/executor/oracledb.go
+23
-7
No files found.
plugin/dapp/oracle/commands/oracle.go
View file @
842dff87
This diff is collapsed.
Click to expand it.
plugin/dapp/oracle/executor/oracledb.go
View file @
842dff87
...
...
@@ -7,6 +7,7 @@
package
executor
import
(
"fmt"
"github.com/33cn/chain33/common/db/table"
"github.com/33cn/chain33/common"
...
...
@@ -50,11 +51,16 @@ func (o *OracleDB) GetKVSet() (kvset []*types.KeyValue) {
}
// Save for OracleDB
func
(
o
*
OracleDB
)
save
(
db
dbm
.
KV
)
{
func
(
o
*
OracleDB
)
save
(
db
dbm
.
KV
)
error
{
set
:=
o
.
GetKVSet
()
for
i
:=
0
;
i
<
len
(
set
);
i
++
{
db
.
Set
(
set
[
i
]
.
GetKey
(),
set
[
i
]
.
Value
)
err
:=
db
.
Set
(
set
[
i
]
.
GetKey
(),
set
[
i
]
.
Value
)
if
err
!=
nil
{
fmt
.
Printf
(
"oracledb save failed:[%v]-%v"
,
i
,
err
)
return
err
}
}
return
nil
}
// Key for oracle
...
...
@@ -105,7 +111,9 @@ func (action *oracleAction) eventPublish(event *oty.EventPublish) (*types.Receip
eventStatus
:=
NewOracleDB
(
eventID
,
action
.
fromaddr
,
event
.
Type
,
event
.
SubType
,
event
.
Content
,
event
.
Introduction
,
event
.
Time
,
action
.
GetIndex
())
olog
.
Debug
(
"eventPublish"
,
"PublisherAddr"
,
eventStatus
.
Addr
,
"EventID"
,
eventStatus
.
EventID
,
"Event"
,
eventStatus
.
Content
)
eventStatus
.
save
(
action
.
db
)
if
err
:=
eventStatus
.
save
(
action
.
db
);
err
!=
nil
{
return
nil
,
err
}
kv
=
append
(
kv
,
eventStatus
.
GetKVSet
()
...
)
receiptLog
:=
action
.
getOracleCommonRecipt
(
&
eventStatus
.
OracleStatus
,
oty
.
TyLogEventPublish
)
...
...
@@ -140,7 +148,9 @@ func (action *oracleAction) eventAbort(event *oty.EventAbort) (*types.Receipt, e
updateStatus
(
ora
,
action
.
GetIndex
(),
action
.
fromaddr
,
oty
.
EventAborted
)
ora
.
save
(
action
.
db
)
if
err
:=
ora
.
save
(
action
.
db
);
err
!=
nil
{
return
nil
,
err
}
kv
=
append
(
kv
,
ora
.
GetKVSet
()
...
)
receiptLog
:=
action
.
getOracleCommonRecipt
(
&
ora
.
OracleStatus
,
oty
.
TyLogEventAbort
)
...
...
@@ -177,7 +187,9 @@ func (action *oracleAction) resultPrePublish(event *oty.ResultPrePublish) (*type
ora
.
Result
=
event
.
Result
ora
.
Source
=
event
.
Source
ora
.
save
(
action
.
db
)
if
err
:=
ora
.
save
(
action
.
db
);
err
!=
nil
{
return
nil
,
err
}
kv
=
append
(
kv
,
ora
.
GetKVSet
()
...
)
receiptLog
:=
action
.
getOracleCommonRecipt
(
&
ora
.
OracleStatus
,
oty
.
TyLogResultPrePublish
)
...
...
@@ -214,7 +226,9 @@ func (action *oracleAction) resultAbort(event *oty.ResultAbort) (*types.Receipt,
ora
.
Result
=
""
ora
.
Source
=
""
ora
.
save
(
action
.
db
)
if
err
:=
ora
.
save
(
action
.
db
);
err
!=
nil
{
return
nil
,
err
}
kv
=
append
(
kv
,
ora
.
GetKVSet
()
...
)
receiptLog
:=
action
.
getOracleCommonRecipt
(
&
ora
.
OracleStatus
,
oty
.
TyLogResultAbort
)
...
...
@@ -251,7 +265,9 @@ func (action *oracleAction) resultPublish(event *oty.ResultPublish) (*types.Rece
ora
.
Result
=
event
.
Result
ora
.
Source
=
event
.
Source
ora
.
save
(
action
.
db
)
if
err
:=
ora
.
save
(
action
.
db
);
err
!=
nil
{
return
nil
,
err
}
kv
=
append
(
kv
,
ora
.
GetKVSet
()
...
)
receiptLog
:=
action
.
getOracleCommonRecipt
(
&
ora
.
OracleStatus
,
oty
.
TyLogResultPublish
)
...
...
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