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
1403b9bf
Commit
1403b9bf
authored
Dec 10, 2019
by
vipwzw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto ci
parent
3c9a08ca
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
5 deletions
+10
-5
exchange.go
plugin/dapp/exchange/executor/exchange.go
+0
-0
exchangedb.go
plugin/dapp/exchange/executor/exchangedb.go
+2
-1
kv.go
plugin/dapp/exchange/executor/kv.go
+1
-0
exchange.pb.go
plugin/dapp/exchange/types/exchange.pb.go
+7
-4
No files found.
plugin/dapp/exchange/executor/exchange.go
View file @
1403b9bf
plugin/dapp/exchange/executor/exchangedb.go
View file @
1403b9bf
...
@@ -2,6 +2,8 @@ package executor
...
@@ -2,6 +2,8 @@ package executor
import
(
import
(
"fmt"
"fmt"
"math"
"github.com/33cn/chain33/account"
"github.com/33cn/chain33/account"
"github.com/33cn/chain33/client"
"github.com/33cn/chain33/client"
"github.com/33cn/chain33/common"
"github.com/33cn/chain33/common"
...
@@ -10,7 +12,6 @@ import (
...
@@ -10,7 +12,6 @@ import (
"github.com/33cn/chain33/types"
"github.com/33cn/chain33/types"
et
"github.com/33cn/plugin/plugin/dapp/exchange/types"
et
"github.com/33cn/plugin/plugin/dapp/exchange/types"
"github.com/gogo/protobuf/proto"
"github.com/gogo/protobuf/proto"
"math"
)
)
// Action action struct
// Action action struct
...
...
plugin/dapp/exchange/executor/kv.go
View file @
1403b9bf
...
@@ -67,6 +67,7 @@ func calcUserOrderIDPrefix(status int32, addr string) []byte {
...
@@ -67,6 +67,7 @@ func calcUserOrderIDPrefix(status int32, addr string) []byte {
key
:=
fmt
.
Sprintf
(
"%s"
+
"addr:%s:%d:"
,
KeyPrefixLocalDB
,
addr
,
status
)
key
:=
fmt
.
Sprintf
(
"%s"
+
"addr:%s:%d:"
,
KeyPrefixLocalDB
,
addr
,
status
)
return
[]
byte
(
key
)
return
[]
byte
(
key
)
}
}
//matchOrderIndex,用来解决同一笔交易中存在key重复得情况,这样设计保证了key得唯一性
//matchOrderIndex,用来解决同一笔交易中存在key重复得情况,这样设计保证了key得唯一性
func
calcUserOrderIDKey
(
status
int32
,
addr
string
,
index
int64
)
[]
byte
{
func
calcUserOrderIDKey
(
status
int32
,
addr
string
,
index
int64
)
[]
byte
{
key
:=
fmt
.
Sprintf
(
"%s"
+
"addr:%s:%d:%022d"
,
KeyPrefixLocalDB
,
addr
,
status
,
index
)
key
:=
fmt
.
Sprintf
(
"%s"
+
"addr:%s:%d:%022d"
,
KeyPrefixLocalDB
,
addr
,
status
,
index
)
...
...
plugin/dapp/exchange/types/exchange.pb.go
View file @
1403b9bf
...
@@ -28,12 +28,15 @@ It has these top-level messages:
...
@@ -28,12 +28,15 @@ It has these top-level messages:
*/
*/
package
types
package
types
import
proto
"github.com/golang/protobuf/proto"
import
fmt
"fmt"
import
math
"math"
import
(
import
(
fmt
"fmt"
proto
"github.com/golang/protobuf/proto"
math
"math"
context
"golang.org/x/net/context"
context
"golang.org/x/net/context"
grpc
"google.golang.org/grpc"
grpc
"google.golang.org/grpc"
)
)
...
...
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