package blockchain
Structures of a CKB Cell.
Since everything is a collection of bytes, these structures just a wrapper of byte slice.
Types
type Script
type Script table {
inner []byte
}
func (s *Script) TotalSize() uint64
func (s *Script) FieldCount() uint64
func (s *Script) Len() uint64
func (s *Script) IsEmpty() bool
func (s *Script) CountExtraFields()
func (s *Script) HasExtraFields()
func (s *Script) CodeHash() Byte32
func (s *Script) HashType() Byte
func (s *Script) Args() Bytes
type Byte32
type Bytes table {
inner []byte
}
func (s *Bytes) TotalSize() uint64
func (s *Bytes) Len() uint64
func (s *Bytes) IsEmpty() bool
func (s *Bytes) Get(index uint64) Byte
func (s *Bytes) RawData() []byte
package ckb
Developed on top of ckb-c-stdlib.
loadScript
func loadScript() blockchain.Script
Load current running script, which could be a Lock Script or a Type Script. You can check it based on the hash_type field.
verifyScript
func verifyScript(script blockchain.Script, compatible bool) bool
Verify the Script is valid or not. Check Script byte size, filed count, and so on.