Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sidecar
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
sidecar
Commits
79c7cd66
Commit
79c7cd66
authored
Nov 22, 2021
by
suyanlong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace for encoding/json package
parent
4d92091a
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
63 additions
and
36 deletions
+63
-36
Makefile
Makefile
+1
-1
appchain.go
cmd/sidecar/appchain.go
+1
-1
appchain.go
cmd/sidecar/client/appchain.go
+1
-1
go.mod
go.mod
+25
-18
go.sum
go.sum
+0
-0
checker_test.go
internal/checker/checker_test.go
+1
-1
manager.go
internal/manger/manager.go
+1
-2
persister.go
internal/manger/persister.go
+2
-2
handle.go
internal/rulemgr/handle.go
+1
-2
syncer.go
internal/syncer/syncer.go
+1
-1
syncer_test.go
internal/syncer/syncer_test.go
+1
-1
ibtpx_test.go
model/pb/ibtpx_test.go
+8
-0
receipt.go
model/pb/receipt.go
+2
-1
bls.go
pkg/crypto/bls/bls.go
+1
-0
json.go
pkg/json/json.go
+10
-0
fabric_validation.go
pkg/validator/validatorlib/fabric_validation.go
+1
-1
wasm_validator.go
pkg/validator/wasm_validator.go
+1
-1
wasm_validator_test.go
pkg/validator/wasm_validator_test.go
+1
-1
wasm.go
pkg/wasm/wasm.go
+1
-1
wasm_test.go
pkg/wasm/wasm_test.go
+1
-1
tool.go
tool/tool.go
+2
-0
No files found.
Makefile
View file @
79c7cd66
...
...
@@ -41,7 +41,7 @@ NC=\033[0m
build
:
packr
@
mkdir
-p
bin
rm
-f
imports/imports.go
$(GO)
build
-ldflags
'${GOLDFLAGS}'
./cmd/
${
APP_NAME
}
$(GO)
build
-
tags
=
go_json
-
ldflags
'${GOLDFLAGS}'
./cmd/
${
APP_NAME
}
@
mv
./sidecar bin
@
printf
"
${
GREEN
}
Build sidecar successfully!
${
NC
}
\n
"
...
...
cmd/sidecar/appchain.go
View file @
79c7cd66
...
...
@@ -2,7 +2,6 @@ package main
import
(
"encoding/base64"
"encoding/json"
"fmt"
"io/ioutil"
"path/filepath"
...
...
@@ -16,6 +15,7 @@ import (
rpcx
"gitlab.33.cn/link33/sidecar/hub/client"
"gitlab.33.cn/link33/sidecar/internal/repo"
"gitlab.33.cn/link33/sidecar/model/constant"
"gitlab.33.cn/link33/sidecar/pkg/json"
)
var
appchainBxhCMD
=
cli
.
Command
{
...
...
cmd/sidecar/client/appchain.go
View file @
79c7cd66
package
client
import
(
"encoding/json"
"fmt"
"io/ioutil"
"strconv"
...
...
@@ -12,6 +11,7 @@ import (
"github.com/urfave/cli"
"gitlab.33.cn/link33/sidecar/internal/repo"
"gitlab.33.cn/link33/sidecar/pkg/json"
)
type
Approve
struct
{
...
...
go.mod
View file @
79c7cd66
...
...
@@ -10,6 +10,7 @@ require (
github.com/bits-and-blooms/bloom/v3 v3.1.0
github.com/btcsuite/btcd v0.21.0-beta
github.com/bxcodec/faker/v3 v3.6.0
github.com/casbin/casbin v1.9.1
github.com/cbergoon/merkletree v0.2.0
github.com/creasty/defaults v1.5.2
github.com/deckarep/golang-set v1.7.2-0.20201129021324-03b572015f8e
...
...
@@ -18,13 +19,18 @@ require (
github.com/fatih/color v1.12.0
github.com/fsnotify/fsnotify v1.4.9
github.com/gammazero/deque v0.1.0
github.com/gin-gonic/gin v1.6.3
github.com/gin-contrib/authz v0.0.0-20211106112157-2a70df09d207
github.com/gin-contrib/gzip v0.0.3
github.com/gin-contrib/requestid v0.0.1
github.com/gin-contrib/timeout v0.0.2
github.com/gin-gonic/gin v1.7.7
github.com/gobuffalo/packd v1.0.0
github.com/gobuffalo/packr v1.30.1
github.com/goccy/go-json v0.7.10
github.com/gogo/protobuf v1.3.2
github.com/golang/mock v1.5.0
github.com/golang/protobuf v1.
4.3
github.com/google/go-cmp v0.5.
0
github.com/golang/protobuf v1.
5.2
github.com/google/go-cmp v0.5.
5
github.com/gookit/goutil v0.3.15
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd
...
...
@@ -68,15 +74,16 @@ require (
require (
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible // indirect
github.com/casbin/casbin/v2 v2.37.0 // indirect
github.com/coreos/go-semver v0.3.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/davidlazar/go-crypto v0.0.0-20190912175916-7055855a373f // indirect
github.com/dgryski/go-metro v0.0.0-20200812162917-85c65e2d0165 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-playground/locales v0.1
3
.0 // indirect
github.com/go-playground/universal-translator v0.1
7
.0 // indirect
github.com/go-playground/validator/v10 v10.
2
.0 // indirect
github.com/go-playground/locales v0.1
4
.0 // indirect
github.com/go-playground/universal-translator v0.1
8
.0 // indirect
github.com/go-playground/validator/v10 v10.
9
.0 // indirect
github.com/gobuffalo/envy v1.7.0 // indirect
github.com/golang/snappy v0.0.2-0.20200707131729-196ae77b8a26 // indirect
github.com/google/gopacket v1.1.17 // indirect
...
...
@@ -97,10 +104,10 @@ require (
github.com/jbenet/go-temp-err-catcher v0.1.0 // indirect
github.com/jbenet/goprocess v0.1.4 // indirect
github.com/joho/godotenv v1.3.0 // indirect
github.com/json-iterator/go v1.1.1
1
// indirect
github.com/json-iterator/go v1.1.1
2
// indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect
github.com/koron/go-ssdp v0.0.0-20191105050749-2e1c40ed0b5d // indirect
github.com/leodido/go-urn v1.2.
0
// indirect
github.com/leodido/go-urn v1.2.
1
// indirect
github.com/lestrrat-go/strftime v1.0.0 // indirect
github.com/libp2p/go-addr-util v0.0.2 // indirect
github.com/libp2p/go-buffer-pool v0.0.2 // indirect
...
...
@@ -147,7 +154,7 @@ require (
github.com/minio/sha256-simd v0.1.1 // indirect
github.com/mitchellh/go-testing-interface v1.0.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.
1
// indirect
github.com/modern-go/reflect2 v1.0.
2
// indirect
github.com/mr-tron/base58 v1.1.3 // indirect
github.com/multiformats/go-base32 v0.0.3 // indirect
github.com/multiformats/go-base36 v0.1.0 // indirect
...
...
@@ -163,7 +170,7 @@ require (
github.com/pelletier/go-toml v1.2.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rogpeppe/go-internal v1.
3
.0 // indirect
github.com/rogpeppe/go-internal v1.
8
.0 // indirect
github.com/russross/blackfriday/v2 v2.0.1 // indirect
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 // indirect
...
...
@@ -176,7 +183,7 @@ require (
github.com/syndtr/goleveldb v1.0.1-0.20210305035536-64b5b1c73954 // indirect
github.com/tidwall/match v1.0.3 // indirect
github.com/tidwall/pretty v1.0.2 // indirect
github.com/ugorji/go/codec v1.
1.7
// indirect
github.com/ugorji/go/codec v1.
2.6
// indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 // indirect
github.com/whyrusleeping/multiaddr-filter v0.0.0-20160516205228-e903e4adabd7 // indirect
...
...
@@ -184,14 +191,14 @@ require (
go.uber.org/atomic v1.6.0 // indirect
go.uber.org/multierr v1.5.0 // indirect
go.uber.org/zap v1.15.0 // indirect
golang.org/x/crypto v0.0.0-202
01221181555-eec23a3978ad
// indirect
golang.org/x/net v0.0.0-202
01021035429-f5854403a974
// indirect
golang.org/x/sys v0.0.0-2021
0909193231-528a39cd75f3
// indirect
golang.org/x/text v0.3.
3
// indirect
google.golang.org/protobuf v1.2
5.0
// indirect
golang.org/x/crypto v0.0.0-202
11117183948-ae814b36b871
// indirect
golang.org/x/net v0.0.0-202
11112202133-69e39bad7dc2
// indirect
golang.org/x/sys v0.0.0-2021
1124211545-fe61309f8881
// indirect
golang.org/x/text v0.3.
7
// indirect
google.golang.org/protobuf v1.2
7.1
// indirect
gopkg.in/ini.v1 v1.51.0 // indirect
gopkg.in/yaml.v2 v2.
3
.0 // indirect
gopkg.in/yaml.v3 v3.0.0-202
00605160147-a5ece683394c
// indirect
gopkg.in/yaml.v2 v2.
4
.0 // indirect
gopkg.in/yaml.v3 v3.0.0-202
10107192922-496545a6307b
// indirect
)
replace github.com/libp2p/go-libp2p-core => github.com/libp2p/go-libp2p-core v0.5.6
...
...
go.sum
View file @
79c7cd66
This diff is collapsed.
Click to expand it.
internal/checker/checker_test.go
View file @
79c7cd66
package
checker
import
(
"encoding/json"
"io/ioutil"
"testing"
"time"
...
...
@@ -10,6 +9,7 @@ import (
"github.com/stretchr/testify/require"
"gitlab.33.cn/link33/sidecar/model/pb"
"gitlab.33.cn/link33/sidecar/pkg/json"
)
const
(
...
...
internal/manger/manager.go
View file @
79c7cd66
package
manger
import
(
"encoding/json"
appchainmgr
"github.com/meshplus/bitxhub-core/appchain-mgr"
"github.com/sirupsen/logrus"
"gitlab.33.cn/link33/sidecar/internal/peermgr"
"gitlab.33.cn/link33/sidecar/internal/port"
"gitlab.33.cn/link33/sidecar/model/pb"
"gitlab.33.cn/link33/sidecar/pkg/json"
)
type
Manager
struct
{
...
...
internal/manger/persister.go
View file @
79c7cd66
package
manger
import
(
"encoding/json"
"github.com/meshplus/bitxhub-core/governance"
"github.com/meshplus/bitxhub-kit/storage"
"github.com/sirupsen/logrus"
"gitlab.33.cn/link33/sidecar/pkg/json"
)
var
_
governance
.
Persister
=
(
*
Persister
)(
nil
)
...
...
internal/rulemgr/handle.go
View file @
79c7cd66
package
rulemgr
import
(
"encoding/json"
"github.com/meshplus/bitxhub-kit/types"
"gitlab.33.cn/link33/sidecar/internal/port"
"gitlab.33.cn/link33/sidecar/model/pb"
"gitlab.33.cn/link33/sidecar/pkg/json"
)
func
(
rm
*
RuleMgr
)
HandleRule
(
p
port
.
Port
,
msg
*
pb
.
Message
)
{
...
...
internal/syncer/syncer.go
View file @
79c7cd66
...
...
@@ -2,7 +2,6 @@ package syncer
import
(
"context"
"encoding/json"
"fmt"
"strconv"
"sync/atomic"
...
...
@@ -18,6 +17,7 @@ import (
rpcx
"gitlab.33.cn/link33/sidecar/hub/client"
"gitlab.33.cn/link33/sidecar/internal/lite"
"gitlab.33.cn/link33/sidecar/model/pb"
"gitlab.33.cn/link33/sidecar/pkg/json"
)
var
_
Syncer
=
(
*
WrapperSyncer
)(
nil
)
...
...
internal/syncer/syncer_test.go
View file @
79c7cd66
...
...
@@ -4,7 +4,6 @@ import (
"bytes"
"context"
"crypto/sha256"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
...
...
@@ -28,6 +27,7 @@ import (
"gitlab.33.cn/link33/sidecar/internal/repo"
"gitlab.33.cn/link33/sidecar/model/constant"
"gitlab.33.cn/link33/sidecar/model/pb"
"gitlab.33.cn/link33/sidecar/pkg/json"
"gitlab.33.cn/link33/sidecar/pkg/log"
)
...
...
model/pb/ibtpx_test.go
View file @
79c7cd66
...
...
@@ -130,3 +130,11 @@ func testAggVerify(ibtpx *IBTPX) bool {
//3、接收者作为结速点(中间点);
//4、中继链裁决方分配(裁决)。
//裁决方案:奖励金额最大、路由节点最少、速度最快方案裁决。
//不同私钥对各自公钥的证明可以聚合。
//不同私钥对不同消息的证明可以聚合。
//不同私钥对不同消息的证明可以聚合。
//不同私钥对相同消息的证明可以聚合。
//相同私钥对不同消息的证明可以聚合。
//无证书聚合签名方案
model/pb/receipt.go
View file @
79c7cd66
...
...
@@ -2,10 +2,11 @@ package pb
import
(
"crypto/sha256"
"encoding/json"
"github.com/meshplus/bitxhub-kit/hexutil"
"github.com/meshplus/bitxhub-kit/types"
"gitlab.33.cn/link33/sidecar/pkg/json"
)
func
(
m
*
Receipt
)
Hash
()
*
types
.
Hash
{
...
...
pkg/crypto/bls/bls.go
View file @
79c7cd66
...
...
@@ -26,6 +26,7 @@ func init() {
)
}
// Verify TODO fix bug
func
Verify
(
opt
crypto
.
KeyType
,
sig
,
digest
[]
byte
,
from
types
.
Address
)
(
bool
,
error
)
{
if
len
(
sig
)
==
0
{
return
false
,
fmt
.
Errorf
(
"empty sig data"
)
...
...
pkg/json/json.go
0 → 100644
View file @
79c7cd66
package
json
import
json
"github.com/goccy/go-json"
var
(
Marshal
=
json
.
Marshal
Unmarshal
=
json
.
Unmarshal
)
pkg/validator/validatorlib/fabric_validation.go
View file @
79c7cd66
package
validatorlib
import
(
"encoding/json"
"fmt"
"gitlab.33.cn/link33/sidecar/pkg/json"
"strings"
"github.com/gogo/protobuf/proto"
...
...
pkg/validator/wasm_validator.go
View file @
79c7cd66
package
validator
import
(
"encoding/json"
"fmt"
"gitlab.33.cn/link33/sidecar/pkg/json"
"strconv"
"sync"
...
...
pkg/validator/wasm_validator_test.go
View file @
79c7cd66
package
validator
import
(
"
encodin
g/json"
"
gitlab.33.cn/link33/sidecar/pk
g/json"
"fmt"
"io/ioutil"
"strconv"
...
...
pkg/wasm/wasm.go
View file @
79c7cd66
package
wasm
import
(
"encoding/json"
"fmt"
"gitlab.33.cn/link33/sidecar/pkg/json"
"strconv"
"sync"
...
...
pkg/wasm/wasm_test.go
View file @
79c7cd66
package
wasm
import
(
"
encodin
g/json"
"
gitlab.33.cn/link33/sidecar/pk
g/json"
"fmt"
"io/ioutil"
"sync"
...
...
tool/tool.go
View file @
79c7cd66
...
...
@@ -74,3 +74,5 @@ func Exist(path string) bool {
//Scan git repos (or files) for secrets using regex and entropy 🔑
//https://github.com/zricethezav/gitleaks
//https://github.com/casbin/casbin
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