Documentation ¶
Index ¶
- Constants
- type BatchTxResponse
- type ExecutorRequest
- type ExecutorResponse
- type Fee
- type IndustrialMetadata
- type Ledger
- func (l *Ledger) GetPending(token string, txID ...string)
- func (l *Ledger) GetStub(name string) *stub.Stub
- func (l *Ledger) GetStubByKey(key string) *stub.Stub
- func (l *Ledger) IndustrialMetadata(ch string) *IndustrialMetadata
- func (l *Ledger) Metadata(ch string) *Metadata
- func (l *Ledger) NewCC(name string, bci core.BaseContractInterface, config string, ...) string
- func (l *Ledger) NewCCArgsArr(name string, bci core.BaseContractInterface, initArgs []string, ...) string
- func (l *Ledger) NewMultisigWallet(n int) *Multisig
- func (l *Ledger) NewWallet() *Wallet
- func (l *Ledger) NewWalletFromHexKey(key string) *Wallet
- func (l *Ledger) NewWalletFromKey(key string) *Wallet
- func (l *Ledger) SetACL(aclStub *stub.Stub)
- func (l *Ledger) UpdateStubTxID(stubName string, newTxID string)
- func (l *Ledger) WaitChTransferTo(name string, id string, timeout time.Duration)
- func (l *Ledger) WaitMultiSwapAnswer(name string, id string, timeout time.Duration)
- func (l *Ledger) WaitSwapAnswer(name string, id string, timeout time.Duration)
- type Metadata
- type MetadataGroup
- type MetadataRate
- type Multisig
- func (w *Multisig) Address() string
- func (w *Multisig) AddressType() *types.Address
- func (w *Multisig) ChangeKeysFor(index int, sKey ed25519.PrivateKey) error
- func (w *Multisig) PubKeys() []ed25519.PublicKey
- func (w *Multisig) RawSignedInvoke(signCnt int, ch string, fn string, args ...string) (string, TxResponse, []*proto.Swap)
- func (w *Multisig) SecretKeys() []ed25519.PrivateKey
- type Right
- type TxResponse
- type Wallet
- func (w *Wallet) AddAccountRight(right *Right) error
- func (w *Wallet) AddAllowedBalance(ch string, token string, amount uint64)
- func (w *Wallet) AddBalance(ch string, amount uint64)
- func (w *Wallet) AddGivenBalance(ch string, givenBalanceChannel string, amount uint64)
- func (w *Wallet) AddTokenBalance(ch string, token string, amount uint64)
- func (w *Wallet) Address() string
- func (w *Wallet) AddressType() *types.Address
- func (w *Wallet) AllowedBalanceShouldBe(ch string, token string, expected uint64)
- func (w *Wallet) BalanceShouldBe(ch string, expected uint64)
- func (w *Wallet) BatchedInvoke(ch, fn string, args ...string) (string, TxResponse)
- func (w *Wallet) ChangeKeys(sKey ed25519.PrivateKey) error
- func (w *Wallet) CheckGivenBalanceShouldBe(ch string, token string, expectedBalance uint64)
- func (w *Wallet) DoBatch(ch string, txID ...string) BatchTxResponse
- func (w *Wallet) ExecuteSignedInvoke(ch string, fn string, args ...string) ([]byte, error)
- func (w *Wallet) GroupBalanceShouldBe(ch, group string, expected uint64)
- func (w *Wallet) IndustrialBalanceShouldBe(ch, group string, expected uint64)
- func (w *Wallet) Invoke(ch, fn string, args ...string) string
- func (w *Wallet) InvokeReturnsTxID(ch, fn string, args ...string) string
- func (w *Wallet) InvokeTraced(ctx context.Context, ch, fn string, args ...string) string
- func (w *Wallet) InvokeWithError(ch, fn string, args ...string) error
- func (w *Wallet) InvokeWithPeerResponse(ch, fn string, args ...string) (peer.Response, error)
- func (w *Wallet) Ledger() *Ledger
- func (w *Wallet) NbInvoke(ch string, fn string, args ...string) (string, string)
- func (w *Wallet) NbInvokeTraced(ctx context.Context, ch string, fn string, args ...string) (string, string)
- func (w *Wallet) OtfBalanceShouldBe(ch string, token string, expected uint64)
- func (w *Wallet) OtfNbInvoke(ch string, fn string, args ...string) (string, string)deprecated
- func (w *Wallet) PubKey() []byte
- func (w *Wallet) RawChTransferInvoke(ch, fn string, args ...string) (string, TxResponse, error)
- func (w *Wallet) RawChTransferInvokeWithBatch(ch string, fn string, args ...string) (string, TxResponse, error)
- func (w *Wallet) RawSignedInvoke(ch string, fn string, args ...string) (string, TxResponse, []*proto.Swap)
- func (w *Wallet) RawSignedInvokeTraced(ctx context.Context, ch, fn string, args ...string) (string, TxResponse, []*proto.Swap)
- func (w *Wallet) RawSignedInvokeTracedWithErrorReturned(ctx context.Context, ch, fn string, args ...string) error
- func (w *Wallet) RawSignedInvokeWithErrorReturned(ch, fn string, args ...string) error
- func (w *Wallet) RawSignedMultiSwapInvoke(ch, fn string, args ...string) (string, TxResponse, []*proto.Swap, []*proto.MultiSwap)
- func (w *Wallet) RawSignedMultiSwapInvokeTraced(ctx context.Context, ch, fn string, args ...string) (string, TxResponse, []*proto.Swap, []*proto.MultiSwap)
- func (w *Wallet) RemoveAccountRight(right *Right) error
- func (w *Wallet) SecretKey() []byte
- func (w *Wallet) SetPubKey(pk ed25519.PublicKey)
- func (w *Wallet) SignArgs(ch, fn string, args ...string) []string
- func (w *Wallet) SignedInvoke(ch string, fn string, args ...string) string
- func (w *Wallet) SignedInvokeTraced(ctx context.Context, ch, fn string, args ...string) string
- func (w *Wallet) SignedMultiSwapsInvoke(ch string, fn string, args ...string) string
- func (w *Wallet) TaskExecutor(r ExecutorRequest) (*ExecutorResponse, error)
- func (w *Wallet) UseGOSTKey()
- func (w *Wallet) UseSecp256k1Key()
Constants ¶
const ( // AddRights adds a right to the access matrix AddRights operation = "addRights" // RemoveRights removes a right from the access matrix RemoveRights operation = "removeRights" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchTxResponse ¶
type BatchTxResponse map[string]*proto.TxResponse
BatchTxResponse is a batch transaction response
func (BatchTxResponse) TxHasNoError ¶
func (br BatchTxResponse) TxHasNoError(t *testing.T, txID ...string)
TxHasNoError checks if the transaction has no error
type ExecutorRequest ¶ added in v0.0.2
func NewExecutorRequest ¶ added in v0.0.2
func NewExecutorRequest(ch string, fn string, args []string, isSignedInvoke bool) ExecutorRequest
type ExecutorResponse ¶ added in v0.0.2
type ExecutorResponse struct { TxResponse *proto.TxResponse BatchTxEvent *proto.BatchTxEvent }
type Fee ¶
type Fee struct { Currency string `json:"currency"` Fee *big.Int `json:"fee"` Floor *big.Int `json:"floor"` Cap *big.Int `json:"cap"` }
Fee struct
type IndustrialMetadata ¶
type IndustrialMetadata struct { Name string `json:"name"` Symbol string `json:"symbol"` Decimals uint `json:"decimals"` UnderlyingAsset string `json:"underlying_asset"` //nolint:tagliatelle DeliveryForm string `json:"deliveryForm"` UnitOfMeasure string `json:"unitOfMeasure"` TokensForUnit string `json:"tokensForUnit"` PaymentTerms string `json:"paymentTerms"` Price string `json:"price"` Issuer string `json:"issuer"` Methods []string `json:"methods"` Groups []MetadataGroup `json:"groups"` Fee *Fee `json:"fee"` Rates []*MetadataRate `json:"rates"` }
IndustrialMetadata struct
type Ledger ¶
type Ledger struct {
// contains filtered or unexported fields
}
func (*Ledger) GetPending ¶
GetPending returns pending transactions
func (*Ledger) GetStubByKey ¶
GetStubByKey returns stub by key
func (*Ledger) IndustrialMetadata ¶
func (l *Ledger) IndustrialMetadata(ch string) *IndustrialMetadata
IndustrialMetadata returns metadata for industrial token
func (*Ledger) NewCC ¶
func (l *Ledger) NewCC( name string, bci core.BaseContractInterface, config string, opts ...core.ChaincodeOption, ) string
func (*Ledger) NewCCArgsArr ¶
func (l *Ledger) NewCCArgsArr( name string, bci core.BaseContractInterface, initArgs []string, opts ...core.ChaincodeOption, ) string
NewCCArgsArr Deprecated: added only for backward compatibility.
func (*Ledger) NewMultisigWallet ¶
NewMultisigWallet creates new multisig wallet
func (*Ledger) NewWalletFromHexKey ¶
NewWalletFromHexKey creates new wallet from hex key
func (*Ledger) NewWalletFromKey ¶
NewWalletFromKey creates new wallet from key
func (*Ledger) UpdateStubTxID ¶
UpdateStubTxID updates stub txID
func (*Ledger) WaitChTransferTo ¶
WaitChTransferTo waits for transfer to event
func (*Ledger) WaitMultiSwapAnswer ¶
WaitMultiSwapAnswer waits for multi swap answer
type Metadata ¶
type Metadata struct { Name string `json:"name"` Symbol string `json:"symbol"` Decimals uint `json:"decimals"` UnderlyingAsset string `json:"underlyingAsset"` Issuer string `json:"issuer"` Methods []string `json:"methods"` TotalEmission *big.Int `json:"total_emission"` //nolint:tagliatelle Fee *Fee `json:"fee"` Rates []*MetadataRate `json:"rates"` }
Metadata struct
func (Metadata) MethodExists ¶
MethodExists checks if method exists
type MetadataGroup ¶
type MetadataGroup struct { Name string `json:"name"` Amount *big.Int `json:"amount"` MaturityDate time.Time `json:"maturityDate"` Note string `json:"note"` }
MetadataGroup struct
type MetadataRate ¶
type MetadataRate struct { DealType string `json:"deal_type"` //nolint:tagliatelle Currency string `json:"currency"` Rate *big.Int `json:"rate"` Min *big.Int `json:"min"` Max *big.Int `json:"max"` }
MetadataRate struct
type Multisig ¶
type Multisig struct { Wallet // contains filtered or unexported fields }
Multisig is a mock for multisig wallet
func (*Multisig) AddressType ¶
AddressType returns address of multisig wallet
func (*Multisig) ChangeKeysFor ¶
func (w *Multisig) ChangeKeysFor(index int, sKey ed25519.PrivateKey) error
ChangeKeysFor changes private and public keys for Multisig member with specific index
func (*Multisig) RawSignedInvoke ¶
func (w *Multisig) RawSignedInvoke(signCnt int, ch string, fn string, args ...string) (string, TxResponse, []*proto.Swap)
RawSignedInvoke invokes chaincode function with specific arguments and signs it with multisig wallet
func (*Multisig) SecretKeys ¶
func (w *Multisig) SecretKeys() []ed25519.PrivateKey
SecretKeys returns private keys of multisig wallet
type TxResponse ¶
type TxResponse struct { Method string `json:"method"` Error string `json:"error,omitempty"` Result string `json:"result"` Events map[string][]byte `json:"events,omitempty"` Accounting []*proto.AccountingRecord `json:"accounting"` }
TxResponse returns txResponse event
type Wallet ¶
type Wallet struct {
// contains filtered or unexported fields
}
Wallet is a wallet
func (*Wallet) AddAccountRight ¶
AddAccountRight adds a right to the access matrix
func (*Wallet) AddAllowedBalance ¶
AddAllowedBalance adds allowed balance to the wallet
func (*Wallet) AddBalance ¶
AddBalance adds balance to the wallet
func (*Wallet) AddGivenBalance ¶
AddGivenBalance adds given balance to the wallet
func (*Wallet) AddTokenBalance ¶
AddTokenBalance adds token balance to the wallet
func (*Wallet) AddressType ¶
AddressType returns the address type of the wallet
func (*Wallet) AllowedBalanceShouldBe ¶
AllowedBalanceShouldBe checks the allowed balance of the wallet
func (*Wallet) BalanceShouldBe ¶
BalanceShouldBe checks the balance of the wallet
func (*Wallet) BatchedInvoke ¶
func (w *Wallet) BatchedInvoke(ch, fn string, args ...string) (string, TxResponse)
BatchedInvoke invokes a function on the ledger
func (*Wallet) ChangeKeys ¶
func (w *Wallet) ChangeKeys(sKey ed25519.PrivateKey) error
ChangeKeys change private key, then public key will be derived and changed too
func (*Wallet) CheckGivenBalanceShouldBe ¶
CheckGivenBalanceShouldBe checks the balance of the wallet
func (*Wallet) DoBatch ¶
func (w *Wallet) DoBatch(ch string, txID ...string) BatchTxResponse
DoBatch does a batch transaction
func (*Wallet) ExecuteSignedInvoke ¶ added in v0.0.2
func (*Wallet) GroupBalanceShouldBe ¶
GroupBalanceShouldBe checks the group balance of the wallet
func (*Wallet) IndustrialBalanceShouldBe ¶
IndustrialBalanceShouldBe checks the industrial balance of the wallet
func (*Wallet) InvokeReturnsTxID ¶
InvokeReturnsTxID invokes a function on the ledger and returns the transaction ID
func (*Wallet) InvokeTraced ¶
func (*Wallet) InvokeWithError ¶
InvokeWithError invokes a function on the ledger and returns an error
func (*Wallet) InvokeWithPeerResponse ¶
func (*Wallet) NbInvokeTraced ¶
func (w *Wallet) NbInvokeTraced(ctx context.Context, ch string, fn string, args ...string) (string, string)
NbInvokeTraced executes non-batched transactions with telemetry tracing
func (*Wallet) OtfBalanceShouldBe ¶
OtfBalanceShouldBe checks the otf balance of the wallet
func (*Wallet) RawChTransferInvoke ¶
RawChTransferInvoke invokes a function on the ledger
func (*Wallet) RawChTransferInvokeWithBatch ¶
func (w *Wallet) RawChTransferInvokeWithBatch(ch string, fn string, args ...string) (string, TxResponse, error)
RawChTransferInvokeWithBatch invokes a function on the ledger
func (*Wallet) RawSignedInvoke ¶
func (w *Wallet) RawSignedInvoke(ch string, fn string, args ...string) (string, TxResponse, []*proto.Swap)
RawSignedInvoke invokes a function on the ledger
func (*Wallet) RawSignedInvokeTraced ¶
func (*Wallet) RawSignedInvokeTracedWithErrorReturned ¶
func (*Wallet) RawSignedInvokeWithErrorReturned ¶
RawSignedInvokeWithErrorReturned invokes a function on the ledger
func (*Wallet) RawSignedMultiSwapInvoke ¶
func (w *Wallet) RawSignedMultiSwapInvoke(ch, fn string, args ...string) (string, TxResponse, []*proto.Swap, []*proto.MultiSwap)
RawSignedMultiSwapInvoke invokes a function on the ledger
func (*Wallet) RawSignedMultiSwapInvokeTraced ¶
func (*Wallet) RemoveAccountRight ¶
RemoveAccountRight removes a right from the access matrix
func (*Wallet) SignedInvoke ¶
SignedInvoke invokes a function on the ledger
func (*Wallet) SignedInvokeTraced ¶
func (*Wallet) SignedMultiSwapsInvoke ¶
SignedMultiSwapsInvoke invokes a function on the ledger
func (*Wallet) TaskExecutor ¶ added in v0.0.2
func (w *Wallet) TaskExecutor(r ExecutorRequest) (*ExecutorResponse, error)
func (*Wallet) UseGOSTKey ¶ added in v0.0.2
func (w *Wallet) UseGOSTKey()
func (*Wallet) UseSecp256k1Key ¶ added in v0.0.2
func (w *Wallet) UseSecp256k1Key()