Skip to content

Commit

Permalink
ACL refactoring
Browse files Browse the repository at this point in the history
Goimports
  • Loading branch information
AtapinDmitry committed Apr 11, 2024
1 parent 4db7658 commit adab95a
Show file tree
Hide file tree
Showing 20 changed files with 52 additions and 52 deletions.
2 changes: 1 addition & 1 deletion cc/access_matrix.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package cc

import (
"fmt"

"github.com/anoideaopen/acl/cc/errs"
"github.com/anoideaopen/acl/helpers"

pb "github.com/anoideaopen/foundation/proto"
"github.com/golang/protobuf/proto" //nolint:staticcheck
"github.com/hyperledger/fabric-chaincode-go/shim"
Expand Down
2 changes: 1 addition & 1 deletion cc/blocked_lists.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package cc

import (
"fmt"
"github.com/anoideaopen/acl/cc/errs"

"github.com/anoideaopen/acl/cc/compositekey"
"github.com/anoideaopen/acl/cc/errs"
pb "github.com/anoideaopen/foundation/proto"
"github.com/golang/protobuf/proto" //nolint:staticcheck
"github.com/hyperledger/fabric-chaincode-go/shim"
Expand Down
2 changes: 1 addition & 1 deletion cc/chaincode.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package cc

import (
"fmt"
"github.com/anoideaopen/acl/helpers"
"math/big"
"reflect"
"runtime/debug"

"github.com/anoideaopen/acl/helpers"
"github.com/anoideaopen/acl/proto"
"github.com/hyperledger/fabric-chaincode-go/shim"
"github.com/hyperledger/fabric-protos-go/peer"
Expand Down
2 changes: 1 addition & 1 deletion cc/initargs.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"encoding/hex"
"errors"
"fmt"
"github.com/anoideaopen/acl/helpers"
"strconv"

"github.com/anoideaopen/acl/helpers"
"github.com/anoideaopen/acl/proto"
pb "github.com/golang/protobuf/proto" //nolint:staticcheck
"github.com/hyperledger/fabric-chaincode-go/shim"
Expand Down
22 changes: 11 additions & 11 deletions tests/add_multisig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ import (
"golang.org/x/crypto/sha3"
)

type serieAddMultisig struct {
type seriesAddMultisig struct {
testPubKey string
errorMsg string
}

// add dinamyc errorMsg in serie
func (s *serieAddMultisig) SetError(errMsg string) {
// add dynamic errorMsg in serie
func (s *seriesAddMultisig) SetError(errMsg string) {
s.errorMsg = errMsg
}

func TestAddMultisigPubkeyEqual43Symbols(t *testing.T) {
t.Parallel()
s := &serieAddMultisig{
s := &seriesAddMultisig{
testPubKey: "Cv8S2Y7pDT74AUma95Fdy6ZUX5NBVTQR7WRbdq46VR2",
errorMsg: errs.ErrRecordsNotFound,
}
Expand All @@ -43,7 +43,7 @@ func TestAddMultisigPubkeyEqual43Symbols(t *testing.T) {

func TestAddMultisigPubkeyEqual44Symbols(t *testing.T) {
t.Parallel()
s := &serieAddMultisig{
s := &seriesAddMultisig{
testPubKey: "Cv8S2Y7pDT74AUma95Fdy6ZUX5NBVTQR7WRbdq46VR2z",
errorMsg: errs.ErrRecordsNotFound,
}
Expand All @@ -53,7 +53,7 @@ func TestAddMultisigPubkeyEqual44Symbols(t *testing.T) {

func TestAddMultisigPubkeyEmpty(t *testing.T) {
t.Parallel()
s := &serieAddMultisig{
s := &seriesAddMultisig{
testPubKey: "",
errorMsg: "encoded base 58 public key is empty",
}
Expand All @@ -64,7 +64,7 @@ func TestAddMultisigPubkeyEmpty(t *testing.T) {
func TestAddMultisigPubkeyMoreThan44Symbols(t *testing.T) {
t.Parallel()

s := &serieAddMultisig{
s := &seriesAddMultisig{
testPubKey: "Cv8S2Y7pDT74AUma95Fdy6ZUX5NBVTQR7WRbdq46VR2zV",
}

Expand All @@ -78,7 +78,7 @@ func TestAddMultisigPubkeyMoreThan44Symbols(t *testing.T) {
func TestAddMultisigPubkeyLessThan43Symbols(t *testing.T) {
t.Parallel()

s := &serieAddMultisig{
s := &seriesAddMultisig{
testPubKey: "Cv8S2Y7pDT74AUma95Fdy6ZUX5NBVTQR7WRbdq46VR",
}

Expand All @@ -92,7 +92,7 @@ func TestAddMultisigPubkeyLessThan43Symbols(t *testing.T) {
func TestAddMultisigPubkeyWrongNumericZero(t *testing.T) {
t.Parallel()

s := &serieAddMultisig{
s := &seriesAddMultisig{
testPubKey: "00000000000000000000000000000000",
}

Expand All @@ -105,7 +105,7 @@ func TestAddMultisigPubkeyWrongNumericZero(t *testing.T) {
func TestAddMultisigPubkeyWithSpesialSymbols(t *testing.T) {
t.Parallel()

s := &serieAddMultisig{
s := &seriesAddMultisig{
testPubKey: "Abracadabra#$)*&@=+^%~AbracadabraAbracadabra",
}

Expand All @@ -115,7 +115,7 @@ func TestAddMultisigPubkeyWithSpesialSymbols(t *testing.T) {
addMultisig(t, s)
}

func addMultisig(t *testing.T, ser *serieAddMultisig) {
func addMultisig(t *testing.T, ser *seriesAddMultisig) {
stub := common.StubCreateAndInit(t)

pubKeys := make([]string, 0, len(common.MockValidatorKeys))
Expand Down
2 changes: 1 addition & 1 deletion tests/add_user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package tests
import (
"encoding/hex"
"fmt"
"github.com/anoideaopen/acl/tests/common"
"testing"

"github.com/anoideaopen/acl/tests/common"
pb "github.com/anoideaopen/foundation/proto"
"github.com/btcsuite/btcutil/base58"
"github.com/golang/protobuf/proto" //nolint:staticcheck
Expand Down
2 changes: 1 addition & 1 deletion tests/additional_keys_test.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package tests

import (
"github.com/anoideaopen/acl/tests/common"
"strconv"
"strings"
"testing"
"time"

"github.com/anoideaopen/acl/tests/common"
pb "github.com/anoideaopen/foundation/proto"
"github.com/golang/protobuf/proto"
"github.com/hyperledger/fabric-chaincode-go/shim"
Expand Down
4 changes: 2 additions & 2 deletions tests/cert_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package tests

import (
"github.com/anoideaopen/acl/cc/errs"
"github.com/anoideaopen/acl/tests/common"
"testing"

"github.com/anoideaopen/acl/cc/errs"
"github.com/anoideaopen/acl/tests/common"
"github.com/hyperledger/fabric-chaincode-go/shim"
"github.com/stretchr/testify/assert"
)
Expand Down
6 changes: 3 additions & 3 deletions tests/change_multisig_public_key_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ package tests
import (
"bytes"
"encoding/hex"
"github.com/anoideaopen/acl/cc/errs"
"github.com/anoideaopen/acl/helpers"
"github.com/anoideaopen/acl/tests/common"
"strconv"
"strings"
"testing"
"time"

"github.com/anoideaopen/acl/cc/errs"
"github.com/anoideaopen/acl/helpers"
"github.com/anoideaopen/acl/tests/common"
pb "github.com/anoideaopen/foundation/proto"
"github.com/btcsuite/btcutil/base58"
"github.com/golang/protobuf/proto" //nolint:staticcheck
Expand Down
6 changes: 3 additions & 3 deletions tests/change_public_key_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ package tests

import (
"encoding/hex"
"github.com/anoideaopen/acl/cc/errs"
"github.com/anoideaopen/acl/helpers"
"github.com/anoideaopen/acl/tests/common"
"strconv"
"strings"
"testing"
"time"

"github.com/anoideaopen/acl/cc/errs"
"github.com/anoideaopen/acl/helpers"
"github.com/anoideaopen/acl/tests/common"
pb "github.com/anoideaopen/foundation/proto"
"github.com/btcsuite/btcutil/base58"
"github.com/golang/protobuf/proto" //nolint:staticcheck
Expand Down
2 changes: 1 addition & 1 deletion tests/change_public_key_with_base58_sgnature_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import (
"crypto/ed25519"
"crypto/rand"
"fmt"
"github.com/anoideaopen/acl/tests/common"
"strconv"
"strings"
"testing"
"time"

"github.com/anoideaopen/acl/tests/common"
"github.com/btcsuite/btcutil/base58"
"github.com/hyperledger/fabric-chaincode-go/shim"
"github.com/stretchr/testify/assert"
Expand Down
4 changes: 2 additions & 2 deletions tests/check_address_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package tests

import (
"github.com/anoideaopen/acl/cc/errs"
"github.com/anoideaopen/acl/tests/common"
"testing"

"github.com/anoideaopen/acl/cc/errs"
"github.com/anoideaopen/acl/tests/common"
pb "github.com/anoideaopen/foundation/proto"
"github.com/btcsuite/btcutil/base58"
"github.com/golang/protobuf/proto" //nolint:staticcheck
Expand Down
4 changes: 2 additions & 2 deletions tests/check_keys_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package tests

import (
"github.com/anoideaopen/acl/cc/errs"
"github.com/anoideaopen/acl/tests/common"
"testing"

"github.com/anoideaopen/acl/cc/errs"
"github.com/anoideaopen/acl/tests/common"
pb "github.com/anoideaopen/foundation/proto"
"github.com/golang/protobuf/proto" //nolint:staticcheck
"github.com/hyperledger/fabric-chaincode-go/shim"
Expand Down
2 changes: 1 addition & 1 deletion tests/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"encoding/hex"
"encoding/pem"
"fmt"
"github.com/anoideaopen/acl/cc"
"strconv"
"testing"

"github.com/anoideaopen/acl/cc"
"github.com/btcsuite/btcutil/base58"
"github.com/golang/protobuf/proto" //nolint:staticcheck
"github.com/hyperledger/fabric-chaincode-go/shim"
Expand Down
4 changes: 2 additions & 2 deletions tests/get_account_info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package tests

import (
"encoding/json"
"github.com/anoideaopen/acl/cc/errs"
"github.com/anoideaopen/acl/tests/common"
"testing"

"github.com/anoideaopen/acl/cc/errs"
"github.com/anoideaopen/acl/tests/common"
pb "github.com/anoideaopen/foundation/proto"
"github.com/hyperledger/fabric-chaincode-go/shim"
"github.com/hyperledger/fabric-chaincode-go/shimtest" //nolint:staticcheck
Expand Down
2 changes: 1 addition & 1 deletion tests/get_adresses_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package tests

import (
"github.com/anoideaopen/acl/tests/common"
"testing"

"github.com/anoideaopen/acl/tests/common"
pb "github.com/anoideaopen/foundation/proto"
"github.com/golang/protobuf/proto" //nolint:staticcheck
"github.com/hyperledger/fabric-chaincode-go/shim"
Expand Down
4 changes: 2 additions & 2 deletions tests/gray_list_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package tests

import (
"testing"

"github.com/anoideaopen/acl/cc"
"github.com/anoideaopen/acl/cc/errs"
"github.com/anoideaopen/acl/tests/common"
"testing"

pb "github.com/anoideaopen/foundation/proto"
"github.com/golang/protobuf/proto" //nolint:staticcheck
"github.com/hyperledger/fabric-chaincode-go/shim"
Expand Down
2 changes: 1 addition & 1 deletion tests/multisign_base58_signature_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package tests

import (
"github.com/anoideaopen/acl/helpers"
"testing"

"github.com/anoideaopen/acl/helpers"
"github.com/stretchr/testify/require"
)

Expand Down
Loading

0 comments on commit adab95a

Please sign in to comment.