Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
luyu-chain33-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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
luyu-chain33-plugin
Commits
405086bf
Commit
405086bf
authored
Feb 09, 2022
by
suyanlong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add format off
parent
99337f45
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
20 deletions
+7
-20
ClassTransferUtil.scala
src/main/scala/com/chain33/util/ClassTransferUtil.scala
+1
-0
ContractUtil.scala
src/main/scala/com/chain33/util/ContractUtil.scala
+6
-20
No files found.
src/main/scala/com/chain33/util/ClassTransferUtil.scala
View file @
405086bf
...
...
@@ -6,6 +6,7 @@ import com.citahub.cita.abi.datatypes.DynamicArray
import
com.citahub.cita.abi.datatypes.Uint
import
com.citahub.cita.abi.datatypes.generated._
// format: off
object
ClassTransferUtil
{
val
typeMap
=
Map
{
...
...
src/main/scala/com/chain33/util/ContractUtil.scala
View file @
405086bf
...
...
@@ -22,31 +22,17 @@ import com.chain33.constant._
import
scala.collection.convert.ImplicitConversions.
`set asScala`
import
scala.collection.convert.ImplicitConversions.
`seq AsJavaList`
// format: off
object
ContractUtil
{
private
val
LEFT_RIGHT_BRACKETS
=
"[]"
private
val
CLASS_MAP
:
ConcurrentMap
[
String
,
java.lang.Class
[
_
]]
=
Maps
.
newConcurrentMap
()
private
val
typeVec
=
Array
{
(
(
param
:
ContractParam
)
=>
ContractType
.
BOOL
.
equalsIgnoreCase
(
param
.
`type`
),
(
param
:
ContractParam
)
=>
new
Bool
(
Boolean
.
unbox
(
param
.
value
))
)
(
(
param
:
ContractParam
)
=>
param
.
`type`
.
contains
(
ContractType
.
UINT
)
&&
!
param
.
`type`
.
contains
(
LEFT_RIGHT_BRACKETS
),
(
param
:
ContractParam
)
=>
reflectUintWithValue
(
param
.
`type`
,
param
.
value
)
)
(
(
param
:
ContractParam
)
=>
param
.
`type`
.
contains
(
ContractType
.
BYTES
)
&&
!
param
.
`type`
.
contains
(
LEFT_RIGHT_BRACKETS
),
(
param
:
ContractParam
)
=>
reflectBytesWithValue
(
param
.
`type`
,
param
.
value
)
)
(
(
param
:
ContractParam
)
=>
ContractType
.
ADDRESS
.
equalsIgnoreCase
(
param
.
`type`
),
(
param
:
ContractParam
)
=>
new
Address
(
param
.
value
)
)
(
(
param
:
ContractParam
)
=>
ContractType
.
STRING
.
equalsIgnoreCase
(
param
.
`type`
),
(
param
:
ContractParam
)
=>
new
Utf8String
(
param
.
value
)
)
((
param
:
ContractParam
)
=>
ContractType
.
BOOL
.
equalsIgnoreCase
(
param
.
`type`
),
(
param
:
ContractParam
)
=>
new
Bool
(
Boolean
.
unbox
(
param
.
value
)))
((
param
:
ContractParam
)
=>
param
.
`type`
.
contains
(
ContractType
.
UINT
)
&&
!
param
.
`type`
.
contains
(
LEFT_RIGHT_BRACKETS
),
(
param
:
ContractParam
)
=>
reflectUintWithValue
(
param
.
`type`
,
param
.
value
))
((
param
:
ContractParam
)
=>
param
.
`type`
.
contains
(
ContractType
.
BYTES
)
&&
!
param
.
`type`
.
contains
(
LEFT_RIGHT_BRACKETS
),
(
param
:
ContractParam
)
=>
reflectBytesWithValue
(
param
.
`type`
,
param
.
value
))
((
param
:
ContractParam
)
=>
ContractType
.
ADDRESS
.
equalsIgnoreCase
(
param
.
`type`
),
(
param
:
ContractParam
)
=>
new
Address
(
param
.
value
))
((
param
:
ContractParam
)
=>
ContractType
.
STRING
.
equalsIgnoreCase
(
param
.
`type`
),
(
param
:
ContractParam
)
=>
new
Utf8String
(
param
.
value
))
(
(
param
:
ContractParam
)
=>
param
.
`type`
.
contains
(
ContractType
.
UINT
)
&&
param
.
`type`
.
contains
(
LEFT_RIGHT_BRACKETS
),
(
param
:
ContractParam
)
=>
{
...
...
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