Documentation ¶
Index ¶
- type ContractHandler
- func (h *ContractHandler) Commit() ([]programs.ContractUpdateKey, error)
- func (h *ContractHandler) GetContract(address runtime.Address, name string) (code []byte, err error)
- func (h *ContractHandler) GetContractNames(address runtime.Address) (names []string, err error)
- func (h *ContractHandler) HasUpdates() bool
- func (h *ContractHandler) RemoveContract(address runtime.Address, name string, signingAccounts []runtime.Address) (err error)
- func (h *ContractHandler) Rollback() error
- func (h *ContractHandler) SetContract(address runtime.Address, name string, code []byte, ...) (err error)
- func (h *ContractHandler) UpdateKeys() []programs.ContractUpdateKey
- type ProgramsHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContractHandler ¶
type ContractHandler struct {
// contains filtered or unexported fields
}
ContractHandler handles all interaction with smart contracts such as get/set/update it also captures all changes as deltas and only commit them when called so smart contract updates can be delayed until end of the tx execution
func NewContractHandler ¶
func (*ContractHandler) Commit ¶
func (h *ContractHandler) Commit() ([]programs.ContractUpdateKey, error)
func (*ContractHandler) GetContract ¶
func (*ContractHandler) GetContractNames ¶
func (h *ContractHandler) GetContractNames(address runtime.Address) (names []string, err error)
func (*ContractHandler) HasUpdates ¶
func (h *ContractHandler) HasUpdates() bool
func (*ContractHandler) RemoveContract ¶
func (*ContractHandler) Rollback ¶
func (h *ContractHandler) Rollback() error
func (*ContractHandler) SetContract ¶
func (*ContractHandler) UpdateKeys ¶
func (h *ContractHandler) UpdateKeys() []programs.ContractUpdateKey
type ProgramsHandler ¶ added in v0.15.0
type ProgramsHandler struct { Programs *programs.Programs // contains filtered or unexported fields }
ProgramsHandler manages operations using Programs storage. It's separation of concern for hostEnv Cadence contract guarantees that Get/Set methods will be called in a LIFO manner, so we use stack based approach here. During successful execution stack should be cleared naturally, making cleanup method essentially no-op. But if something goes wrong, all nested views must be merged in order to make sure they are recorded
func NewProgramsHandler ¶ added in v0.15.0
func NewProgramsHandler(programs *programs.Programs, stateHolder *state.StateHolder) *ProgramsHandler
func (*ProgramsHandler) Cleanup ¶ added in v0.15.0
func (h *ProgramsHandler) Cleanup() error
func (*ProgramsHandler) Get ¶ added in v0.15.0
func (h *ProgramsHandler) Get(location common.Location) (*interpreter.Program, bool)
func (*ProgramsHandler) Set ¶ added in v0.15.0
func (h *ProgramsHandler) Set(location common.Location, program *interpreter.Program) error