From b177028c19622ebf45f9942af4c7ee2d5b138f49 Mon Sep 17 00:00:00 2001 From: rongyi Date: Sat, 18 Sep 2021 16:59:52 +0800 Subject: [PATCH 1/2] Upgrade crypto version to 1.2.1 --- .gha.gofmt.sh | 16 ++++++++++++++++ .gha.gotest.sh | 10 ++++++++++ .github/workflows/pr.yml | 26 ++++++++++++++++++++++++++ account.go | 1 + client/client.go | 5 +++-- client/define.go | 3 ++- client/rest.go | 7 ++++--- client/rpc.go | 7 ++++--- client/ws.go | 9 +++++---- common/define.go | 3 ++- cred.go | 2 +- cred_jwt.go | 2 +- cred_jwt_test.go | 3 ++- cred_test.go | 3 ++- examples/wasm_example.go | 8 ++++---- go.mod | 2 +- go.sum | 20 ++++++++++++++++++++ identity.go | 3 ++- neovm_contract.go | 1 + oep4/oep4.go | 3 ++- oep4/oep4_test.go | 7 ++++--- oep4/types.go | 3 ++- ont_sdk.go | 9 +++++---- ont_sdk_test.go | 9 +++++---- utils/api.go | 1 + utils/utils.go | 7 ++++--- utils/websocket.go | 3 ++- wallet.go | 7 ++++--- wasmvm_contract.go | 1 + 29 files changed, 137 insertions(+), 44 deletions(-) create mode 100755 .gha.gofmt.sh create mode 100755 .gha.gotest.sh create mode 100644 .github/workflows/pr.yml diff --git a/.gha.gofmt.sh b/.gha.gofmt.sh new file mode 100755 index 0000000..7ef11af --- /dev/null +++ b/.gha.gofmt.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +which goimports || go install -v golang.org/x/tools/cmd/goimports + +unset dirs files +dirs=$(go list -f {{.Dir}} ./... | grep -v /vendor/) + +for d in $dirs +do + for f in $d/*.go + do + files="${files} $f" + done +done + +diff <(goimports -d $files) <(echo -n) diff --git a/.gha.gotest.sh b/.gha.gotest.sh new file mode 100755 index 0000000..4773fec --- /dev/null +++ b/.gha.gotest.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# code from https://github.com/Seklfreak/Robyul2 +unset dirs files +dirs=$(go list ./... | grep -v vendor/ | grep -v ontology-crypto$) +set -x -e + +for d in $dirs +do + go test -v $d +done diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..a9193a3 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,26 @@ +on: + # pull_request: + # branches: + # - master + + # push: + # branches: + # - fix-btcec-name + +jobs: + + build: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.15 + + - name: command + run: bash ./.gha.gofmt.sh + + - name: command + run: bash ./.gha.gotest.sh diff --git a/account.go b/account.go index a8fd091..8655342 100644 --- a/account.go +++ b/account.go @@ -21,6 +21,7 @@ import ( "crypto/elliptic" "encoding/hex" "fmt" + "github.com/ontio/ontology-crypto/ec" "github.com/ontio/ontology-crypto/keypair" s "github.com/ontio/ontology-crypto/signature" diff --git a/client/client.go b/client/client.go index 2bca457..34f65d5 100644 --- a/client/client.go +++ b/client/client.go @@ -21,6 +21,9 @@ import ( "encoding/hex" "encoding/json" "fmt" + "sync/atomic" + "time" + sdkcom "github.com/ontio/ontology-go-sdk/common" "github.com/ontio/ontology-go-sdk/utils" "github.com/ontio/ontology/common" @@ -28,8 +31,6 @@ import ( "github.com/ontio/ontology/core/types" bc "github.com/ontio/ontology/http/base/common" "github.com/tendermint/iavl" - "sync/atomic" - "time" ) type ClientMgr struct { diff --git a/client/define.go b/client/define.go index 54ed6ba..65921a2 100644 --- a/client/define.go +++ b/client/define.go @@ -19,8 +19,9 @@ package client import ( "encoding/json" - "github.com/ontio/ontology/core/types" "time" + + "github.com/ontio/ontology/core/types" ) type OntologyClient interface { diff --git a/client/rest.go b/client/rest.go index 42583ee..7bef395 100644 --- a/client/rest.go +++ b/client/rest.go @@ -22,15 +22,16 @@ import ( "encoding/hex" "encoding/json" "fmt" - "github.com/ontio/ontology-go-sdk/utils" - "github.com/ontio/ontology/common" - "github.com/ontio/ontology/core/types" "io" "io/ioutil" "net/http" "net/url" "strings" "time" + + "github.com/ontio/ontology-go-sdk/utils" + "github.com/ontio/ontology/common" + "github.com/ontio/ontology/core/types" ) //RpcClient for ontology rpc api diff --git a/client/rpc.go b/client/rpc.go index b9f477a..4fc49c1 100644 --- a/client/rpc.go +++ b/client/rpc.go @@ -24,12 +24,13 @@ import ( "encoding/hex" "encoding/json" "fmt" - "github.com/ontio/ontology-go-sdk/utils" - "github.com/ontio/ontology/common" - "github.com/ontio/ontology/core/types" "io/ioutil" "net/http" "time" + + "github.com/ontio/ontology-go-sdk/utils" + "github.com/ontio/ontology/common" + "github.com/ontio/ontology/core/types" ) //RpcClient for ontology rpc api diff --git a/client/ws.go b/client/ws.go index af0d78f..26c619e 100644 --- a/client/ws.go +++ b/client/ws.go @@ -21,14 +21,15 @@ import ( "encoding/hex" "encoding/json" "fmt" - sdkcom "github.com/ontio/ontology-go-sdk/common" - "github.com/ontio/ontology-go-sdk/utils" - "github.com/ontio/ontology/common" - "github.com/ontio/ontology/core/types" "math/rand" "strconv" "sync" "time" + + sdkcom "github.com/ontio/ontology-go-sdk/common" + "github.com/ontio/ontology-go-sdk/utils" + "github.com/ontio/ontology/common" + "github.com/ontio/ontology/core/types" ) type WSSubscribeStatus struct { diff --git a/common/define.go b/common/define.go index dcc9648..7ba3481 100644 --- a/common/define.go +++ b/common/define.go @@ -23,8 +23,9 @@ import ( "encoding/hex" "encoding/json" "fmt" - "github.com/ontio/ontology/common" "math/big" + + "github.com/ontio/ontology/common" ) var ( diff --git a/cred.go b/cred.go index 1126481..5b4c9d5 100644 --- a/cred.go +++ b/cred.go @@ -29,7 +29,7 @@ import ( "github.com/ontio/ontology-crypto/keypair" "github.com/ontio/ontology/common" "github.com/ontio/ontology/core/signature" - "github.com/satori/go.uuid" + uuid "github.com/satori/go.uuid" ) const ( diff --git a/cred_jwt.go b/cred_jwt.go index e0e29fa..a0ff037 100644 --- a/cred_jwt.go +++ b/cred_jwt.go @@ -23,12 +23,12 @@ import ( "encoding/hex" "encoding/json" "fmt" - "github.com/ontio/ontology/core/signature" "strings" "time" "github.com/ontio/ontology-crypto/keypair" "github.com/ontio/ontology/common" + "github.com/ontio/ontology/core/signature" uuid "github.com/satori/go.uuid" ) diff --git a/cred_jwt_test.go b/cred_jwt_test.go index 998e9a8..db0e897 100644 --- a/cred_jwt_test.go +++ b/cred_jwt_test.go @@ -21,9 +21,10 @@ package ontology_go_sdk import ( "encoding/json" "fmt" - "github.com/ontio/ontology/common" "testing" "time" + + "github.com/ontio/ontology/common" ) func TestJWTCredential(t *testing.T) { diff --git a/cred_test.go b/cred_test.go index 88bda81..df54d52 100644 --- a/cred_test.go +++ b/cred_test.go @@ -21,9 +21,10 @@ package ontology_go_sdk import ( "encoding/json" "fmt" - "github.com/ontio/ontology/common" "testing" "time" + + "github.com/ontio/ontology/common" ) type RelationshipCredential []*Relationship diff --git a/examples/wasm_example.go b/examples/wasm_example.go index b907532..a979f74 100644 --- a/examples/wasm_example.go +++ b/examples/wasm_example.go @@ -18,14 +18,14 @@ package main import ( + "encoding/binary" "fmt" - sdk "github.com/ontio/ontology-go-sdk" + "io/ioutil" + "time" - "encoding/binary" + sdk "github.com/ontio/ontology-go-sdk" "github.com/ontio/ontology-go-sdk/utils" "github.com/ontio/ontology/common" - "io/ioutil" - "time" ) func main() { diff --git a/go.mod b/go.mod index 8bb11c8..80fe966 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( github.com/itchyny/base58-go v0.1.0 github.com/ontio/go-bip32 v0.0.0-20190520025953-d3cea6894a2b github.com/ontio/ontology v1.14.0-beta.0.20210818114002-fedaf66010a7 - github.com/ontio/ontology-crypto v1.1.0 + github.com/ontio/ontology-crypto v1.2.1 github.com/ontio/ontology-eventbus v0.9.1 // indirect github.com/satori/go.uuid v1.2.0 github.com/stretchr/testify v1.6.1 diff --git a/go.sum b/go.sum index e42c7ce..0e827f0 100644 --- a/go.sum +++ b/go.sum @@ -64,12 +64,16 @@ github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnweb github.com/btcsuite/btcd v0.0.0-20171128150713-2e60448ffcc6/go.mod h1:Dmm/EzmjnCiweXmzRIAiUWCInVmPgjkzgv5k4tVyXiQ= github.com/btcsuite/btcd v0.20.1-beta h1:Ik4hyJqN8Jfyv3S4AGBOmyouMsYE3EdYODkMbQjwPGw= github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= +github.com/btcsuite/btcd v0.22.0-beta/go.mod h1:9n5ntfhhHQBIhUvlhDvD3Qg6fRUj4jkN0VB8L8svzOA= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= github.com/btcsuite/btcutil v1.0.2/go.mod h1:j9HUFwoQRsZL3V4n+qG+CUnEGHOarIxfC3Le2Yhbcts= +github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce/go.mod h1:0DVlHczLPewLcPGEIeUEzfOJhqGPQ0mJJRDBtD307+o= github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= +github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= +github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= @@ -105,6 +109,7 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea h1:j4317fAZh7X6GqbFowYdYdI0L9bwxL07jyPZIdepyZ0= github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= +github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dlclark/regexp2 v1.2.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= @@ -349,6 +354,7 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= @@ -358,6 +364,8 @@ github.com/ontio/ontology v1.14.0-beta.0.20210818114002-fedaf66010a7 h1:VPUc/qpB github.com/ontio/ontology v1.14.0-beta.0.20210818114002-fedaf66010a7/go.mod h1:nZBByr1/Xo1XYGRkHPMfkwaufxItHYvNi5+ljS4a8BE= github.com/ontio/ontology-crypto v1.1.0 h1:JxPfrbcN27IWRqyBb3jieHeWiKCTWDN0JPu0CpPdRAw= github.com/ontio/ontology-crypto v1.1.0/go.mod h1:AsW1qiMNNSHKp6uoAC4v1OeWleDiV1xNpfpsEw+l1sU= +github.com/ontio/ontology-crypto v1.2.1 h1:NG4U0WrQIGPzmYrvRnU398u8V6V3rXjpuUENnWT2TTY= +github.com/ontio/ontology-crypto v1.2.1/go.mod h1:GQ2fatGKGSSyuOHjpC47KhEeSEqUtoBRhVnftsbmzn8= github.com/ontio/ontology-eventbus v0.9.1 h1:nt3AXWx3gOyqtLiU4EwI92Yc4ik/pWHu9xRK15uHSOs= github.com/ontio/ontology-eventbus v0.9.1/go.mod h1:hCQIlbdPckcfykMeVUdWrqHZ8d30TBdmLfXCVWGkYhM= github.com/ontio/wagon v0.4.1 h1:3A8BxTMVGrQnyWxD1h8w5PLvN9GZMWjC75Jw+5Vgpe0= @@ -499,6 +507,7 @@ github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtX github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208/go.mod h1:IotVbo4F+mw0EzQ08zFqg7pK3FebNXpaMsRy2RT+Ees= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3 h1:MUGmc65QhB3pIlaQ5bB4LwqSj6GIonVJXpZiaKNyaKk= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= @@ -527,6 +536,7 @@ golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200311171314-f7b00557c8c4/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200406173513-056763e48d71/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200429183012-4b2356b1ed79/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -544,6 +554,8 @@ golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKG golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.1.1-0.20191209134235-331c550502dd/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= 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= @@ -569,6 +581,7 @@ golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -577,6 +590,7 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/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-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -604,9 +618,14 @@ golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200824131525-c12d262b63d8 h1:AvbQYmiaaaza3cW3QXRyPo5kYgpFIzOAfeAAN7m3qQ4= golang.org/x/sys v0.0.0-20200824131525-c12d262b63d8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= 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/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -627,6 +646,7 @@ golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117012304-6edc0a871e69/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.1.6/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/identity.go b/identity.go index 116a3f7..f870e06 100644 --- a/identity.go +++ b/identity.go @@ -23,12 +23,13 @@ import ( "crypto/sha256" "encoding/hex" "fmt" + "math/big" + base58 "github.com/itchyny/base58-go" "github.com/ontio/ontology-crypto/keypair" s "github.com/ontio/ontology-crypto/signature" "github.com/ontio/ontology/core/types" "golang.org/x/crypto/ripemd160" - "math/big" ) const ( diff --git a/neovm_contract.go b/neovm_contract.go index b7870dd..f9bc7b7 100644 --- a/neovm_contract.go +++ b/neovm_contract.go @@ -19,6 +19,7 @@ package ontology_go_sdk import ( "fmt" + sdkcom "github.com/ontio/ontology-go-sdk/common" "github.com/ontio/ontology/cmd/utils" "github.com/ontio/ontology/common" diff --git a/oep4/oep4.go b/oep4/oep4.go index bcb18d3..b1de84b 100644 --- a/oep4/oep4.go +++ b/oep4/oep4.go @@ -20,13 +20,14 @@ package oep4 import ( "encoding/hex" "fmt" + "math/big" + "github.com/ontio/ontology-crypto/keypair" ontology_go_sdk "github.com/ontio/ontology-go-sdk" scomm "github.com/ontio/ontology-go-sdk/common" "github.com/ontio/ontology-go-sdk/utils" "github.com/ontio/ontology/common" "github.com/ontio/ontology/core/types" - "math/big" ) type Oep4 struct { diff --git a/oep4/oep4_test.go b/oep4/oep4_test.go index be56634..6548826 100644 --- a/oep4/oep4_test.go +++ b/oep4/oep4_test.go @@ -19,14 +19,15 @@ package oep4 import ( "fmt" + "math/big" + "testing" + "time" + "github.com/ontio/ontology-crypto/keypair" ontology_go_sdk "github.com/ontio/ontology-go-sdk" "github.com/ontio/ontology-go-sdk/utils" "github.com/ontio/ontology/common" "github.com/ontio/ontology/core/types" - "math/big" - "testing" - "time" ) const scriptHash = "5e0aebb3dcc7af619e019a8f2195151d4d59644d" diff --git a/oep4/types.go b/oep4/types.go index 8fa3507..d78ea44 100644 --- a/oep4/types.go +++ b/oep4/types.go @@ -19,8 +19,9 @@ package oep4 import ( "fmt" - "github.com/ontio/ontology/common" "math/big" + + "github.com/ontio/ontology/common" ) type State struct { diff --git a/ont_sdk.go b/ont_sdk.go index 27fe49d..fbfb27f 100644 --- a/ont_sdk.go +++ b/ont_sdk.go @@ -22,13 +22,14 @@ package ontology_go_sdk import ( "encoding/hex" "fmt" + "io" + "math/rand" + "time" + "github.com/ontio/go-bip32" "github.com/ontio/ontology-go-sdk/bip44" "github.com/ontio/ontology/smartcontract/event" "github.com/tyler-smith/go-bip39" - "io" - "math/rand" - "time" "github.com/ontio/ontology-crypto/keypair" "github.com/ontio/ontology-go-sdk/client" @@ -79,7 +80,7 @@ func NewLayer2Sdk() *Layer2Sdk { sdk.ChainId = common3.LAYER2_SYSTEM_ID layer2Client := client.NewLayer2ClientMgr(&sdk.ClientMgr) return &Layer2Sdk{ - OntologySdk: sdk, + OntologySdk: sdk, Layer2ClientMgr: layer2Client, } } diff --git a/ont_sdk_test.go b/ont_sdk_test.go index 228d47b..b2313d0 100644 --- a/ont_sdk_test.go +++ b/ont_sdk_test.go @@ -21,6 +21,11 @@ package ontology_go_sdk import ( "encoding/hex" "fmt" + "math/rand" + "strconv" + "testing" + "time" + "github.com/ontio/ontology-crypto/signature" common2 "github.com/ontio/ontology-go-sdk/common" "github.com/ontio/ontology/common" @@ -31,10 +36,6 @@ import ( "github.com/ontio/ontology/smartcontract/service/native/ont" "github.com/stretchr/testify/assert" "github.com/tyler-smith/go-bip39" - "math/rand" - "strconv" - "testing" - "time" ) var ( diff --git a/utils/api.go b/utils/api.go index be1950b..2944dd9 100644 --- a/utils/api.go +++ b/utils/api.go @@ -21,6 +21,7 @@ import ( "encoding/hex" "encoding/json" "fmt" + sdkcom "github.com/ontio/ontology-go-sdk/common" "github.com/ontio/ontology/common" "github.com/ontio/ontology/core/payload" diff --git a/utils/utils.go b/utils/utils.go index ef0e733..921731a 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -21,14 +21,15 @@ package utils import ( "encoding/hex" "fmt" + "os" + "sort" + "strings" + "github.com/ontio/ontology-crypto/keypair" "github.com/ontio/ontology/common" "github.com/ontio/ontology/core/signature" "github.com/ontio/ontology/core/types" nvutils "github.com/ontio/ontology/smartcontract/service/native/utils" - "os" - "sort" - "strings" ) func TransactionFromHexString(rawTx string) (*types.Transaction, error) { diff --git a/utils/websocket.go b/utils/websocket.go index ac5692e..9b49985 100644 --- a/utils/websocket.go +++ b/utils/websocket.go @@ -20,8 +20,9 @@ package utils import ( "fmt" - "github.com/gorilla/websocket" "sync" + + "github.com/gorilla/websocket" ) //WebSocketClient use for client to operation web socket diff --git a/wallet.go b/wallet.go index cd5347f..60831d7 100644 --- a/wallet.go +++ b/wallet.go @@ -22,13 +22,14 @@ import ( "encoding/json" "errors" "fmt" + "io/ioutil" + "os" + "sync" + "github.com/ontio/ontology-crypto/keypair" s "github.com/ontio/ontology-crypto/signature" "github.com/ontio/ontology/common" "github.com/ontio/ontology/core/types" - "io/ioutil" - "os" - "sync" ) var DEFAULT_WALLET_NAME = "MyWallet" diff --git a/wasmvm_contract.go b/wasmvm_contract.go index dff63bf..a555e89 100644 --- a/wasmvm_contract.go +++ b/wasmvm_contract.go @@ -20,6 +20,7 @@ package ontology_go_sdk import ( "encoding/hex" "fmt" + sdkcom "github.com/ontio/ontology-go-sdk/common" utils2 "github.com/ontio/ontology/cmd/utils" "github.com/ontio/ontology/common" From 39c10f25016c495cbf53d49d4133a9a379b387a5 Mon Sep 17 00:00:00 2001 From: rongyi Date: Sat, 18 Sep 2021 17:02:12 +0800 Subject: [PATCH 2/2] Update pr --- .github/workflows/pr.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index a9193a3..d28b14b 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -1,9 +1,9 @@ on: - # pull_request: + pull_request: # branches: # - master - # push: + push: # branches: # - fix-btcec-name