Documentation ¶
Index ¶
- Constants
- type BatchTxResponse
- type Fee
- type IndustrialMetadata
- type Ledger
- func (ledger *Ledger) GetPending(token string, txID ...string)
- func (ledger *Ledger) GetStub(name string) *stub.Stub
- func (ledger *Ledger) GetStubByKey(key string) *stub.Stub
- func (ledger *Ledger) IndustrialMetadata(ch string) *IndustrialMetadata
- func (ledger *Ledger) Metadata(ch string) *Metadata
- func (ledger *Ledger) NewChainCode(name string, bci core.BaseContractInterface, options *core.ContractOptions, ...) string
- func (ledger *Ledger) NewMultisigWallet(n int) *Multisig
- func (ledger *Ledger) NewWallet() *Wallet
- func (ledger *Ledger) NewWalletFromHexKey(key string) *Wallet
- func (ledger *Ledger) NewWalletFromKey(key string) *Wallet
- func (ledger *Ledger) SetACL(aclStub *stub.Stub)
- func (ledger *Ledger) UpdateStubTxID(stubName string, newTxID string)
- func (ledger *Ledger) WaitChTransferTo(name string, id string, timeout time.Duration)
- func (ledger *Ledger) WaitMultiSwapAnswer(name string, id string, timeout time.Duration)
- func (ledger *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 string, 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) GroupBalanceShouldBe(ch, group string, expected uint64)
- func (w *Wallet) IndustrialBalanceShouldBe(ch, group string, expected uint64)
- func (w *Wallet) Invoke(ch string, fn string, args ...string) string
- func (w *Wallet) InvokeReturnsTxID(ch string, fn string, args ...string) string
- func (w *Wallet) InvokeWithError(ch string, fn string, args ...string) error
- func (w *Wallet) Ledger() *Ledger
- func (w *Wallet) OtfBalanceShouldBe(ch string, token string, expected uint64)
- func (w *Wallet) OtfNbInvoke(ch string, fn string, args ...string) (string, string)
- func (w *Wallet) PubKey() []byte
- func (w *Wallet) RawChTransferInvoke(ch string, 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) RawSignedInvokeWithErrorReturned(ch string, fn string, args ...string) error
- func (w *Wallet) RawSignedMultiSwapInvoke(ch string, 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 string, fn string, args ...string) []string
- func (w *Wallet) SignedInvoke(ch string, fn string, args ...string) string
- func (w *Wallet) SignedMultiSwapsInvoke(ch string, fn string, args ...string) string
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 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
}
Ledger is a mock ledger for testing purposes
func (*Ledger) GetPending ¶
GetPending returns pending transactions
func (*Ledger) GetStubByKey ¶
GetStubByKey returns stub by key
func (*Ledger) IndustrialMetadata ¶
func (ledger *Ledger) IndustrialMetadata(ch string) *IndustrialMetadata
IndustrialMetadata returns metadata for industrial token
func (*Ledger) NewChainCode ¶
func (ledger *Ledger) NewChainCode(name string, bci core.BaseContractInterface, options *core.ContractOptions, fs *embed.FS, initArgs ...string) string
NewChainCode creates new chaincode
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 ¶
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) 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) InvokeWithError ¶
InvokeWithError invokes a function on the ledger and returns an error
func (*Wallet) OtfBalanceShouldBe ¶
OtfBalanceShouldBe checks the otf balance of the wallet
func (*Wallet) OtfNbInvoke ¶
OtfNbInvoke invokes a function on the ledger
func (*Wallet) RawChTransferInvoke ¶
func (w *Wallet) RawChTransferInvoke(ch string, fn string, args ...string) (string, TxResponse, error)
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) RawSignedInvokeWithErrorReturned ¶
RawSignedInvokeWithErrorReturned invokes a function on the ledger
func (*Wallet) RawSignedMultiSwapInvoke ¶
func (w *Wallet) RawSignedMultiSwapInvoke(ch string, fn string, args ...string) (string, TxResponse, []*proto.Swap, []*proto.MultiSwap)
RawSignedMultiSwapInvoke invokes a function on the ledger
func (*Wallet) RemoveAccountRight ¶
RemoveAccountRight removes a right from the access matrix
func (*Wallet) SignedInvoke ¶
SignedInvoke invokes a function on the ledger
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package stub mocked_atomyze provides APIs for the chaincode to access its state variables, transaction context and call other chaincodes.
|
Package stub mocked_atomyze provides APIs for the chaincode to access its state variables, transaction context and call other chaincodes. |