Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
process
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
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
exchain
process
Commits
eb086344
Commit
eb086344
authored
Apr 06, 2025
by
贾浩@五瓣科技
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
db3fa0df
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
586 additions
and
297 deletions
+586
-297
.gitignore
.gitignore
+1
-1
Makefile
Makefile
+1
-1
gateway.go
api/gateway/gateway.go
+168
-0
order_handler.go
api/handlers/order_handler.go
+0
-167
router.go
api/router/router.go
+0
-25
order.go
api/types/order.go
+15
-8
main.go
cmd/gateway/main.go
+12
-0
agent.go
engine/agent.go
+16
-1
engine.go
engine/engine.go
+19
-5
order.go
engine/order.go
+77
-11
process.go
engine/process.go
+101
-0
go.mod
go.mod
+28
-24
go.sum
go.sum
+117
-54
transaction.go
types/transaction.go
+19
-0
signature.go
utils/signature.go
+12
-0
No files found.
.gitignore
View file @
eb086344
.vscode
.vscode
.idea
.idea
build
build
\ No newline at end of file
Makefile
View file @
eb086344
...
@@ -5,4 +5,4 @@ GOBIN = $(shell pwd)/build
...
@@ -5,4 +5,4 @@ GOBIN = $(shell pwd)/build
default
:
api
default
:
api
api
:
api
:
go build
$(BUILD_FLAGS)
-v
-o
=
${
GOBIN
}
/
$@
./cmd/api
go build
$(BUILD_FLAGS)
-v
-o
=
${
GOBIN
}
/
$@
./cmd/gateway
\ No newline at end of file
\ No newline at end of file
api/gateway/gateway.go
0 → 100644
View file @
eb086344
package
apigateway
import
(
"context"
"encoding/json"
"fmt"
"math/big"
"net"
"net/http"
"strings"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log"
nebulav1
"github.com/exchain/go-exchain/exchain/protocol/gen/go/nebula/v1"
orderbookv1
"github.com/exchain/go-exchain/exchain/protocol/gen/go/orderbook/v1"
"github.com/exchain/process/engine"
"github.com/exchain/process/orderbook"
"github.com/exchain/process/types"
"github.com/exchain/process/utils"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/holiman/uint256"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)
type
server
struct
{
eg
*
engine
.
Engine
orderbookv1
.
UnimplementedOrderbookServer
}
func
(
s
*
server
)
PlaceLimitOrder
(
ctx
context
.
Context
,
req
*
orderbookv1
.
PlaceLimitOrderRequest
)
(
resp
*
orderbookv1
.
Response
,
err
error
)
{
resp
=
new
(
orderbookv1
.
Response
)
side
:=
orderbook
.
Buy
tx
:=
req
.
Transaction
.
Tx
.
(
*
nebulav1
.
Transaction_LimitTx
)
if
tx
.
LimitTx
.
Side
==
nebulav1
.
OrderSide_SELL
{
side
=
orderbook
.
Sell
}
coins
:=
strings
.
Split
(
tx
.
LimitTx
.
Pair
,
"-"
)
baseCoin
,
quoteCoin
:=
coins
[
0
],
coins
[
1
]
quantity
:=
new
(
uint256
.
Int
)
.
SetBytes
(
tx
.
LimitTx
.
Quantity
)
price
:=
new
(
uint256
.
Int
)
.
SetBytes
(
tx
.
LimitTx
.
Price
)
nonce
:=
new
(
big
.
Int
)
.
SetBytes
(
req
.
Transaction
.
Nonce
)
orderID
:=
utils
.
GenOrderID
()
_
,
res
,
err
:=
s
.
eg
.
ProcessLimitOrder
(
orderID
,
types
.
Coin
(
baseCoin
),
types
.
Coin
(
quoteCoin
),
common
.
HexToAddress
(
req
.
Transaction
.
User
),
side
,
price
,
quantity
,
uint64
(
nonce
.
Int64
()),
req
.
Transaction
.
Proxy
,
utils
.
CombineRSV
(
req
.
Transaction
.
Signature
.
R
,
req
.
Transaction
.
Signature
.
S
,
uint8
(
req
.
Transaction
.
Signature
.
V
)))
if
err
!=
nil
{
return
}
data
,
_
:=
json
.
Marshal
(
res
)
return
&
orderbookv1
.
Response
{
Data
:
data
},
nil
}
func
(
s
*
server
)
PlaceMarketOrder
(
ctx
context
.
Context
,
req
*
orderbookv1
.
PlaceMarketOrderRequest
)
(
resp
*
orderbookv1
.
Response
,
err
error
)
{
resp
=
new
(
orderbookv1
.
Response
)
side
:=
orderbook
.
Buy
tx
:=
req
.
Transaction
.
Tx
.
(
*
nebulav1
.
Transaction_MarketTx
)
if
tx
.
MarketTx
.
Side
==
nebulav1
.
OrderSide_SELL
{
side
=
orderbook
.
Sell
}
coins
:=
strings
.
Split
(
tx
.
MarketTx
.
Pair
,
"-"
)
baseCoin
,
quoteCoin
:=
coins
[
0
],
coins
[
1
]
quantity
:=
new
(
uint256
.
Int
)
.
SetBytes
(
tx
.
MarketTx
.
Quantity
)
nonce
:=
new
(
big
.
Int
)
.
SetBytes
(
req
.
Transaction
.
Nonce
)
orderID
:=
utils
.
GenOrderID
()
_
,
res
,
err
:=
s
.
eg
.
ProcessMarketOrder
(
orderID
,
types
.
Coin
(
baseCoin
),
types
.
Coin
(
quoteCoin
),
common
.
HexToAddress
(
req
.
Transaction
.
User
),
side
,
quantity
,
uint64
(
nonce
.
Int64
()),
req
.
Transaction
.
Proxy
,
utils
.
CombineRSV
(
req
.
Transaction
.
Signature
.
R
,
req
.
Transaction
.
Signature
.
S
,
uint8
(
req
.
Transaction
.
Signature
.
V
)))
if
err
!=
nil
{
return
}
data
,
_
:=
json
.
Marshal
(
res
)
return
&
orderbookv1
.
Response
{
Data
:
data
},
nil
}
func
(
s
*
server
)
CancelOrder
(
ctx
context
.
Context
,
req
*
orderbookv1
.
CancelOrderRequest
)
(
resp
*
orderbookv1
.
Response
,
err
error
)
{
tx
:=
req
.
Transaction
.
Tx
.
(
*
nebulav1
.
Transaction_CancelTx
)
orderID
:=
tx
.
CancelTx
.
OrderId
coins
:=
strings
.
Split
(
tx
.
CancelTx
.
Pair
,
"-"
)
baseCoin
,
quoteCoin
:=
coins
[
0
],
coins
[
1
]
nonce
:=
new
(
big
.
Int
)
.
SetBytes
(
req
.
Transaction
.
Nonce
)
err
=
s
.
eg
.
ProcessCancelOrder
(
orderID
,
types
.
Coin
(
baseCoin
),
types
.
Coin
(
quoteCoin
),
common
.
HexToAddress
(
req
.
Transaction
.
User
),
nonce
.
Uint64
(),
req
.
Transaction
.
Proxy
,
utils
.
CombineRSV
(
req
.
Transaction
.
Signature
.
R
,
req
.
Transaction
.
Signature
.
S
,
uint8
(
req
.
Transaction
.
Signature
.
V
)))
return
&
orderbookv1
.
Response
{},
err
}
func
(
s
*
server
)
SignProxy
(
ctx
context
.
Context
,
req
*
orderbookv1
.
SignProxyRequest
)
(
resp
*
orderbookv1
.
Response
,
err
error
)
{
tx
:=
req
.
Transaction
.
Tx
.
(
*
nebulav1
.
Transaction_SignProxyTx
)
nonce
:=
new
(
big
.
Int
)
.
SetBytes
(
req
.
Transaction
.
Nonce
)
pubkey
,
err
:=
crypto
.
UnmarshalPubkey
(
tx
.
SignProxyTx
.
SignerProxy
)
if
err
!=
nil
{
return
}
err
=
s
.
eg
.
PorcessSignProxy
(
common
.
HexToAddress
(
req
.
Transaction
.
User
),
crypto
.
PubkeyToAddress
(
*
pubkey
),
nonce
.
Uint64
(),
utils
.
CombineRSV
(
req
.
Transaction
.
Signature
.
R
,
req
.
Transaction
.
Signature
.
S
,
uint8
(
req
.
Transaction
.
Signature
.
V
)))
return
&
orderbookv1
.
Response
{},
err
}
func
StartServer
(
grpcPort
int
,
gwPort
int
,
eg
*
engine
.
Engine
)
error
{
defer
log
.
Info
(
"grpc and gateway server stopped"
)
log
.
Info
(
"starting grpc and gateway server"
,
"grpcPort"
,
grpcPort
,
"gwPort"
,
gwPort
)
ctx
:=
context
.
Background
()
ctx
,
cancel
:=
context
.
WithCancel
(
ctx
)
defer
cancel
()
gServer
:=
&
server
{
eg
:
eg
,
}
listener
,
err
:=
net
.
Listen
(
"tcp"
,
fmt
.
Sprintf
(
"0.0.0.0:%d"
,
grpcPort
))
if
err
!=
nil
{
log
.
Error
(
"failed to listen"
,
"err"
,
err
)
return
err
}
errCh
:=
make
(
chan
error
)
grpcServer
:=
grpc
.
NewServer
()
orderbookv1
.
RegisterOrderbookServer
(
grpcServer
,
gServer
)
go
func
(
ch
chan
error
)
{
var
e
=
grpcServer
.
Serve
(
listener
)
ch
<-
e
}(
errCh
)
mux
:=
runtime
.
NewServeMux
()
opts
:=
[]
grpc
.
DialOption
{
grpc
.
WithTransportCredentials
(
insecure
.
NewCredentials
())}
err
=
orderbookv1
.
RegisterOrderbookHandlerFromEndpoint
(
ctx
,
mux
,
fmt
.
Sprintf
(
"127.0.0.1:%d"
,
grpcPort
),
opts
)
if
err
!=
nil
{
return
err
}
go
func
(
ch
chan
error
)
{
var
e
=
http
.
ListenAndServe
(
fmt
.
Sprintf
(
"0.0.0.0:%d"
,
gwPort
),
mux
)
ch
<-
e
}(
errCh
)
e
:=
<-
errCh
return
e
}
api/handlers/order_handler.go
deleted
100644 → 0
View file @
db3fa0df
package
handlers
import
(
"net/http"
"github.com/ethereum/go-ethereum/common"
"github.com/holiman/uint256"
"github.com/gin-gonic/gin"
apiTypes
"github.com/exchain/process/api/types"
"github.com/exchain/process/engine"
"github.com/exchain/process/orderbook"
"github.com/exchain/process/types"
"github.com/exchain/process/utils"
)
type
OrderHandler
struct
{
eg
*
engine
.
Engine
}
func
NewOrderHandler
(
eg
*
engine
.
Engine
)
*
OrderHandler
{
return
&
OrderHandler
{
eg
:
eg
,
}
}
// PlaceLimitOrder 处理限价单请求
func
(
h
*
OrderHandler
)
PlaceLimitOrder
(
c
*
gin
.
Context
)
{
var
req
apiTypes
.
PlaceLimitOrderRequest
if
err
:=
c
.
ShouldBindJSON
(
&
req
);
err
!=
nil
{
c
.
JSON
(
http
.
StatusBadRequest
,
gin
.
H
{
"error"
:
err
.
Error
()})
return
}
ok
,
agent
:=
req
.
Recover
()
if
!
ok
{
c
.
JSON
(
http
.
StatusBadRequest
,
gin
.
H
{
"error"
:
"invalid signature"
})
return
}
side
:=
orderbook
.
Buy
if
req
.
Side
==
"sell"
{
side
=
orderbook
.
Sell
}
quantity
,
err
:=
uint256
.
FromDecimal
(
req
.
Quantity
)
if
err
!=
nil
{
c
.
JSON
(
http
.
StatusBadRequest
,
gin
.
H
{
"error"
:
"invalid quantity"
})
return
}
price
,
err
:=
uint256
.
FromDecimal
(
req
.
Price
)
if
err
!=
nil
{
c
.
JSON
(
http
.
StatusBadRequest
,
gin
.
H
{
"error"
:
"invalid price"
})
return
}
orderID
:=
utils
.
GenOrderID
()
_
,
resp
,
err
:=
h
.
eg
.
ProcessLimitOrder
(
orderID
,
types
.
Coin
(
req
.
BaseToken
),
types
.
Coin
(
req
.
QuoteToken
),
agent
,
side
,
price
,
quantity
,
req
.
Nonce
)
if
err
!=
nil
{
c
.
JSON
(
http
.
StatusBadRequest
,
gin
.
H
{
"error"
:
err
.
Error
()})
return
}
c
.
JSON
(
http
.
StatusOK
,
resp
)
}
// PlaceMarketOrder 处理市价单请求
func
(
h
*
OrderHandler
)
PlaceMarketOrder
(
c
*
gin
.
Context
)
{
var
req
apiTypes
.
PlaceMarketOrderRequest
if
err
:=
c
.
ShouldBindJSON
(
&
req
);
err
!=
nil
{
c
.
JSON
(
http
.
StatusBadRequest
,
gin
.
H
{
"error"
:
err
.
Error
()})
return
}
ok
,
agent
:=
req
.
Recover
()
if
!
ok
{
c
.
JSON
(
http
.
StatusBadRequest
,
gin
.
H
{
"error"
:
"invalid signature"
})
return
}
side
:=
orderbook
.
Sell
if
req
.
Side
==
"buy"
{
side
=
orderbook
.
Buy
}
quantity
,
err
:=
uint256
.
FromDecimal
(
req
.
Quantity
)
if
err
!=
nil
{
c
.
JSON
(
http
.
StatusBadRequest
,
gin
.
H
{
"error"
:
"invalid quantity"
})
return
}
orderID
:=
utils
.
GenOrderID
()
_
,
resp
,
err
:=
h
.
eg
.
ProcessMarketOrder
(
orderID
,
types
.
Coin
(
req
.
BaseToken
),
types
.
Coin
(
req
.
QuoteToken
),
agent
,
side
,
quantity
,
req
.
Nonce
)
if
err
!=
nil
{
c
.
JSON
(
http
.
StatusBadRequest
,
gin
.
H
{
"error"
:
err
.
Error
()})
return
}
c
.
JSON
(
http
.
StatusOK
,
resp
)
}
// GetOrderBook 获取订单簿深度
func
(
h
*
OrderHandler
)
GetOrderBookDepth
(
c
*
gin
.
Context
)
{
var
req
apiTypes
.
DepthRequest
if
err
:=
c
.
ShouldBindJSON
(
&
req
);
err
!=
nil
{
c
.
JSON
(
http
.
StatusBadRequest
,
gin
.
H
{
"error"
:
err
.
Error
()})
return
}
asks
,
bids
,
err
:=
h
.
eg
.
Depth
(
types
.
Coin
(
req
.
BaseToken
),
types
.
Coin
(
req
.
QuoteToken
))
if
err
!=
nil
{
c
.
JSON
(
http
.
StatusBadRequest
,
gin
.
H
{
"error"
:
err
.
Error
()})
return
}
c
.
JSON
(
http
.
StatusOK
,
gin
.
H
{
"asks"
:
asks
,
"bids"
:
bids
,
})
}
// CancelOrder 取消订单
func
(
h
*
OrderHandler
)
CancelOrder
(
c
*
gin
.
Context
)
{
var
req
apiTypes
.
CancelOrderRequest
if
err
:=
c
.
ShouldBindJSON
(
&
req
);
err
!=
nil
{
c
.
JSON
(
http
.
StatusBadRequest
,
gin
.
H
{
"error"
:
err
.
Error
()})
return
}
ok
,
agent
:=
req
.
Recover
()
if
!
ok
{
c
.
JSON
(
http
.
StatusBadRequest
,
gin
.
H
{
"error"
:
"invalid signature"
})
return
}
err
:=
h
.
eg
.
ProcessCancelOrder
(
req
.
OrderId
,
types
.
Coin
(
req
.
BaseToken
),
types
.
Coin
(
req
.
QuoteToken
),
agent
,
req
.
Nonce
)
if
err
!=
nil
{
c
.
JSON
(
http
.
StatusNotFound
,
gin
.
H
{
"error"
:
err
.
Error
()})
return
}
c
.
JSON
(
http
.
StatusOK
,
gin
.
H
{
"message"
:
"success"
,
})
}
func
(
h
*
OrderHandler
)
SignProxy
(
c
*
gin
.
Context
)
{
var
req
apiTypes
.
SignProxyRequest
if
err
:=
c
.
ShouldBindJSON
(
&
req
);
err
!=
nil
{
c
.
JSON
(
http
.
StatusBadRequest
,
gin
.
H
{
"error"
:
err
.
Error
()})
return
}
ok
,
user
:=
req
.
Recover
()
if
!
ok
{
c
.
JSON
(
http
.
StatusBadRequest
,
gin
.
H
{
"error"
:
"invalid signature"
})
return
}
err
:=
h
.
eg
.
PorcessSignProxy
(
user
,
common
.
HexToAddress
(
req
.
Agent
),
req
.
Nonce
)
if
err
!=
nil
{
c
.
JSON
(
http
.
StatusBadRequest
,
gin
.
H
{
"error"
:
err
.
Error
()})
return
}
c
.
JSON
(
http
.
StatusOK
,
gin
.
H
{
"message"
:
"success"
,
})
}
api/router/router.go
deleted
100644 → 0
View file @
db3fa0df
package
router
import
(
"github.com/exchain/process/api/handlers"
"github.com/gin-gonic/gin"
)
// SetupRouter 配置API路由
func
SetupRouter
(
orderHandler
*
handlers
.
OrderHandler
)
*
gin
.
Engine
{
r
:=
gin
.
Default
()
// 订单相关路由
orderGroup
:=
r
.
Group
(
"/api/v1/orders"
)
{
orderGroup
.
POST
(
"/limit"
,
orderHandler
.
PlaceLimitOrder
)
// 限价单
orderGroup
.
POST
(
"/market"
,
orderHandler
.
PlaceMarketOrder
)
// 市价单
orderGroup
.
POST
(
"/cancel"
,
orderHandler
.
CancelOrder
)
// 取消订单
}
// 订单簿相关路由
r
.
GET
(
"/api/v1/orderbook"
,
orderHandler
.
GetOrderBookDepth
)
// 获取订单簿深度
return
r
}
api/types/order.go
View file @
eb086344
...
@@ -17,14 +17,16 @@ type PlaceLimitOrderRequest struct {
...
@@ -17,14 +17,16 @@ type PlaceLimitOrderRequest struct {
Quantity
string
`json:"quantity" binding:"required"`
Quantity
string
`json:"quantity" binding:"required"`
Price
string
`json:"price" binding:"required"`
Price
string
`json:"price" binding:"required"`
Nonce
uint64
`json:"nonce" binding:"required"`
Nonce
uint64
`json:"nonce" binding:"required"`
V
int32
`json:"v" binding:"required"`
Proxy
*
bool
`json:"proxy" binding:"required"`
V
uint8
`json:"v" binding:"required"`
R
hexutil
.
Bytes
`json:"r" binding:"required"`
R
hexutil
.
Bytes
`json:"r" binding:"required"`
S
hexutil
.
Bytes
`json:"s" binding:"required"`
S
hexutil
.
Bytes
`json:"s" binding:"required"`
}
}
func
(
r
*
PlaceLimitOrderRequest
)
Recover
()
(
ok
bool
,
address
common
.
Address
)
{
func
(
r
*
PlaceLimitOrderRequest
)
Recover
()
(
ok
bool
,
address
common
.
Address
)
{
data
:=
fmt
.
Sprintf
(
"baseToken=%s"eToken=%s&side=%s&quantity=%s&price=%s&nonce=%d"
,
r
.
BaseToken
,
r
.
QuoteToken
,
r
.
Side
,
r
.
Quantity
,
r
.
Price
,
r
.
Nonce
)
data
:=
fmt
.
Sprintf
(
"baseToken=%s"eToken=%s&side=%s&quantity=%s&price=%s&nonce=%d"
,
r
.
BaseToken
,
r
.
QuoteToken
,
r
.
Side
,
r
.
Quantity
,
r
.
Price
,
r
.
Nonce
)
hashsum
:=
crypto
.
Keccak256Hash
([]
byte
(
data
))
prefixedMessage
:=
fmt
.
Sprintf
(
"
\x19
Ethereum Signed Message:
\n
%d%s"
,
len
(
data
),
data
)
hashsum
:=
crypto
.
Keccak256Hash
([]
byte
(
prefixedMessage
))
// combile sig
// combile sig
sig
:=
make
([]
byte
,
65
)
sig
:=
make
([]
byte
,
65
)
copy
(
sig
,
r
.
R
)
copy
(
sig
,
r
.
R
)
...
@@ -45,14 +47,16 @@ type PlaceMarketOrderRequest struct {
...
@@ -45,14 +47,16 @@ type PlaceMarketOrderRequest struct {
Side
string
`json:"side" binding:"required,oneof=buy sell"`
Side
string
`json:"side" binding:"required,oneof=buy sell"`
Quantity
string
`json:"quantity" binding:"required"`
Quantity
string
`json:"quantity" binding:"required"`
Nonce
uint64
`json:"nonce" binding:"required"`
Nonce
uint64
`json:"nonce" binding:"required"`
V
int32
`json:"v" binding:"required"`
Proxy
*
bool
`json:"proxy" binding:"required"`
V
uint8
`json:"v" binding:"required"`
R
hexutil
.
Bytes
`json:"r" binding:"required"`
R
hexutil
.
Bytes
`json:"r" binding:"required"`
S
hexutil
.
Bytes
`json:"s" binding:"required"`
S
hexutil
.
Bytes
`json:"s" binding:"required"`
}
}
func
(
r
*
PlaceMarketOrderRequest
)
Recover
()
(
ok
bool
,
address
common
.
Address
)
{
func
(
r
*
PlaceMarketOrderRequest
)
Recover
()
(
ok
bool
,
address
common
.
Address
)
{
data
:=
fmt
.
Sprintf
(
"baseToken=%s"eToken=%s&side=%s&quantity=%s&nonce=%d"
,
r
.
BaseToken
,
r
.
QuoteToken
,
r
.
Side
,
r
.
Quantity
,
r
.
Nonce
)
data
:=
fmt
.
Sprintf
(
"baseToken=%s"eToken=%s&side=%s&quantity=%s&nonce=%d"
,
r
.
BaseToken
,
r
.
QuoteToken
,
r
.
Side
,
r
.
Quantity
,
r
.
Nonce
)
hashsum
:=
crypto
.
Keccak256Hash
([]
byte
(
data
))
prefixedMessage
:=
fmt
.
Sprintf
(
"
\x19
Ethereum Signed Message:
\n
%d%s"
,
len
(
data
),
data
)
hashsum
:=
crypto
.
Keccak256Hash
([]
byte
(
prefixedMessage
))
// combile sig
// combile sig
sig
:=
make
([]
byte
,
65
)
sig
:=
make
([]
byte
,
65
)
copy
(
sig
,
r
.
R
)
copy
(
sig
,
r
.
R
)
...
@@ -75,14 +79,16 @@ type CancelOrderRequest struct {
...
@@ -75,14 +79,16 @@ type CancelOrderRequest struct {
QuoteToken
string
`json:"quoteToken" binding:"required"`
QuoteToken
string
`json:"quoteToken" binding:"required"`
OrderId
string
`json:"orderId" binding:"required"`
OrderId
string
`json:"orderId" binding:"required"`
Nonce
uint64
`json:"nonce" binding:"required"`
Nonce
uint64
`json:"nonce" binding:"required"`
V
int32
`json:"v" binding:"required"`
Proxy
*
bool
`json:"proxy" binding:"required"`
V
uint8
`json:"v" binding:"required"`
R
hexutil
.
Bytes
`json:"r" binding:"required"`
R
hexutil
.
Bytes
`json:"r" binding:"required"`
S
hexutil
.
Bytes
`json:"s" binding:"required"`
S
hexutil
.
Bytes
`json:"s" binding:"required"`
}
}
func
(
r
*
CancelOrderRequest
)
Recover
()
(
ok
bool
,
address
common
.
Address
)
{
func
(
r
*
CancelOrderRequest
)
Recover
()
(
ok
bool
,
address
common
.
Address
)
{
data
:=
fmt
.
Sprintf
(
"baseToken=%s"eToken=%s&orderId=%s&nonce=%d"
,
r
.
BaseToken
,
r
.
QuoteToken
,
r
.
OrderId
,
r
.
Nonce
)
data
:=
fmt
.
Sprintf
(
"baseToken=%s"eToken=%s&orderId=%s&nonce=%d"
,
r
.
BaseToken
,
r
.
QuoteToken
,
r
.
OrderId
,
r
.
Nonce
)
hashsum
:=
crypto
.
Keccak256Hash
([]
byte
(
data
))
prefixedMessage
:=
fmt
.
Sprintf
(
"
\x19
Ethereum Signed Message:
\n
%d%s"
,
len
(
data
),
data
)
hashsum
:=
crypto
.
Keccak256Hash
([]
byte
(
prefixedMessage
))
// combile sig
// combile sig
sig
:=
make
([]
byte
,
65
)
sig
:=
make
([]
byte
,
65
)
copy
(
sig
,
r
.
R
)
copy
(
sig
,
r
.
R
)
...
@@ -104,8 +110,9 @@ type SignProxyRequest struct {
...
@@ -104,8 +110,9 @@ type SignProxyRequest struct {
}
}
func
(
r
*
SignProxyRequest
)
Recover
()
(
ok
bool
,
address
common
.
Address
)
{
func
(
r
*
SignProxyRequest
)
Recover
()
(
ok
bool
,
address
common
.
Address
)
{
data
:=
fmt
.
Sprintf
(
"s&agent=%s&nonce=%d"
,
r
.
Agent
,
r
.
Nonce
)
data
:=
fmt
.
Sprintf
(
"agent=%s&nonce=%d"
,
r
.
Agent
,
r
.
Nonce
)
hashsum
:=
crypto
.
Keccak256Hash
([]
byte
(
data
))
prefixedMessage
:=
fmt
.
Sprintf
(
"
\x19
Ethereum Signed Message:
\n
%d%s"
,
len
(
data
),
data
)
hashsum
:=
crypto
.
Keccak256Hash
([]
byte
(
prefixedMessage
))
// combile sig
// combile sig
sig
:=
make
([]
byte
,
65
)
sig
:=
make
([]
byte
,
65
)
copy
(
sig
,
r
.
R
)
copy
(
sig
,
r
.
R
)
...
...
cmd/
api
/main.go
→
cmd/
gateway
/main.go
View file @
eb086344
package
main
package
main
import
(
import
(
"log"
apigateway
"github.com/exchain/process/api/gateway"
"github.com/exchain/process/api/handlers"
"github.com/exchain/process/api/router"
"github.com/exchain/process/engine"
"github.com/exchain/process/engine"
)
)
func
main
()
{
func
main
()
{
eg
:=
engine
.
GetEngine
()
eg
:=
engine
.
GetEngine
()
// 创建订单处理器
// 创建订单处理器
orderHandler
:=
handlers
.
NewOrderHandler
(
eg
)
apigateway
.
StartServer
(
8111
,
8112
,
eg
)
// 设置路由
r
:=
router
.
SetupRouter
(
orderHandler
)
// 启动服务器
if
err
:=
r
.
Run
(
":8080"
);
err
!=
nil
{
log
.
Fatalf
(
"Failed to start server: %v"
,
err
)
}
}
}
engine/agent.go
View file @
eb086344
...
@@ -2,14 +2,29 @@ package engine
...
@@ -2,14 +2,29 @@ package engine
import
(
import
(
"errors"
"errors"
"fmt"
"github.com/exchain/process/types"
"github.com/exchain/process/types"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/holiman/uint256"
"github.com/holiman/uint256"
)
)
func
(
e
*
Engine
)
PorcessSignProxy
(
user
common
.
Address
,
proxy
common
.
Address
,
nonce
uint64
)
(
err
error
)
{
func
(
e
*
Engine
)
PorcessSignProxy
(
user
common
.
Address
,
proxy
common
.
Address
,
nonce
uint64
,
signature
[]
byte
)
(
err
error
)
{
data
:=
fmt
.
Sprintf
(
"agent=%s&nonce=%d"
,
proxy
.
Hex
(),
nonce
)
prefixedMessage
:=
fmt
.
Sprintf
(
"
\x19
Ethereum Signed Message:
\n
%d%s"
,
len
(
data
),
data
)
hashsum
:=
crypto
.
Keccak256Hash
([]
byte
(
prefixedMessage
))
pubkey
,
err
:=
crypto
.
SigToPub
(
hashsum
.
Bytes
(),
signature
)
if
err
!=
nil
{
return
}
recovered
:=
crypto
.
PubkeyToAddress
(
*
pubkey
)
if
recovered
.
Hex
()
!=
user
.
Hex
()
{
err
=
errors
.
New
(
"invalid signature"
)
return
}
userObject
,
err
:=
e
.
db
.
GetOrNewAccountObject
(
user
)
userObject
,
err
:=
e
.
db
.
GetOrNewAccountObject
(
user
)
if
err
!=
nil
{
if
err
!=
nil
{
return
return
...
...
engine/engine.go
View file @
eb086344
...
@@ -125,11 +125,8 @@ func (e *Engine) NewPayload(params exchain.PayloadParams) (exchain.ExecutionResu
...
@@ -125,11 +125,8 @@ func (e *Engine) NewPayload(params exchain.PayloadParams) (exchain.ExecutionResu
return
result
,
nil
return
result
,
nil
}
}
func
(
e
*
Engine
)
ProcessPayload
(
block
*
nebulav1
.
Block
)
(
exchain
.
ExecutionResult
,
error
)
{
panic
(
"not implemented"
)
}
func
(
e
*
Engine
)
AddToQueue
(
tx
types
.
Transaction
)
{
func
(
e
*
Engine
)
AddToQueue
(
tx
types
.
Transaction
)
{
r
,
s
,
v
:=
tx
.
GetRSV
()
switch
t
:=
tx
.
(
type
)
{
switch
t
:=
tx
.
(
type
)
{
case
*
types
.
PlaceOrderTx
:
case
*
types
.
PlaceOrderTx
:
txType
:=
nebulav1
.
TxType_MarketTx
txType
:=
nebulav1
.
TxType_MarketTx
...
@@ -144,6 +141,12 @@ func (e *Engine) AddToQueue(tx types.Transaction) {
...
@@ -144,6 +141,12 @@ func (e *Engine) AddToQueue(tx types.Transaction) {
TxType
:
txType
,
TxType
:
txType
,
User
:
t
.
User
.
Hex
(),
User
:
t
.
User
.
Hex
(),
Nonce
:
t
.
GetNonce
(),
Nonce
:
t
.
GetNonce
(),
Proxy
:
t
.
Proxy
,
Signature
:
&
nebulav1
.
Signature
{
V
:
int32
(
v
),
R
:
r
,
S
:
s
,
},
Tx
:
&
nebulav1
.
Transaction_LimitTx
{
Tx
:
&
nebulav1
.
Transaction_LimitTx
{
LimitTx
:
&
nebulav1
.
LimitOrderTransaction
{
LimitTx
:
&
nebulav1
.
LimitOrderTransaction
{
Pair
:
t
.
GetPair
(),
Pair
:
t
.
GetPair
(),
...
@@ -159,6 +162,12 @@ func (e *Engine) AddToQueue(tx types.Transaction) {
...
@@ -159,6 +162,12 @@ func (e *Engine) AddToQueue(tx types.Transaction) {
TxType
:
nebulav1
.
TxType_CancelTx
,
TxType
:
nebulav1
.
TxType_CancelTx
,
User
:
t
.
User
.
Hex
(),
User
:
t
.
User
.
Hex
(),
Nonce
:
t
.
GetNonce
(),
Nonce
:
t
.
GetNonce
(),
Proxy
:
t
.
Proxy
,
Signature
:
&
nebulav1
.
Signature
{
V
:
int32
(
v
),
R
:
r
,
S
:
s
,
},
Tx
:
&
nebulav1
.
Transaction_CancelTx
{
Tx
:
&
nebulav1
.
Transaction_CancelTx
{
CancelTx
:
&
nebulav1
.
CancelOrderTransaction
{
CancelTx
:
&
nebulav1
.
CancelOrderTransaction
{
OrderId
:
t
.
GetOrderID
(),
OrderId
:
t
.
GetOrderID
(),
...
@@ -166,12 +175,17 @@ func (e *Engine) AddToQueue(tx types.Transaction) {
...
@@ -166,12 +175,17 @@ func (e *Engine) AddToQueue(tx types.Transaction) {
},
},
}
}
e
.
txQueue
<-
ptx
e
.
txQueue
<-
ptx
case
*
types
.
SignProxyTx
:
case
*
types
.
SignProxyTx
:
pTx
:=
&
nebulav1
.
Transaction
{
pTx
:=
&
nebulav1
.
Transaction
{
TxType
:
nebulav1
.
TxType_SignProxyTx
,
TxType
:
nebulav1
.
TxType_SignProxyTx
,
User
:
t
.
User
.
Hex
(),
User
:
t
.
User
.
Hex
(),
Nonce
:
t
.
GetNonce
(),
Nonce
:
t
.
GetNonce
(),
Proxy
:
t
.
Proxy
,
Signature
:
&
nebulav1
.
Signature
{
V
:
int32
(
v
),
R
:
r
,
S
:
s
,
},
Tx
:
&
nebulav1
.
Transaction_SignProxyTx
{
Tx
:
&
nebulav1
.
Transaction_SignProxyTx
{
SignProxyTx
:
&
nebulav1
.
SignProxyTransaction
{
SignProxyTx
:
&
nebulav1
.
SignProxyTransaction
{
SignerProxy
:
t
.
GetProxyAddress
()
.
Bytes
(),
SignerProxy
:
t
.
GetProxyAddress
()
.
Bytes
(),
...
...
engine/order.go
View file @
eb086344
...
@@ -2,17 +2,32 @@ package engine
...
@@ -2,17 +2,32 @@ package engine
import
(
import
(
"errors"
"errors"
"fmt"
apiTypes
"github.com/exchain/process/api/types"
apiTypes
"github.com/exchain/process/api/types"
"github.com/exchain/process/orderbook"
"github.com/exchain/process/orderbook"
"github.com/exchain/process/types"
"github.com/exchain/process/types"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/holiman/uint256"
"github.com/holiman/uint256"
)
)
func
(
e
*
Engine
)
ProcessMarketOrder
(
orderId
string
,
baseToken
,
quoteToken
types
.
Coin
,
agent
common
.
Address
,
side
orderbook
.
Side
,
quantity
*
uint256
.
Int
,
nonce
uint64
)
(
tx
*
types
.
PlaceOrderTx
,
response
*
apiTypes
.
OrderResponse
,
err
error
)
{
func
(
e
*
Engine
)
ProcessMarketOrder
(
orderId
string
,
baseToken
,
quoteToken
types
.
Coin
,
agent
common
.
Address
,
side
orderbook
.
Side
,
quantity
*
uint256
.
Int
,
nonce
uint64
,
proxy
bool
,
signature
[]
byte
)
(
tx
*
types
.
PlaceOrderTx
,
response
*
apiTypes
.
OrderResponse
,
err
error
)
{
response
=
new
(
apiTypes
.
OrderResponse
)
response
=
new
(
apiTypes
.
OrderResponse
)
data
:=
fmt
.
Sprintf
(
"baseToken=%s"eToken=%s&side=%s&quantity=%s&nonce=%d"
,
baseToken
,
quoteToken
,
side
,
quantity
.
String
(),
nonce
)
prefixedMessage
:=
fmt
.
Sprintf
(
"
\x19
Ethereum Signed Message:
\n
%d%s"
,
len
(
data
),
data
)
hashsum
:=
crypto
.
Keccak256Hash
([]
byte
(
prefixedMessage
))
pubkey
,
err
:=
crypto
.
SigToPub
(
hashsum
.
Bytes
(),
signature
)
if
err
!=
nil
{
return
}
recovered
:=
crypto
.
PubkeyToAddress
(
*
pubkey
)
if
!
proxy
&&
(
recovered
.
Hex
()
!=
agent
.
Hex
())
{
err
=
errors
.
New
(
"invalid signature"
)
return
}
e
.
Lock
()
e
.
Lock
()
ob
,
ok
:=
e
.
orderbooks
[
string
(
baseToken
+
quoteToken
)]
ob
,
ok
:=
e
.
orderbooks
[
string
(
baseToken
+
quoteToken
)]
e
.
Unlock
()
e
.
Unlock
()
...
@@ -21,7 +36,7 @@ func (e *Engine) ProcessMarketOrder(orderId string, baseToken, quoteToken types.
...
@@ -21,7 +36,7 @@ func (e *Engine) ProcessMarketOrder(orderId string, baseToken, quoteToken types.
return
return
}
}
makerObj
,
err
:=
e
.
db
.
GetOrNewAc
ountObjectByAgen
t
(
agent
)
makerObj
,
err
:=
e
.
db
.
GetOrNewAc
countObjec
t
(
agent
)
if
err
!=
nil
{
if
err
!=
nil
{
return
return
}
}
...
@@ -31,6 +46,11 @@ func (e *Engine) ProcessMarketOrder(orderId string, baseToken, quoteToken types.
...
@@ -31,6 +46,11 @@ func (e *Engine) ProcessMarketOrder(orderId string, baseToken, quoteToken types.
return
return
}
}
if
proxy
&&
(
recovered
.
Hex
()
!=
makerObj
.
Proxy
.
Hex
())
{
err
=
errors
.
New
(
"invalid signature"
)
return
}
tx
=
new
(
types
.
PlaceOrderTx
)
tx
=
new
(
types
.
PlaceOrderTx
)
tx
.
OrderID
=
orderId
tx
.
OrderID
=
orderId
tx
.
Nonce
=
nonce
tx
.
Nonce
=
nonce
...
@@ -39,6 +59,8 @@ func (e *Engine) ProcessMarketOrder(orderId string, baseToken, quoteToken types.
...
@@ -39,6 +59,8 @@ func (e *Engine) ProcessMarketOrder(orderId string, baseToken, quoteToken types.
tx
.
BaseCoin
=
baseToken
tx
.
BaseCoin
=
baseToken
tx
.
QuoteCoin
=
quoteToken
tx
.
QuoteCoin
=
quoteToken
tx
.
Type
=
types
.
PlaceOrder
tx
.
Type
=
types
.
PlaceOrder
tx
.
Signature
=
signature
tx
.
Proxy
=
proxy
if
side
==
orderbook
.
Sell
{
if
side
==
orderbook
.
Sell
{
tx
.
Action
=
types
.
OrderActionSell
tx
.
Action
=
types
.
OrderActionSell
}
else
{
}
else
{
...
@@ -147,8 +169,21 @@ func (e *Engine) ProcessMarketOrder(orderId string, baseToken, quoteToken types.
...
@@ -147,8 +169,21 @@ func (e *Engine) ProcessMarketOrder(orderId string, baseToken, quoteToken types.
return
tx
,
response
,
nil
return
tx
,
response
,
nil
}
}
func
(
e
*
Engine
)
ProcessLimitOrder
(
orderId
string
,
baseToken
,
quoteToken
types
.
Coin
,
agent
common
.
Address
,
side
orderbook
.
Side
,
price
,
quantity
*
uint256
.
Int
,
nonce
uint64
)
(
tx
*
types
.
PlaceOrderTx
,
response
*
apiTypes
.
OrderResponse
,
err
error
)
{
func
(
e
*
Engine
)
ProcessLimitOrder
(
orderId
string
,
baseToken
,
quoteToken
types
.
Coin
,
agent
common
.
Address
,
side
orderbook
.
Side
,
price
,
quantity
*
uint256
.
Int
,
nonce
uint64
,
proxy
bool
,
signature
[]
byte
)
(
tx
*
types
.
PlaceOrderTx
,
response
*
apiTypes
.
OrderResponse
,
err
error
)
{
response
=
new
(
apiTypes
.
OrderResponse
)
response
=
new
(
apiTypes
.
OrderResponse
)
data
:=
fmt
.
Sprintf
(
"baseToken=%s"eToken=%s&side=%s&quantity=%s&price=%s&nonce=%d"
,
baseToken
,
quoteToken
,
side
,
quantity
.
String
(),
price
.
String
(),
nonce
)
prefixedMessage
:=
fmt
.
Sprintf
(
"
\x19
Ethereum Signed Message:
\n
%d%s"
,
len
(
data
),
data
)
hashsum
:=
crypto
.
Keccak256Hash
([]
byte
(
prefixedMessage
))
pubkey
,
err
:=
crypto
.
SigToPub
(
hashsum
.
Bytes
(),
signature
)
if
err
!=
nil
{
return
}
recovered
:=
crypto
.
PubkeyToAddress
(
*
pubkey
)
if
!
proxy
&&
(
recovered
.
Hex
()
!=
agent
.
Hex
())
{
err
=
errors
.
New
(
"invalid signature"
)
return
}
e
.
Lock
()
e
.
Lock
()
ob
,
ok
:=
e
.
orderbooks
[
string
(
baseToken
+
quoteToken
)]
ob
,
ok
:=
e
.
orderbooks
[
string
(
baseToken
+
quoteToken
)]
e
.
Unlock
()
e
.
Unlock
()
...
@@ -157,15 +192,21 @@ func (e *Engine) ProcessLimitOrder(orderId string, baseToken, quoteToken types.C
...
@@ -157,15 +192,21 @@ func (e *Engine) ProcessLimitOrder(orderId string, baseToken, quoteToken types.C
return
return
}
}
makerObj
,
err
:=
e
.
db
.
GetOrNewAc
ountObjectByAgen
t
(
agent
)
makerObj
,
err
:=
e
.
db
.
GetOrNewAc
countObjec
t
(
agent
)
if
err
!=
nil
{
if
err
!=
nil
{
return
return
}
}
if
makerObj
==
nil
{
if
makerObj
==
nil
{
err
=
errors
.
New
(
"invalid agent"
)
err
=
errors
.
New
(
"invalid agent"
)
return
return
}
}
if
proxy
&&
(
recovered
.
Hex
()
!=
makerObj
.
Proxy
.
Hex
())
{
err
=
errors
.
New
(
"invalid signature"
)
return
}
tx
=
new
(
types
.
PlaceOrderTx
)
tx
=
new
(
types
.
PlaceOrderTx
)
tx
.
OrderID
=
orderId
tx
.
OrderID
=
orderId
tx
.
Nonce
=
nonce
tx
.
Nonce
=
nonce
...
@@ -174,6 +215,8 @@ func (e *Engine) ProcessLimitOrder(orderId string, baseToken, quoteToken types.C
...
@@ -174,6 +215,8 @@ func (e *Engine) ProcessLimitOrder(orderId string, baseToken, quoteToken types.C
tx
.
BaseCoin
=
baseToken
tx
.
BaseCoin
=
baseToken
tx
.
QuoteCoin
=
quoteToken
tx
.
QuoteCoin
=
quoteToken
tx
.
Type
=
types
.
PlaceOrder
tx
.
Type
=
types
.
PlaceOrder
tx
.
Signature
=
signature
tx
.
Proxy
=
proxy
if
side
==
orderbook
.
Sell
{
if
side
==
orderbook
.
Sell
{
tx
.
Action
=
types
.
OrderActionSell
tx
.
Action
=
types
.
OrderActionSell
}
else
{
}
else
{
...
@@ -285,7 +328,20 @@ func (e *Engine) ProcessLimitOrder(orderId string, baseToken, quoteToken types.C
...
@@ -285,7 +328,20 @@ func (e *Engine) ProcessLimitOrder(orderId string, baseToken, quoteToken types.C
return
tx
,
response
,
nil
return
tx
,
response
,
nil
}
}
func
(
e
*
Engine
)
ProcessCancelOrder
(
orderId
string
,
baseToken
,
quoteToken
types
.
Coin
,
agent
common
.
Address
,
nonce
uint64
)
(
err
error
)
{
func
(
e
*
Engine
)
ProcessCancelOrder
(
orderId
string
,
baseToken
,
quoteToken
types
.
Coin
,
agent
common
.
Address
,
nonce
uint64
,
proxy
bool
,
signature
[]
byte
)
(
err
error
)
{
data
:=
fmt
.
Sprintf
(
"baseToken=%s"eToken=%s&orderId=%s&nonce=%d"
,
baseToken
,
quoteToken
,
orderId
,
nonce
)
prefixedMessage
:=
fmt
.
Sprintf
(
"
\x19
Ethereum Signed Message:
\n
%d%s"
,
len
(
data
),
data
)
hashsum
:=
crypto
.
Keccak256Hash
([]
byte
(
prefixedMessage
))
pubkey
,
err
:=
crypto
.
SigToPub
(
hashsum
.
Bytes
(),
signature
)
if
err
!=
nil
{
return
}
recovered
:=
crypto
.
PubkeyToAddress
(
*
pubkey
)
if
!
proxy
&&
(
recovered
.
Hex
()
!=
agent
.
Hex
())
{
err
=
errors
.
New
(
"invalid signature"
)
return
}
e
.
Lock
()
e
.
Lock
()
ob
,
ok
:=
e
.
orderbooks
[
string
(
baseToken
+
quoteToken
)]
ob
,
ok
:=
e
.
orderbooks
[
string
(
baseToken
+
quoteToken
)]
e
.
Unlock
()
e
.
Unlock
()
...
@@ -293,7 +349,7 @@ func (e *Engine) ProcessCancelOrder(orderId string, baseToken, quoteToken types.
...
@@ -293,7 +349,7 @@ func (e *Engine) ProcessCancelOrder(orderId string, baseToken, quoteToken types.
return
return
}
}
makerObj
,
err
:=
e
.
db
.
GetOrNewAc
ountObjectByAgen
t
(
agent
)
makerObj
,
err
:=
e
.
db
.
GetOrNewAc
countObjec
t
(
agent
)
if
err
!=
nil
{
if
err
!=
nil
{
return
return
}
}
...
@@ -301,6 +357,11 @@ func (e *Engine) ProcessCancelOrder(orderId string, baseToken, quoteToken types.
...
@@ -301,6 +357,11 @@ func (e *Engine) ProcessCancelOrder(orderId string, baseToken, quoteToken types.
return
errors
.
New
(
"invalid agent"
)
return
errors
.
New
(
"invalid agent"
)
}
}
if
proxy
&&
(
recovered
.
Hex
()
!=
makerObj
.
Proxy
.
Hex
())
{
err
=
errors
.
New
(
"invalid signature"
)
return
}
order
:=
ob
.
Order
(
orderId
)
order
:=
ob
.
Order
(
orderId
)
if
order
==
nil
{
if
order
==
nil
{
return
errors
.
New
(
"invalid order id"
)
return
errors
.
New
(
"invalid order id"
)
...
@@ -317,11 +378,16 @@ func (e *Engine) ProcessCancelOrder(orderId string, baseToken, quoteToken types.
...
@@ -317,11 +378,16 @@ func (e *Engine) ProcessCancelOrder(orderId string, baseToken, quoteToken types.
tx
:=
&
types
.
CancelOrderTx
{
tx
:=
&
types
.
CancelOrderTx
{
Tx
:
types
.
Tx
{
Tx
:
types
.
Tx
{
OrderID
:
orderId
,
OrderID
:
orderId
,
Time
:
nonce
,
Time
:
nonce
,
User
:
makerObj
.
Address
,
User
:
makerObj
.
Address
,
Action
:
types
.
OrderActionCancel
,
BaseCoin
:
baseToken
,
Nonce
:
nonce
,
QuoteCoin
:
quoteToken
,
Type
:
types
.
CancelOrder
,
Action
:
types
.
OrderActionCancel
,
Nonce
:
nonce
,
Proxy
:
proxy
,
Signature
:
signature
,
},
},
}
}
...
...
engine/process.go
View file @
eb086344
package
engine
package
engine
import
(
import
(
"fmt"
"math/big"
"strings"
"github.com/exchain/process/orderbook"
"github.com/exchain/process/types"
"github.com/exchain/process/types"
"github.com/exchain/process/utils"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/exchain/go-exchain/exchain"
"github.com/exchain/go-exchain/exchain/chaindb"
nebulav1
"github.com/exchain/go-exchain/exchain/protocol/gen/go/nebula/v1"
nebulav1
"github.com/exchain/go-exchain/exchain/protocol/gen/go/nebula/v1"
"github.com/exchain/go-exchain/exchain/wrapper"
"github.com/exchain/go-exchain/exchain/wrapper"
"github.com/holiman/uint256"
"github.com/holiman/uint256"
)
)
func
(
e
*
Engine
)
ProcessPayload
(
block
*
nebulav1
.
Block
)
(
exchain
.
ExecutionResult
,
error
)
{
genesis
:=
block
.
Header
.
Height
==
0
if
!
genesis
{
parent
,
err
:=
e
.
chainDB
.
GetBlockByLabel
(
chaindb
.
ExChainBlockLatest
)
if
err
!=
nil
{
return
exchain
.
ExecutionResult
{},
err
}
if
parent
.
Header
.
Height
+
1
!=
block
.
Header
.
Height
{
return
exchain
.
ExecutionResult
{},
fmt
.
Errorf
(
"invalid block height"
)
}
}
receipts
,
err
:=
e
.
ProcessTx
(
block
.
Header
,
block
.
Transactions
)
if
err
!=
nil
{
return
exchain
.
ExecutionResult
{},
err
}
return
exchain
.
ExecutionResult
{
Payload
:
block
,
Receipts
:
receipts
,
},
nil
}
func
(
e
*
Engine
)
ProcessOrders
(
header
*
nebulav1
.
BlockHeader
)
(
txs
*
nebulav1
.
TransactionList
,
receipts
*
nebulav1
.
TransactionReceiptList
,
err
error
)
{
func
(
e
*
Engine
)
ProcessOrders
(
header
*
nebulav1
.
BlockHeader
)
(
txs
*
nebulav1
.
TransactionList
,
receipts
*
nebulav1
.
TransactionReceiptList
,
err
error
)
{
txs
=
&
nebulav1
.
TransactionList
{}
txs
=
&
nebulav1
.
TransactionList
{}
txs
.
Txs
=
make
([]
*
nebulav1
.
Transaction
,
0
)
txs
.
Txs
=
make
([]
*
nebulav1
.
Transaction
,
0
)
...
@@ -131,6 +161,77 @@ func (e *Engine) ProcessTx(header *nebulav1.BlockHeader, txs *nebulav1.Transacti
...
@@ -131,6 +161,77 @@ func (e *Engine) ProcessTx(header *nebulav1.BlockHeader, txs *nebulav1.Transacti
receipt
.
Content
=
&
nebulav1
.
TransactionReceipt_DepositR
{
receipt
.
Content
=
&
nebulav1
.
TransactionReceipt_DepositR
{
DepositR
:
&
nebulav1
.
DepositReceipt
{},
DepositR
:
&
nebulav1
.
DepositReceipt
{},
}
}
case
nebulav1
.
TxType_CreatePairTx
:
err
:=
e
.
ProcessCreatePair
(
tx
.
GetCreatePairTx
())
if
err
!=
nil
{
receipt
.
Success
=
false
}
receipt
.
Content
=
&
nebulav1
.
TransactionReceipt_CreatePairR
{
CreatePairR
:
&
nebulav1
.
CreatePairReceipt
{},
}
case
nebulav1
.
TxType_DisablePairTx
:
err
:=
e
.
ProcessDisablePair
(
tx
.
GetDisablePairTx
())
if
err
!=
nil
{
receipt
.
Success
=
false
}
receipt
.
Content
=
&
nebulav1
.
TransactionReceipt_DisablePairR
{
DisablePairR
:
&
nebulav1
.
DisablePairReceipt
{},
}
case
nebulav1
.
TxType_MarketTx
:
coins
:=
strings
.
Split
(
tx
.
GetMarketTx
()
.
Pair
,
"-"
)
baseCoin
:=
types
.
Coin
(
coins
[
0
])
quoteCoin
:=
types
.
Coin
(
coins
[
1
])
user
:=
common
.
HexToAddress
(
tx
.
User
)
side
:=
orderbook
.
Buy
if
tx
.
GetMarketTx
()
.
Side
==
nebulav1
.
OrderSide_SELL
{
side
=
orderbook
.
Sell
}
quantity
:=
new
(
uint256
.
Int
)
.
SetBytes
(
tx
.
GetMarketTx
()
.
Quantity
)
nonce
:=
new
(
big
.
Int
)
.
SetBytes
(
tx
.
Nonce
)
_
,
_
,
err
:=
e
.
ProcessMarketOrder
(
tx
.
GetMarketTx
()
.
OrderId
,
baseCoin
,
quoteCoin
,
user
,
side
,
quantity
,
nonce
.
Uint64
(),
tx
.
Proxy
,
utils
.
CombineRSV
(
tx
.
Signature
.
R
,
tx
.
Signature
.
S
,
uint8
(
tx
.
Signature
.
V
)))
if
err
!=
nil
{
receipt
.
Success
=
false
}
receipt
.
Content
=
&
nebulav1
.
TransactionReceipt_MarketR
{
MarketR
:
&
nebulav1
.
MarketOrderReceipt
{},
}
case
nebulav1
.
TxType_LimitTx
:
coins
:=
strings
.
Split
(
tx
.
GetLimitTx
()
.
Pair
,
"-"
)
baseCoin
:=
types
.
Coin
(
coins
[
0
])
quoteCoin
:=
types
.
Coin
(
coins
[
1
])
user
:=
common
.
HexToAddress
(
tx
.
User
)
side
:=
orderbook
.
Buy
if
tx
.
GetLimitTx
()
.
Side
==
nebulav1
.
OrderSide_SELL
{
side
=
orderbook
.
Sell
}
quantity
:=
new
(
uint256
.
Int
)
.
SetBytes
(
tx
.
GetLimitTx
()
.
Quantity
)
price
:=
new
(
uint256
.
Int
)
.
SetBytes
(
tx
.
GetLimitTx
()
.
Price
)
nonce
:=
new
(
big
.
Int
)
.
SetBytes
(
tx
.
Nonce
)
_
,
_
,
err
:=
e
.
ProcessLimitOrder
(
tx
.
GetLimitTx
()
.
OrderId
,
baseCoin
,
quoteCoin
,
user
,
side
,
quantity
,
price
,
nonce
.
Uint64
(),
tx
.
Proxy
,
utils
.
CombineRSV
(
tx
.
Signature
.
R
,
tx
.
Signature
.
S
,
uint8
(
tx
.
Signature
.
V
)))
if
err
!=
nil
{
receipt
.
Success
=
false
}
receipt
.
Content
=
&
nebulav1
.
TransactionReceipt_LimitR
{
LimitR
:
&
nebulav1
.
LimitOrderReceipt
{},
}
case
nebulav1
.
TxType_CancelTx
:
coins
:=
strings
.
Split
(
tx
.
GetCancelTx
()
.
Pair
,
"-"
)
baseCoin
:=
types
.
Coin
(
coins
[
0
])
quoteCoin
:=
types
.
Coin
(
coins
[
1
])
user
:=
common
.
HexToAddress
(
tx
.
User
)
err
:=
e
.
ProcessCancelOrder
(
tx
.
GetCancelTx
()
.
OrderId
,
baseCoin
,
quoteCoin
,
user
,
new
(
big
.
Int
)
.
SetBytes
(
tx
.
Nonce
)
.
Uint64
(),
tx
.
Proxy
,
utils
.
CombineRSV
(
tx
.
Signature
.
R
,
tx
.
Signature
.
S
,
uint8
(
tx
.
Signature
.
V
)))
if
err
!=
nil
{
receipt
.
Success
=
false
}
receipt
.
Content
=
&
nebulav1
.
TransactionReceipt_CancelR
{
CancelR
:
&
nebulav1
.
CancelOrderReceipt
{},
}
default
:
default
:
}
}
receipts
.
Receipts
=
append
(
receipts
.
Receipts
,
receipt
)
receipts
.
Receipts
=
append
(
receipts
.
Receipts
,
receipt
)
...
...
go.mod
View file @
eb086344
...
@@ -5,55 +5,59 @@ go 1.23.3
...
@@ -5,55 +5,59 @@ go 1.23.3
require (
require (
github.com/bwmarrin/snowflake v0.3.0
github.com/bwmarrin/snowflake v0.3.0
github.com/emirpasic/gods v1.18.1
github.com/emirpasic/gods v1.18.1
github.com/ethereum/go-ethereum v1.15.
0
github.com/ethereum/go-ethereum v1.15.
7
github.com/exchain/go-exchain v0.0.1
github.com/exchain/go-exchain v0.0.1
github.com/gin-gonic/gin v1.10.0
github.com/gin-gonic/gin v1.10.0
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/holiman/uint256 v1.3.2
github.com/holiman/uint256 v1.3.2
github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a
github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a
google.golang.org/grpc v1.57.1
)
)
require (
require (
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.
3
.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.
4
.0 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/hashicorp/golang-lru v
0.5.0
// indirect
github.com/hashicorp/golang-lru v
1.0.2
// indirect
github.com/oklog/ulid v1.3.1 // indirect
github.com/oklog/ulid v1.3.1 // indirect
github.com/oklog/ulid/v2 v2.1.0 // indirect
github.com/oklog/ulid/v2 v2.1.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
github.com/yusufpapurcu/wmi v1.2.3 // indirect
)
)
require (
require (
github.com/bytedance/sonic v1.11.6 // indirect
github.com/bytedance/sonic v1.13.2 // indirect
github.com/bytedance/sonic/loader v0.1.1 // indirect
github.com/bytedance/sonic/loader v0.2.4 // indirect
github.com/cloudwego/base64x v0.1.4 // indirect
github.com/cloudwego/base64x v0.1.5 // indirect
github.com/cloudwego/iasm v0.2.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.8 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/gin-contrib/sse v1.0.0 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.2
0
.0 // indirect
github.com/go-playground/validator/v10 v10.2
6
.0 // indirect
github.com/goccy/go-json v0.10.
3
// indirect
github.com/goccy/go-json v0.10.
5
// indirect
github.com/golang/snappy v
0.0.5-0.20220116011046-fa5810519dcb
// indirect
github.com/golang/snappy v
1.0.0
// indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.2.
8
// indirect
github.com/klauspost/cpuid/v2 v2.2.
10
// indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml/v2 v2.2.
2
// indirect
github.com/pelletier/go-toml/v2 v2.2.
3
// indirect
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/tklauser/go-sysconf v0.3.1
2
// indirect
github.com/tklauser/go-sysconf v0.3.1
5
// indirect
github.com/tklauser/numcpus v0.
6.1
// indirect
github.com/tklauser/numcpus v0.
10.0
// indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.12 // indirect
github.com/ugorji/go/codec v1.2.12 // indirect
golang.org/x/arch v0.8.0 // indirect
golang.org/x/arch v0.16.0 // indirect
golang.org/x/crypto v0.32.0 // indirect
golang.org/x/crypto v0.36.0 // indirect
golang.org/x/net v0.34.0 // indirect
golang.org/x/net v0.38.0 // indirect
golang.org/x/sys v0.29.0 // indirect
golang.org/x/sys v0.32.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/text v0.24.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
google.golang.org/genproto v0.0.0-20230726155614-23370e0ffb3e // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f // indirect
google.golang.org/protobuf v1.36.6 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
)
...
...
go.sum
View file @
eb086344
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/bwmarrin/snowflake v0.3.0 h1:xm67bEhkKh6ij1790JB83OujPR5CzNe8QuQqAgISZN0=
github.com/bwmarrin/snowflake v0.3.0 h1:xm67bEhkKh6ij1790JB83OujPR5CzNe8QuQqAgISZN0=
github.com/bwmarrin/snowflake v0.3.0/go.mod h1:NdZxfVWX+oR6y2K0o6qAYv6gIOP9rjG0/E9WsDpxqwE=
github.com/bwmarrin/snowflake v0.3.0/go.mod h1:NdZxfVWX+oR6y2K0o6qAYv6gIOP9rjG0/E9WsDpxqwE=
github.com/bytedance/sonic v1.11.6 h1:oUp34TzMlL+OY1OUWxHqsdkgC/Zfc85zGqw9siXjrc0=
github.com/bytedance/sonic v1.13.2 h1:8/H1FempDZqC4VqjptGo14QQlJx8VdZJegxs6wwfqpQ=
github.com/bytedance/sonic v1.11.6/go.mod h1:LysEHSvpvDySVdC2f87zGWf6CIKJcAvqab1ZaiQtds4=
github.com/bytedance/sonic v1.13.2/go.mod h1:o68xyaF9u2gvVBuGHPlUVCy+ZfmNNO5ETf1+KgkJhz4=
github.com/bytedance/sonic/loader v0.1.1 h1:c+e5Pt1k/cy5wMveRDyk2X4B9hF4g7an8N3zCYjJFNM=
github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU=
github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU=
github.com/bytedance/sonic/loader v0.2.4 h1:ZWCw4stuXUsn1/+zQDqeE7JKP+QO47tz7QCNan80NzY=
github.com/bytedance/sonic/loader v0.2.4/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFosQU6FxH2JmUe6VI=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/cl
oudwego/base64x v0.1.4 h1:jwCgWpFanWmN8xoIUHa2rtzmkd5J2plF/dnLS6Xd/0Y
=
github.com/cl
ient9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw
=
github.com/cloudwego/base64x v0.1.
4/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w
=
github.com/cloudwego/base64x v0.1.
5 h1:XPciSp1xaq2VCSt6lF0phncD4koWyULpl5bUxbfCyP4
=
github.com/cloudwego/
iasm v0.2.0 h1:1KNIy1I1H9hNNFEEH3DVnI4UujN+1zjpuk6gwHLTssg
=
github.com/cloudwego/
base64x v0.1.5/go.mod h1:0zlkT4Wn5C6NdauXdJRhSKRlJvmclQ1hhJgA0rcu/8w
=
github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY=
github.com/cloudwego/iasm v0.2.0/go.mod h1:8rXZaNYT2n95jn+zTI1sDr+IgcD2GVs0nlbbQPiEFhY=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/decred/dcrd/crypto/blake256 v1.
0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y
=
github.com/decred/dcrd/crypto/blake256 v1.
1.0 h1:zPMNGQCm0g4QTY27fOCorQW7EryeQ/U0x++OzVrdms8
=
github.com/decred/dcrd/crypto/blake256 v1.
0.1
/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo=
github.com/decred/dcrd/crypto/blake256 v1.
1.0
/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.
3.0 h1:rpfIENRNNilwHwZeG5+P150SMrnNEcHYvcCuK6dPZSg
=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.
4.0 h1:NMZiJj8QnKe1LgsbDayM4UoHwbvwDRwnI3hwNaAHRnc
=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.
3.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/
0=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.
4.0/go.mod h1:ZXNYxsqcloTdSy/rNShjYzMhyjf0LaoftYK0p+A3h4
0=
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/ethereum-optimism/op-geth v1.101412.0-rc.1 h1:Un6Cnr4QkQx+s/Rp1iWvsBD+lIE1xZd8RKIKxGmChTk=
github.com/ethereum-optimism/op-geth v1.101412.0-rc.1 h1:Un6Cnr4QkQx+s/Rp1iWvsBD+lIE1xZd8RKIKxGmChTk=
github.com/ethereum-optimism/op-geth v1.101412.0-rc.1/go.mod h1:lRTd6c45e98fA9Cm0c8SrtqiSNYtxUBBZo3ofJbQh5I=
github.com/ethereum-optimism/op-geth v1.101412.0-rc.1/go.mod h1:lRTd6c45e98fA9Cm0c8SrtqiSNYtxUBBZo3ofJbQh5I=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
...
@@ -28,10 +39,11 @@ github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4
...
@@ -28,10 +39,11 @@ github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4
github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU=
github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU=
github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M=
github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M=
github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0=
github.com/gabriel-vasile/mimetype v1.4.8 h1:FfZ3gj38NjllZIeJAmMhr+qKL8Wu+nOoI3GqacKw1NM=
github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk=
github.com/gabriel-vasile/mimetype v1.4.8/go.mod h1:ByKUIKGjh1ODkGM1asKUbQZOLGrPjydw3hYPU2YU9t8=
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
github.com/gin-contrib/sse v1.0.0 h1:y3bT1mUWUxDpW4JLQg/HnTqV4rozuW4tC9eFKTxYI9E=
github.com/gin-contrib/sse v1.0.0/go.mod h1:zNuFdwarAygJBht0NTKiSi3jRf6RbqeILZ9Sp6Slhe0=
github.com/gin-gonic/gin v1.10.0 h1:nTuyha1TYqgedzytsKYqna+DfLos46nTv2ygFy86HFU=
github.com/gin-gonic/gin v1.10.0 h1:nTuyha1TYqgedzytsKYqna+DfLos46nTv2ygFy86HFU=
github.com/gin-gonic/gin v1.10.0/go.mod h1:4PMNQiOhvDRa013RKVbsiNwoyezlm2rm0uX/T7kzp5Y=
github.com/gin-gonic/gin v1.10.0/go.mod h1:4PMNQiOhvDRa013RKVbsiNwoyezlm2rm0uX/T7kzp5Y=
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
...
@@ -43,12 +55,16 @@ github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/o
...
@@ -43,12 +55,16 @@ github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/o
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
github.com/go-playground/validator/v10 v10.2
0.0 h1:K9ISHbSaI0lyB2eWMPJo+kOS/FBExVwjEviJTixqxL8
=
github.com/go-playground/validator/v10 v10.2
6.0 h1:SP05Nqhjcvz81uJaRfEV0YBSSSGMc/iMaVtFbr3Sw2k
=
github.com/go-playground/validator/v10 v10.2
0.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM
=
github.com/go-playground/validator/v10 v10.2
6.0/go.mod h1:I5QpIEbmr8On7W0TktmJAumgzX4CA1XNl4ZmDuVHKKo
=
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA=
github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4=
github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
...
@@ -60,8 +76,9 @@ github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu
...
@@ -60,8 +76,9 @@ github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk=
github.com/golang/snappy v1.0.0 h1:Oy607GVXHs7RtbggtPBnr2RmDArIsAefDwvrdWvRhGs=
github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v1.0.0/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
...
@@ -70,10 +87,13 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
...
@@ -70,10 +87,13 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo=
github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c=
github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
github.com/holiman/uint256 v1.3.2 h1:a9EgMPSC1AAaj1SZL5zIQD3WbwTuHrMGOerLjGmM/TA=
github.com/holiman/uint256 v1.3.2 h1:a9EgMPSC1AAaj1SZL5zIQD3WbwTuHrMGOerLjGmM/TA=
github.com/holiman/uint256 v1.3.2/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E=
github.com/holiman/uint256 v1.3.2/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
...
@@ -81,9 +101,16 @@ github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:
...
@@ -81,9 +101,16 @@ github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
github.com/klauspost/cpuid/v2 v2.2.
8 h1:+StwCXwm9PdpiEkPyzBXIy+M9KUb4ODm0Zarf1kS5BM
=
github.com/klauspost/cpuid/v2 v2.2.
10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE
=
github.com/klauspost/cpuid/v2 v2.2.
8/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws
=
github.com/klauspost/cpuid/v2 v2.2.
10/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0
=
github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M=
github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
...
@@ -112,15 +139,17 @@ github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAl
...
@@ -112,15 +139,17 @@ github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAl
github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw=
github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw=
github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro=
github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro=
github.com/pborman/getopt v0.0.0-20170112200414-7148bc3a4c30/go.mod h1:85jBQOZwpVEaDAr341tbn15RS4fCAsIst0qp7i8ex1o=
github.com/pborman/getopt v0.0.0-20170112200414-7148bc3a4c30/go.mod h1:85jBQOZwpVEaDAr341tbn15RS4fCAsIst0qp7i8ex1o=
github.com/pelletier/go-toml/v2 v2.2.
2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+L
M=
github.com/pelletier/go-toml/v2 v2.2.
3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12
M=
github.com/pelletier/go-toml/v2 v2.2.
2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs
=
github.com/pelletier/go-toml/v2 v2.2.
3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc
=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI=
github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI=
github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
...
@@ -133,44 +162,57 @@ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1F
...
@@ -133,44 +162,57 @@ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1F
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a h1:1ur3QoCqvE5fl+nylMaIr9PVV1w343YRDtsy+Rwu7XI=
github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a h1:1ur3QoCqvE5fl+nylMaIr9PVV1w343YRDtsy+Rwu7XI=
github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48=
github.com/syndtr/goleveldb v1.0.1-0.20220614013038-64ee5596c38a/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48=
github.com/tklauser/go-sysconf v0.3.1
2 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU
=
github.com/tklauser/go-sysconf v0.3.1
5 h1:VE89k0criAymJ/Os65CSn1IXaol+1wrsFHEB8Ol49K4
=
github.com/tklauser/go-sysconf v0.3.1
2/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI
=
github.com/tklauser/go-sysconf v0.3.1
5/go.mod h1:Dmjwr6tYFIseJw7a3dRLJfsHAMXZ3nEnL/aZY+0IuI4
=
github.com/tklauser/numcpus v0.
6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk
=
github.com/tklauser/numcpus v0.
10.0 h1:18njr6LDBk1zuna922MgdjQuJFjrdppsZG60sHGfjso
=
github.com/tklauser/numcpus v0.
6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY
=
github.com/tklauser/numcpus v0.
10.0/go.mod h1:BiTKazU708GQTYF4mB+cmlpT2Is1gLk7XVuEeem8LsQ
=
github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=
github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE=
github.com/ugorji/go/codec v1.2.12 h1:9LC83zGrHhuUA9l16C9AHXAqEV/2wBQ4nkvumAE65EE=
github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw=
github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=
github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
golang.org/x/arch v0.16.0 h1:foMtLTdyOmIniqWCHjY6+JxuC54XP1fDwx4N0ASyW+U=
golang.org/x/arch v0.8.0 h1:3wRIsP3pM4yUptoR96otTUOXI367OS0+c9eeRi9doIc=
golang.org/x/arch v0.16.0/go.mod h1:JmwW7aLIoRUKgaTzhkiEFxvcEiQGyOg9BMonBJUS7EE=
golang.org/x/arch v0.8.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc=
golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34=
golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc=
golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk=
golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk=
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
...
@@ -188,23 +230,23 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc
...
@@ -188,23 +230,23 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU=
golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.2
1.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo
=
golang.org/x/text v0.2
4.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0
=
golang.org/x/text v0.2
1.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ
=
golang.org/x/text v0.2
4.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU
=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
...
@@ -212,6 +254,24 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T
...
@@ -212,6 +254,24 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20230726155614-23370e0ffb3e h1:xIXmWJ303kJCuogpj0bHq+dcjcZHU+XFyc1I0Yl9cRg=
google.golang.org/genproto v0.0.0-20230726155614-23370e0ffb3e/go.mod h1:0ggbjUrZYpy1q+ANUS30SEoGZ53cdfwtbuG7Ptgy108=
google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 h1:FmF5cCW94Ij59cfpoLiwTgodWmm60eEV0CjlsVg2fuw=
google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98/go.mod h1:rsr7RhLuwsDKL7RmgDDCUc6yaGr1iqceVb5Wv6f6YvQ=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f h1:OxYkA3wjPsZyBylwymxSHa7ViiW1Sml4ToBrncvFehI=
google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f/go.mod h1:+2Yz8+CLJbIfL9z73EW45avw8Lmge3xVElCP9zEKi50=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
google.golang.org/grpc v1.57.1 h1:upNTNqv0ES+2ZOOqACwVtS3Il8M12/+Hz41RCPzAjQg=
google.golang.org/grpc v1.57.1/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
...
@@ -220,14 +280,16 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi
...
@@ -220,14 +280,16 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
...
@@ -235,5 +297,6 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
...
@@ -235,5 +297,6 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50=
nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50=
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
types/transaction.go
View file @
eb086344
...
@@ -5,6 +5,7 @@ import (
...
@@ -5,6 +5,7 @@ import (
"encoding/gob"
"encoding/gob"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common"
"github.com/exchain/process/utils"
"github.com/holiman/uint256"
"github.com/holiman/uint256"
)
)
...
@@ -35,6 +36,7 @@ type Transaction interface {
...
@@ -35,6 +36,7 @@ type Transaction interface {
GetOrderID
()
string
GetOrderID
()
string
GetNonce
()
[]
byte
GetNonce
()
[]
byte
GetProxyAddress
()
common
.
Address
GetProxyAddress
()
common
.
Address
GetRSV
()
(
r
,
s
[]
byte
,
v
uint8
)
}
}
type
Tx
struct
{
type
Tx
struct
{
...
@@ -46,6 +48,8 @@ type Tx struct {
...
@@ -46,6 +48,8 @@ type Tx struct {
Type
OrderType
Type
OrderType
Action
OrderAction
Action
OrderAction
Nonce
uint64
Nonce
uint64
Proxy
bool
Signature
[]
byte
}
}
type
CancelOrderTx
struct
{
type
CancelOrderTx
struct
{
...
@@ -71,6 +75,11 @@ func (tx *CancelOrderTx) GetUser() common.Address {
...
@@ -71,6 +75,11 @@ func (tx *CancelOrderTx) GetUser() common.Address {
return
tx
.
User
return
tx
.
User
}
}
func
(
tx
*
CancelOrderTx
)
GetRSV
()
(
r
,
s
[]
byte
,
v
uint8
)
{
r
,
s
,
v
=
utils
.
SplitRSV
(
tx
.
Signature
)
return
}
func
(
tx
*
CancelOrderTx
)
GetLimitPrice
()
*
uint256
.
Int
{
func
(
tx
*
CancelOrderTx
)
GetLimitPrice
()
*
uint256
.
Int
{
return
nil
return
nil
}
}
...
@@ -152,6 +161,11 @@ func (tx *PlaceOrderTx) GetProxyAddress() common.Address {
...
@@ -152,6 +161,11 @@ func (tx *PlaceOrderTx) GetProxyAddress() common.Address {
return
common
.
Address
{}
return
common
.
Address
{}
}
}
func
(
tx
*
PlaceOrderTx
)
GetRSV
()
(
r
,
s
[]
byte
,
v
uint8
)
{
r
,
s
,
v
=
utils
.
SplitRSV
(
tx
.
Signature
)
return
}
type
SignProxyTx
struct
{
type
SignProxyTx
struct
{
Tx
Tx
ProxyAddress
common
.
Address
ProxyAddress
common
.
Address
...
@@ -203,3 +217,8 @@ func (tx *SignProxyTx) GetNonce() []byte {
...
@@ -203,3 +217,8 @@ func (tx *SignProxyTx) GetNonce() []byte {
func
(
tx
*
SignProxyTx
)
GetProxyAddress
()
common
.
Address
{
func
(
tx
*
SignProxyTx
)
GetProxyAddress
()
common
.
Address
{
return
tx
.
ProxyAddress
return
tx
.
ProxyAddress
}
}
func
(
tx
*
SignProxyTx
)
GetRSV
()
(
r
,
s
[]
byte
,
v
uint8
)
{
r
,
s
,
v
=
utils
.
SplitRSV
(
tx
.
Signature
)
return
}
utils/signature.go
0 → 100644
View file @
eb086344
package
utils
func
SplitRSV
(
signature
[]
byte
)
(
r
,
s
[]
byte
,
v
uint8
)
{
r
=
signature
[
:
32
]
s
=
signature
[
32
:
64
]
v
=
signature
[
64
]
return
}
func
CombineRSV
(
r
,
s
[]
byte
,
v
uint8
)
[]
byte
{
return
append
(
append
(
r
,
s
...
),
v
)
}
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