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
385a47f1
Commit
385a47f1
authored
Dec 10, 2021
by
suyanlong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update function
parent
b159df6b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
14 deletions
+43
-14
Builder.scala
src/main/scala/com/chain33/builder/Builder.scala
+10
-3
Connection.scala
src/main/scala/com/chain33/connection/Connection.scala
+22
-5
Driver.scala
src/main/scala/com/chain33/driver/Driver.scala
+11
-6
No files found.
src/main/scala/com/chain33/builder/Builder.scala
View file @
385a47f1
...
@@ -3,11 +3,18 @@ package com.chain33.builder
...
@@ -3,11 +3,18 @@ package com.chain33.builder
import
link.luyu.protocol.link._
import
link.luyu.protocol.link._
import
java.util
import
java.util
import
com.chain33.driver
import
com.chain33.connection
@LuyuPlugin
(
"chain33"
)
class
Builder
extends
PluginBuilder
{
class
Builder
extends
PluginBuilder
{
override
def
newConnection
(
properties
:
util.Map
[
String
,
AnyRef
])
:
Connection
=
???
override
def
newConnection
(
properties
:
util.Map
[
String
,
AnyRef
])
:
Connection
=
{
// TODO
override
def
newDriver
(
connection
:
Connection
,
properties
:
util.Map
[
String
,
AnyRef
])
:
Driver
=
???
val
url
=
properties
.
get
(
"chainUrl"
).
toString
new
connection
.
Connection
(
url
)
}
override
def
newDriver
(
connection
:
Connection
,
properties
:
util.Map
[
String
,
AnyRef
])
:
Driver
=
driver
.
Driver
(
connection
)
}
}
src/main/scala/com/chain33/connection/Connection.scala
View file @
385a47f1
package
com.chain33.connection
package
com.chain33.connection
import
link.luyu.protocol.link
import
link.luyu.protocol.link
import
cn.chain33.javasdk.client._
class
Connection
extends
link
.
Connection
{
import
com.chain33.constant.Constant._
override
def
start
()
:
Unit
=
???
override
def
stop
()
:
Unit
=
???
class
Connection
(
val
url
:
String
)
extends
link
.
Connection
{
private
var
client
=
new
RpcClient
(
url
)
client
.
setUrl
(
url
)
override
def
start
()
:
Unit
=
{}
override
def
stop
()
:
Unit
=
{}
override
def
asyncSend
(
override
def
asyncSend
(
path
:
String
,
path
:
String
,
...
@@ -14,6 +20,17 @@ class Connection extends link.Connection {
...
@@ -14,6 +20,17 @@ class Connection extends link.Connection {
callback
:
link.Connection.Callback
callback
:
link.Connection.Callback
)
:
Unit
=
???
)
:
Unit
=
???
override
def
subscribe
(
`type`
:
Int
,
data
:
Array
[
Byte
],
callback
:
link.Connection.Callback
)
:
Unit
=
override
def
subscribe
(
???
`type`
:
Int
,
data
:
Array
[
Byte
],
callback
:
link.Connection.Callback
)
:
Unit
=
{
`type`
match
{
case
Event
.
EVENT_NEW_BLOCK
=>
case
Event
.
EVENT_RESOURCES_CHANGED
=>
case
_
=>
}
}
}
}
src/main/scala/com/chain33/driver/Driver.scala
View file @
385a47f1
package
com.chain33.driver
package
com.chain33.driver
import
com.fasterxml.jackson.databind.ObjectMapper
import
link.luyu.protocol.link.
{
Driver
=>
BaseDriver
,
_
}
import
link.luyu.protocol.link.
{
Driver
=>
BaseDriver
,
_
}
import
link.luyu.protocol.network.
{
Account
,
CallRequest
,
Events
,
Transaction
}
import
link.luyu.protocol.network.
{
Account
,
CallRequest
,
Events
,
Transaction
}
c
lass
Driver
extends
BaseDriver
{
c
ase
class
Driver
(
val
connection
:
Connection
)
extends
BaseDriver
{
override
def
start
()
:
Unit
=
???
override
def
start
()
:
Unit
=
{}
override
def
stop
()
:
Unit
=
???
override
def
stop
()
:
Unit
=
{}
override
def
getType
:
String
=
???
override
def
getType
:
String
=
"chain33"
override
def
listResources
(
callback
:
BaseDriver.ResourcesCallback
)
:
Unit
=
???
override
def
listResources
(
callback
:
BaseDriver.ResourcesCallback
)
:
Unit
=
???
override
def
registerEvents
(
events
:
Events
)
:
Unit
=
???
override
def
registerEvents
(
events
:
Events
)
:
Unit
=
{}
override
def
call
(
override
def
call
(
account
:
Account
,
account
:
Account
,
...
@@ -20,7 +21,7 @@ class Driver extends BaseDriver {
...
@@ -20,7 +21,7 @@ class Driver extends BaseDriver {
callback
:
BaseDriver.CallResponseCallback
callback
:
BaseDriver.CallResponseCallback
)
:
Unit
=
???
)
:
Unit
=
???
override
def
getSignatureType
:
String
=
???
override
def
getSignatureType
:
String
=
"SM2_WITH_SM3"
override
def
getBlockByHash
(
blockHash
:
String
,
callback
:
BaseDriver.BlockCallback
)
:
Unit
=
???
override
def
getBlockByHash
(
blockHash
:
String
,
callback
:
BaseDriver.BlockCallback
)
:
Unit
=
???
...
@@ -37,3 +38,7 @@ class Driver extends BaseDriver {
...
@@ -37,3 +38,7 @@ class Driver extends BaseDriver {
callback
:
BaseDriver.ReceiptCallback
callback
:
BaseDriver.ReceiptCallback
)
:
Unit
=
???
)
:
Unit
=
???
}
}
object
Driver
{
private
val
objectMapper
=
new
ObjectMapper
}
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