Documentation
¶
Index ¶
- Constants
- Variables
- func Base58EncodedSignature(privateKey []byte, message []byte) []byte
- func GenerateTestValidatorSignatures(pKeys []string, digest []byte) (vpKeys [][]byte, vSignatures [][]byte)
- func GetCert(certPath string) (*x509.Certificate, error)
- func HexEncodedSignature(privateKey []byte, message []byte) []byte
- func MarshalIdentity(creatorMSP string, creatorCert []byte) ([]byte, error)
- func SetCreator(stub *shimtest.MockStub, creatorMSP string, creatorCert []byte) error
- func StubCreate(t *testing.T) *shimtest.MockStub
- func StubCreateAndInit(t *testing.T) *shimtest.MockStub
- func VerifySignature(publicKey []byte, message []byte, signature []byte) bool
- type FiatToken
- type TestSigner
Constants ¶
View Source
const ( FnAddUser = "addUser" FnAddUserWithPublicKeyType = "addUserWithPublicKeyType" FnGetUser = "getUser" FnAddMultisig = "addMultisig" FnAddMultisigWithBase58Signature = "addMultisigWithBase58Signature" FnAddToList = "addToList" FnDelFromList = "delFromList" FnCheckKeys = "checkKeys" FnGetAccInfoFn = "getAccountInfo" FnChangePublicKey = "changePublicKey" FnChangeMultisigPublicKey = "changeMultisigPublicKey" FnSetKYC = "setkyc" FnAddAdditionalKey = "addAdditionalKey" FnRemoveAdditionalKey = "removeAdditionalKey" )
ACL API Functions
View Source
const ( FnAddRights = "addRights" FnRemoveRights = "removeRights" FnGetAccOpRight = "getAccountOperationRight" FnGetAccAllRights = "getAccountAllRights" FnGetOpAllRights = "getOperationAllRights" )
Access Matrix ACL API Functions
View Source
const ( PubKey = "aGGiDES6PZsZYz2ncsEXz8mXPxZRhVzMbgJFNAA7EA8" TestAddr = "2datxk5TmB1spSNn9enVo11dcpgmUoSBSqCx5cCGoWq8qTbZog" TestWrongAddress = "2ErXpMHdKbAVhVYZ28F9eSoZ1WYEYLhodeJNUxXyGyDeL9xKqt" TestCreatorMSP = "platformMSP" )
View Source
const ( KeyTypeEd25519 = "ed25519" KeyTypeSecp256k1 = "secp256k1" )
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: "5Tevazf8xxwyyKGku4VCCSVMDN56mU3mm2WsnENk1zv5", PrivateKey: "5D2BpuHZwik9zPFuaqba4zbvNP8TB7PQ6usZke5bufPbKf8xG6ZMHReBqwKw9aDfpTaNfaRsg1j2zVZWrX8hg18D", KeyType: KeyTypeEd25519, }, { PublicKey: "4DorLT9cRqaUeiDsBtDmm2Gwz18CqGsLn3f4eNLPi8LfzaS3h29aGZXp8aSFMEb8K3BEDA3Z9kFnTqD2TuAud15V", PrivateKey: "8XfQpgs3iBeJ1tSKzsdCU9t7Jd8vbxcLsrDgGHq78C4x", KeyType: KeyTypeSecp256k1, }, } TestAdminSKI = []byte("dc752d6afb51c33327b7873fdb08adb91de15ee7c88f4f9949445aeeb8ea4e99") TestValidatorsPublicKeysArgs = [][]byte{ []byte("A4JdE9iZRzU9NEiVDNxYKKWymHeBxHR7mA8AetFrg8m4"), []byte("5Tevazf8xxwyyKGku4VCCSVMDN56mU3mm2WsnENk1zv5"), []byte("6qFz88dv2R8sXmyzWPjvzN6jafv7t1kNUHztYKjH1Rd4"), } TestInitArgs = append( [][]byte{ TestAdminSKI, []byte(strconv.Itoa(len(TestValidatorsPublicKeysArgs))), }, TestValidatorsPublicKeysArgs..., ) TestValidatorsPrivateKeysArgs = [][]byte{ []byte("3aDebSkgXq37VPrzThboaV8oMMbYXrRAt7hnGrod4PNMnGfXjh14TY7cQs8eVT46C4RK4ZyNKLrBmyD5CYZiFmkr"), []byte("5D2BpuHZwik9zPFuaqba4zbvNP8TB7PQ6usZke5bufPbKf8xG6ZMHReBqwKw9aDfpTaNfaRsg1j2zVZWrX8hg18D"), []byte("3sK2wHWxU58kzAeFtShDMsPm5Qh74NAWgfwCmdKyzvp4npivEDDEp14WgQpg7KGaVNF7qWyyMvkKPzGddVkxagNN"), } 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, }, }, } AdminCertPath = "admin_cert.pem" UserCertPath = "user_cert.pem" 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 GenerateTestValidatorSignatures ¶
func GenerateTestValidatorSignatures(pKeys []string, digest []byte) (vpKeys [][]byte, vSignatures [][]byte)
GenerateTestValidatorSignatures returns test validator signatures
func GetCert ¶
func GetCert(certPath string) (*x509.Certificate, error)
GetCert returns certificate located at path
func HexEncodedSignature ¶
func MarshalIdentity ¶
MarshalIdentity marshals creator identities
func SetCreator ¶
func StubCreateAndInit ¶
StubCreateAndInit creates mock stub and initializes it with TestIniArgs
Types ¶
type FiatToken ¶
FiatToken - base struct
func NewFiatToken ¶
NewFiatToken creates fiat token
func (*FiatToken) QueryGetRight ¶
type TestSigner ¶
func (*TestSigner) Sign ¶
func (s *TestSigner) Sign(message []byte) []byte
Click to show internal directories.
Click to hide internal directories.