common

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2026 License: MIT Imports: 21 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	FnAddUser                                   = "addUser"
	FnAddUserWithPublicKeyType                  = "addUserWithPublicKeyType"
	FnAddMultisig                               = "addMultisig"
	FnAddMultisigWithBase58Signature            = "addMultisigWithBase58Signature"
	FnAddToList                                 = "addToList"
	FnDelFromList                               = "delFromList"
	FnCheckKeys                                 = "checkKeys"
	FnGetAccInfoFn                              = "getAccountInfo"
	FnChangePublicKey                           = "changePublicKey"
	FnChangePublicKeyWithType                   = "changePublicKeyWithType"
	FnChangePublicKeyWithBase58Signature        = "changePublicKeyWithBase58Signature"
	FnChangePublicKeyWithTypeAndBase58Signature = "changePublicKeyWithTypeAndBase58Signature"
	FnChangeMultisigPublicKey                   = "changeMultisigPublicKey"
	FnSetKYC                                    = "setkyc"
	FnAddAdditionalKey                          = "addAdditionalKey"
	FnRemoveAdditionalKey                       = "removeAdditionalKey"
	FnGetAccountsInfo                           = "getAccountsInfo"
)

ACL API Functions

View Source
const (
	FnAddRights                  = "addRights"
	FnRemoveRights               = "removeRights"
	FnGetAccOpRight              = "getAccountOperationRight"
	FnGetAccAllRights            = "getAccountAllRights"
	FnGetOpAllRights             = "getOperationAllRights"
	FnAddAddressForNominee       = "addAddressForNominee"
	FnRemoveAddressFromNominee   = "removeAddressFromNominee"
	FnGetAddressRightForNominee  = "getAddressRightForNominee"
	FnGetAddressesListForNominee = "getAddressesListForNominee"
)

Access Matrix ACL API Functions

View Source
const (
	PubKey            = "aGGiDES6PZsZYz2ncsEXz8mXPxZRhVzMbgJFNAA7EA8"
	TestAddr          = "2datxk5TmB1spSNn9enVo11dcpgmUoSBSqCx5cCGoWq8qTbZog"
	TestAddrHashInHex = "d6c3f657cf3ee10f3ff5c8ada048758e07840a093a22e8eb0137ad3d2bc19007"
	TestWrongAddress  = "2ErXpMHdKbAVhVYZ28F9eSoZ1WYEYLhodeJNUxXyGyDeL9xKqt"
	TestCreatorMSP    = "platformMSP"
)
View Source
const (
	KeyTypeEd25519   = "ed25519"
	KeyTypeSecp256k1 = "secp256k1"
	KeyTypeGost      = "gost"
)
View Source
const (
	DefaultReason = "because..."
)

Variables

