Documentation
¶
Index ¶
- type ChainManager
- func (chainManager *ChainManager) ChangeContractFees(authorizedSigScheme signaturescheme.SignatureScheme, chain *solo.Chain, ...)
- func (chainManager *ChainManager) ChangeValidatorFees(authorizedSigScheme signaturescheme.SignatureScheme, chain *solo.Chain, ...)
- func (chainManager *ChainManager) DeployWasmContract(chain *solo.Chain, contractOriginator signaturescheme.SignatureScheme, ...)
- func (chainManager *ChainManager) Dispose()
- func (chainManager *ChainManager) GetContractRecord(chain *solo.Chain, contractName string) (*root.ContractRecord, error)
- func (chainManager *ChainManager) GrantAgentDeployPermission(chain *solo.Chain, authorizedAgentID coretypes.AgentID)
- func (chainManager *ChainManager) GrantDeployPermission(chain *solo.Chain, authorizedSigScheme signaturescheme.SignatureScheme)
- func (chainManager *ChainManager) MustGetContractID(chain *solo.Chain, contractName string) coretypes.ContractID
- func (chainManager *ChainManager) MustGetContractRecord(chain *solo.Chain, contractName string) *root.ContractRecord
- func (chainManager *ChainManager) MustTransferBetweenChains(depositorSigScheme signaturescheme.SignatureScheme, sourceChain *solo.Chain, ...)
- func (chainManager *ChainManager) MustTransferToValueTangleToSelf(depositorSigScheme signaturescheme.SignatureScheme, chain *solo.Chain, ...)
- func (chainManager *ChainManager) MustTransferWithinChain(depositorSigScheme signaturescheme.SignatureScheme, chain *solo.Chain, ...)
- func (chainManager *ChainManager) NewChain(chainOriginator signaturescheme.SignatureScheme, chainName string, ...) *solo.Chain
- func (chainManager *ChainManager) NewChainAndDeployWasmContract(chainOriginator signaturescheme.SignatureScheme, chainName string, ...) (*solo.Chain, *root.ContractRecord)
- func (chainManager *ChainManager) RequireBalance(sigScheme signaturescheme.SignatureScheme, chain *solo.Chain, ...)
- func (chainManager *ChainManager) RequireContractBalance(chain *solo.Chain, contractName string, color balance.Color, ...)
- func (chainManager *ChainManager) RevokeAgentDeployPermission(chain *solo.Chain, authorizedAgentID coretypes.AgentID)
- func (chainManager *ChainManager) RevokeDeployPermission(chain *solo.Chain, authorizedSigScheme signaturescheme.SignatureScheme)
- func (chainManager *ChainManager) TransferBetweenChains(depositorSigScheme signaturescheme.SignatureScheme, sourceChain *solo.Chain, ...) error
- func (chainManager *ChainManager) TransferToValueTangleToSelf(depositorSigScheme signaturescheme.SignatureScheme, chain *solo.Chain, ...) error
- func (chainManager *ChainManager) TransferWithinChain(depositorSigScheme signaturescheme.SignatureScheme, chain *solo.Chain, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChainManager ¶
type ChainManager struct {
// contains filtered or unexported fields
}
ChainManager manipulates chains
func (*ChainManager) ChangeContractFees ¶ added in v0.9.2
func (chainManager *ChainManager) ChangeContractFees(authorizedSigScheme signaturescheme.SignatureScheme, chain *solo.Chain, contractName string, newContractOwnerFee int64)
ChangeContractFees changes chains owner fee as 'authorized signature' scheme. Anyone with an authorized signature can use this. See 'GrantDeployPermission' on how to (de)authorize chain changes. Fails test on error.
func (*ChainManager) ChangeValidatorFees ¶ added in v0.9.2
func (chainManager *ChainManager) ChangeValidatorFees(authorizedSigScheme signaturescheme.SignatureScheme, chain *solo.Chain, contractName string, newValidatorFee int64)
ChangeValidatorFees changes the validator fee as 'authorized signature' scheme. Anyone with an authorized signature can use this. See 'GrantDeployPermission' on how to (de)authorize chain changes. Fails test on error.
func (*ChainManager) DeployWasmContract ¶
func (chainManager *ChainManager) DeployWasmContract(chain *solo.Chain, contractOriginator signaturescheme.SignatureScheme, contractName string, contractWasmFilePath string)
DeployWasmContract uploads and deploys 'constract wasm file'
func (*ChainManager) Dispose ¶
func (chainManager *ChainManager) Dispose()
Dispose implements Disposable for ChainManager
func (*ChainManager) GetContractRecord ¶
func (chainManager *ChainManager) GetContractRecord(chain *solo.Chain, contractName string) (*root.ContractRecord, error)
GetContractRecord searches 'chain' for 'contract record' by name
func (*ChainManager) GrantAgentDeployPermission ¶ added in v0.9.2
func (chainManager *ChainManager) GrantAgentDeployPermission(chain *solo.Chain, authorizedAgentID coretypes.AgentID)
GrantAgentDeployPermission gives permission, as the chain originator, to 'authorizedAgentID' to deploy SCs into the specified chain. Fails test on error.
func (*ChainManager) GrantDeployPermission ¶
func (chainManager *ChainManager) GrantDeployPermission(chain *solo.Chain, authorizedSigScheme signaturescheme.SignatureScheme)
GrantDeployPermission gives permission, as the chain originator, to 'authorizedSigScheme' to deploy SCs into the specified chain. Fails test on error.
func (*ChainManager) MustGetContractID ¶
func (chainManager *ChainManager) MustGetContractID(chain *solo.Chain, contractName string) coretypes.ContractID
MustGetContractID ensures 'chain' contains 'contract' and returns its ContractID. Fails test on error.
func (*ChainManager) MustGetContractRecord ¶
func (chainManager *ChainManager) MustGetContractRecord(chain *solo.Chain, contractName string) *root.ContractRecord
MustGetContractRecord searches 'chain' for 'contract record' by name. Fails test on error.
func (*ChainManager) MustTransferBetweenChains ¶
func (chainManager *ChainManager) MustTransferBetweenChains(depositorSigScheme signaturescheme.SignatureScheme, sourceChain *solo.Chain, color balance.Color, transferAmount int64, destinationChain *solo.Chain, receiverSigScheme signaturescheme.SignatureScheme)
MustTransferBetweenChains makes transfer of 'amount' of 'color' from the depositors account in 'sourceChain' to the receivers account in 'destinationChain'. Transfers to 'depositor' if no receiver is defined. Fails test on error. Important: Due to the current logic in the accounts contract (from IOTA Foundation), all tokens of 'depositor' are withdrawn from 'sourceChain' to his address in the value tangle.
func (*ChainManager) MustTransferToValueTangleToSelf ¶
func (chainManager *ChainManager) MustTransferToValueTangleToSelf(depositorSigScheme signaturescheme.SignatureScheme, chain *solo.Chain, color balance.Color, transferAmount int64)
MustTransferToValueTangleToSelf makes transfer of 'amount' of 'color' from the depositors account in 'chain' to the depositors address in the value tangle. Fails test on error. Important: Due to the current logic in the accounts contract (from IOTA Foundation), all tokens of 'depositor' are withdrawn from 'chain' to his address in the value tangle.
func (*ChainManager) MustTransferWithinChain ¶
func (chainManager *ChainManager) MustTransferWithinChain(depositorSigScheme signaturescheme.SignatureScheme, chain *solo.Chain, color balance.Color, transferAmount int64, receiverSigScheme signaturescheme.SignatureScheme)
MustTransferWithinChain makes transfer of 'amount' of 'color' from the depositors account in 'chain' to the receivers account in the same chain. Nothing is transfered if no receiver is defined. Fails test on error. Important: Due to the current logic in the accounts contract (from IOTA Foundation), all tokens are withdrawn from 'sourceChain', not only the specified color and amount.
func (*ChainManager) NewChain ¶
func (chainManager *ChainManager) NewChain(chainOriginator signaturescheme.SignatureScheme, chainName string, validatorFeeTarget ...coretypes.AgentID) *solo.Chain
NewChain instantiates a new chain
If 'chainOriginator' is nil, a new SignatureScheme is generated and 1337 iota tokens are assigned to it (amount of funds is defined in utxodb.RequestFundsAmount) If 'validatorFeeTarget' is skipped, it is assumed equal to the chainOriginators AgentID Fails test on error.
func (*ChainManager) NewChainAndDeployWasmContract ¶
func (chainManager *ChainManager) NewChainAndDeployWasmContract(chainOriginator signaturescheme.SignatureScheme, chainName string, contractOriginator signaturescheme.SignatureScheme, contractName string, contractWasmFilePath string, validatorFeeTarget ...coretypes.AgentID) (*solo.Chain, *root.ContractRecord)
NewChainAndDeployWasmContract calls NewChain and then DeployWasmContract
func (*ChainManager) RequireBalance ¶
func (chainManager *ChainManager) RequireBalance(sigScheme signaturescheme.SignatureScheme, chain *solo.Chain, color balance.Color, expectedBalance int64)
RequireBalance verifies if the signature scheme has the expected balance of 'color' in 'chain'. Fails test if balance is not equal to expectedBalance.
func (*ChainManager) RequireContractBalance ¶ added in v0.9.2
func (chainManager *ChainManager) RequireContractBalance(chain *solo.Chain, contractName string, color balance.Color, expectedBalance int64)
RequireContractBalance verifies if 'contract' has the expected balance of 'color' in 'chain'. Fails test if contract is neither defined, nor found, or if the balance is not equal to expectedBalance.
func (*ChainManager) RevokeAgentDeployPermission ¶ added in v0.9.2
func (chainManager *ChainManager) RevokeAgentDeployPermission(chain *solo.Chain, authorizedAgentID coretypes.AgentID)
RevokeAgentDeployPermission revokes permission, as the chain originator, from 'authorizedAgentID' to deploy SCs into 'chain'. Fails test on error.
func (*ChainManager) RevokeDeployPermission ¶
func (chainManager *ChainManager) RevokeDeployPermission(chain *solo.Chain, authorizedSigScheme signaturescheme.SignatureScheme)
RevokeDeployPermission revokes permission, as the chain originator, from 'authorizedSigScheme' to deploy SCs into 'chain'. Fails test on error.
func (*ChainManager) TransferBetweenChains ¶
func (chainManager *ChainManager) TransferBetweenChains(depositorSigScheme signaturescheme.SignatureScheme, sourceChain *solo.Chain, color balance.Color, transferAmount int64, destinationChain *solo.Chain, receiverSigScheme signaturescheme.SignatureScheme) error
TransferBetweenChains makes transfer of 'amount' of 'color' from the depositors account in 'sourceChain' to the receivers account in 'destinationChain'. Transfers to 'depositor' if no receiver is defined. Important: Due to the current logic in the accounts contract (from IOTA Foundation), all tokens of 'depositor' are withdrawn from 'sourceChain' to his address in the value tangle.
func (*ChainManager) TransferToValueTangleToSelf ¶
func (chainManager *ChainManager) TransferToValueTangleToSelf(depositorSigScheme signaturescheme.SignatureScheme, chain *solo.Chain, color balance.Color, transferAmount int64) error
TransferToValueTangleToSelf makes transfer of 'amount' of 'color' from the depositors account in 'chain' to the depositors address in the value tangle. Important: Due to the current logic in the accounts contract (from IOTA Foundation), all tokens of 'depositor' are withdrawn from 'chain' to his address in the value tangle.
func (*ChainManager) TransferWithinChain ¶
func (chainManager *ChainManager) TransferWithinChain(depositorSigScheme signaturescheme.SignatureScheme, chain *solo.Chain, color balance.Color, transferAmount int64, receiverSigScheme signaturescheme.SignatureScheme) error
TransferWithinChain makes transfer of 'amount' of 'color' from the depositors account in 'chain' to the receivers account in the same chain. Nothing is transfered if no receiver is defined. Important: Due to the current logic in the accounts contract (from IOTA Foundation), all tokens are withdrawn from 'sourceChain', not only the specified color and amount.