View Source
var (
	TestUsers = []TestSigner{
		{
			PublicKey:  "A4JdE9iZRzU9NEiVDNxYKKWymHeBxHR7mA8AetFrg8m4",
			PrivateKey: "3aDebSkgXq37VPrzThboaV8oMMbYXrRAt7hnGrod4PNMnGfXjh14TY7cQs8eVT46C4RK4ZyNKLrBmyD5CYZiFmkr",
			KeyType:    KeyTypeEd25519,
		},
		{
			PublicKey:  "5Tevazf8xxwyyKGku4VCCSVMDN56mU3mm2WsnENk1zv5",
			PrivateKey: "5D2BpuHZwik9zPFuaqba4zbvNP8TB7PQ6usZke5bufPbKf8xG6ZMHReBqwKw9aDfpTaNfaRsg1j2zVZWrX8hg18D",
			KeyType:    KeyTypeEd25519,
		},
		{
			PublicKey:  "6qFz88dv2R8sXmyzWPjvzN6jafv7t1kNUHztYKjH1Rd4",
			PrivateKey: "3sK2wHWxU58kzAeFtShDMsPm5Qh74NAWgfwCmdKyzvp4npivEDDEp14WgQpg7KGaVNF7qWyyMvkKPzGddVkxagNN",
			KeyType:    KeyTypeEd25519,
		},
	}

	TestUsersDifferentKeyTypes = []TestSigner{
		{
			PublicKey:  "A4JdE9iZRzU9NEiVDNxYKKWymHeBxHR7mA8AetFrg8m4",
			PrivateKey: "3aDebSkgXq37VPrzThboaV8oMMbYXrRAt7hnGrod4PNMnGfXjh14TY7cQs8eVT46C4RK4ZyNKLrBmyD5CYZiFmkr",
			KeyType:    KeyTypeEd25519,
		},
		{
			PublicKey:  "N4AmjUQajatSkH9k38vBkMp86WwRRMQ9B2yspj5ovbfJynD4dVUVZ2FBKdr7oDJ6AF6YDCD3qb47kmSwZge92LU1",
			PrivateKey: "42nRs6TVpkAa4K55A6F6sNJNMCXGTtfmbTwJtaD459Bp",
			KeyType:    KeyTypeSecp256k1,
		},
		{
			PublicKey:  "QdeZQ5jZAEL6icB1qwhwZ41FSDsYrgtWTfnZdaP4UnJrN6du6jDHFFphH44sq4hxuhvyHFeqNuMRD6FZwUvMihVR",
			PrivateKey: "GN8RvP2wRMCWfaCat7swGf37MtGFX67BTj3C6xrBqDMS",
			KeyType:    KeyTypeSecp256k1,
		},
	}

	TestAdminSKI = []byte("dc752d6afb51c33327b7873fdb08adb91de15ee7c88f4f9949445aeeb8ea4e99")

	TestInitConfig = &proto.ACLConfig{
		AdminSKIEncoded: string(TestAdminSKI),
		Validators: []*proto.ACLValidator{
			{
				PublicKey: TestUsersDifferentKeyTypes[0].PublicKey,
				KeyType:   TestUsersDifferentKeyTypes[0].KeyType,
			},
			{
				PublicKey: TestUsersDifferentKeyTypes[1].PublicKey,
				KeyType:   TestUsersDifferentKeyTypes[1].KeyType,
			},
			{
				PublicKey: TestUsersDifferentKeyTypes[2].PublicKey,
				KeyType:   TestUsersDifferentKeyTypes[2].KeyType,
			},
		},
	}

	AdminCert = "" /* 864-byte string literal not displayed */
	UserCert  = "" /* 864-byte string literal not displayed */

	// MockUsersKeys stores pubkey -> secret key mapping
	MockUsersKeys = map[string]string{
		TestUsers[0].PublicKey: TestUsers[0].PrivateKey,
		TestUsers[1].PublicKey: TestUsers[1].PrivateKey,
		TestUsers[2].PublicKey: TestUsers[2].PrivateKey,
	}

	MockValidatorsKeys = map[string]string{
		TestUsersDifferentKeyTypes[0].PublicKey: TestUsersDifferentKeyTypes[0].PrivateKey,
		TestUsersDifferentKeyTypes[1].PublicKey: TestUsersDifferentKeyTypes[1].PrivateKey,
		TestUsersDifferentKeyTypes[2].PublicKey: TestUsersDifferentKeyTypes[2].PrivateKey,
	}

	DuplicateMockUsersSecretKeys = []string{
		TestUsers[0].PrivateKey,
		TestUsers[1].PrivateKey,
		TestUsers[1].PrivateKey,
		TestUsers[1].PrivateKey,
	}
)

Functions

func Base58EncodedSignature

func Base58EncodedSignature(privateKey []byte, message []byte) []byte

func GenerateTestValidatorSignatures

func GenerateTestValidatorSignatures(pKeys []string, digest []byte) (vpKeys [][]byte, vSignatures [][]byte)

GenerateTestValidatorSignatures returns test validator signatures

func HexEncodedSignature

func HexEncodedSignature(privateKey []byte, message []byte) []byte

func MarshalIdentity

func MarshalIdentity(creatorMSP string, creatorCert []byte) ([]byte, error)

MarshalIdentity marshals creator identities

func NewMockStub added in v0.0.9

func NewMockStub(t *testing.T) (*mock.ChaincodeStub, []byte)

func SetCert added in v0.0.9

func SetCert(t *testing.T, mockStub *mock.ChaincodeStub, cert string)

Types

type FiatToken

type FiatToken struct {
	token.BaseToken
}

FiatToken - base struct

func NewFiatToken

func NewFiatToken() *FiatToken

NewFiatToken creates fiat token

func (*FiatToken) QueryGetAddressRightForNominee

func (mt *FiatToken) QueryGetAddressRightForNominee(channel, chaincode, nominee, principal string) (bool, error)

func (*FiatToken) QueryGetRight

func (mt *FiatToken) QueryGetRight(channel, chaincode, role, operation, address string) (bool, error)

func (*FiatToken) TxEmit

func (mt *FiatToken) TxEmit(sender *types.Sender, address *types.Address, amount *big.Int) error

TxEmit - emits fiat token

type TestSigner

type TestSigner struct {
	PublicKey  string
	PrivateKey string
	KeyType    string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL