Documentation ¶
Index ¶
- Constants
- Variables
- func MakeValSetChangeTx(pubkey types.PubKey, power int64) []byte
- func MustUnmarshal(data []byte, load interface{})
- type AccountInfo
- type ArgsAddAction
- type ArgsAddActions
- type ArgsAddBlockCheck
- type ArgsGetAction
- type ArgsGetMerkleProof
- type ArgsGetStorageAt
- type ArgsSetBalance
- type ArgsTransfer
- type ArgsValidateMerkleProof
- type FAPair
- type MPTMerkleProof
- type NSBApplication
- func (nsb *NSBApplication) ActionRigisteredMethod(env *cmn.TransactionHeader, frInfo *AccountInfo, toInfo *AccountInfo, ...) *types.ResponseDeliverTx
- func (nsb *NSBApplication) BeginBlock(req types.RequestBeginBlock) types.ResponseBeginBlock
- func (nsb *NSBApplication) CheckTx(types.RequestCheckTx) types.ResponseCheckTx
- func (nsb *NSBApplication) Commit() types.ResponseCommit
- func (nsb *NSBApplication) DeliverTx(req types.RequestDeliverTx) types.ResponseDeliverTx
- func (nsb *NSBApplication) EndBlock(req types.RequestEndBlock) types.ResponseEndBlock
- func (nsb *NSBApplication) Info(req types.RequestInfo) types.ResponseInfo
- func (nsb *NSBApplication) InitChain(req types.RequestInitChain) types.ResponseInitChain
- func (nsb *NSBApplication) MerkleProofRigisteredMethod(env *cmn.TransactionHeader, frInfo *AccountInfo, toInfo *AccountInfo, ...) *types.ResponseDeliverTx
- func (nsb *NSBApplication) Query(req types.RequestQuery) (ret types.ResponseQuery)
- func (nsb *NSBApplication) QueryIndex(req *types.RequestQuery) string
- func (nsb *NSBApplication) Revert() error
- func (nsb *NSBApplication) SetLogger(l log.Logger)
- func (nsb *NSBApplication) Stop() (err1 error, err2 error)
- func (nsb *NSBApplication) TokenRigisteredMethod(env *cmn.TransactionHeader, frInfo *AccountInfo, toInfo *AccountInfo, ...) *types.ResponseDeliverTx
- func (nsb *NSBApplication) Validators() (validators []types.ValidatorUpdate)
- type NSBState
- type SimpleMerkleProof
Constants ¶
View Source
const (
NSBVersion version.Protocol = 0x1
)
Variables ¶
View Source
var (
ContractNameNotEqual = errors.New("the name of contract to call is mismatch with providing name")
)
View Source
var (
MethodMissing = errors.New("no corresponding function")
)
Functions ¶
func MustUnmarshal ¶
func MustUnmarshal(data []byte, load interface{})
Types ¶
type AccountInfo ¶
type AccountInfo struct { Balance *math.Uint256 `json:"balance"` CodeHash []byte `json:"code_hash"` StorageRoot []byte `json:"storage_root"` Name []byte `json:"name"` }
func (*AccountInfo) String ¶
func (accInfo *AccountInfo) String() string
type ArgsAddAction ¶
type ArgsAddActions ¶ added in v0.7.4
type ArgsAddActions struct {
Args []ArgsAddAction `json:"1"`
}
type ArgsAddBlockCheck ¶ added in v0.7.1
type ArgsGetAction ¶
type ArgsGetMerkleProof ¶ added in v0.7.1
type ArgsGetStorageAt ¶
type ArgsSetBalance ¶
* storage := actionMap
type ArgsTransfer ¶
type ArgsValidateMerkleProof ¶ added in v0.7.3
type MPTMerkleProof ¶ added in v0.7.1
type NSBApplication ¶
type NSBApplication struct { types.BaseApplication ValUpdates []types.ValidatorUpdate // contains filtered or unexported fields }
func NewNSBApplication ¶
func NewNSBApplication(dbDir string) (*NSBApplication, error)
func (*NSBApplication) ActionRigisteredMethod ¶
func (nsb *NSBApplication) ActionRigisteredMethod( env *cmn.TransactionHeader, frInfo *AccountInfo, toInfo *AccountInfo, funcName string, args []byte, ) *types.ResponseDeliverTx
func (*NSBApplication) BeginBlock ¶
func (nsb *NSBApplication) BeginBlock(req types.RequestBeginBlock) types.ResponseBeginBlock
Track the block hash and header information
func (*NSBApplication) CheckTx ¶
func (nsb *NSBApplication) CheckTx(types.RequestCheckTx) types.ResponseCheckTx
func (*NSBApplication) Commit ¶
func (nsb *NSBApplication) Commit() types.ResponseCommit
func (*NSBApplication) DeliverTx ¶
func (nsb *NSBApplication) DeliverTx(req types.RequestDeliverTx) types.ResponseDeliverTx
func (*NSBApplication) EndBlock ¶
func (nsb *NSBApplication) EndBlock(req types.RequestEndBlock) types.ResponseEndBlock
Update the validator set
func (*NSBApplication) Info ¶
func (nsb *NSBApplication) Info(req types.RequestInfo) types.ResponseInfo
func (*NSBApplication) InitChain ¶
func (nsb *NSBApplication) InitChain(req types.RequestInitChain) types.ResponseInitChain
Save the validators in the merkle tree
func (*NSBApplication) MerkleProofRigisteredMethod ¶ added in v0.7.1
func (nsb *NSBApplication) MerkleProofRigisteredMethod( env *cmn.TransactionHeader, frInfo *AccountInfo, toInfo *AccountInfo, funcName string, args []byte, ) *types.ResponseDeliverTx
func (*NSBApplication) Query ¶
func (nsb *NSBApplication) Query(req types.RequestQuery) (ret types.ResponseQuery)
type RequestQuery struct { Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` Prove bool `protobuf:"varint,4,opt,name=prove,proto3" json:"prove,omitempty"` }
type ResponseQuery struct { Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` // bytes data = 2; // use "value" instead. Log string `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` Info string `protobuf:"bytes,4,opt,name=info,proto3" json:"info,omitempty"` Index int64 `protobuf:"varint,5,opt,name=index,proto3" json:"index,omitempty"` Key []byte `protobuf:"bytes,6,opt,name=key,proto3" json:"key,omitempty"` Value []byte `protobuf:"bytes,7,opt,name=value,proto3" json:"value,omitempty"` Proof *merkle.Proof `protobuf:"bytes,8,opt,name=proof" json:"proof,omitempty"` Height int64 `protobuf:"varint,9,opt,name=height,proto3" json:"height,omitempty"` Codespace string `protobuf:"bytes,10,opt,name=codespace,proto3" json:"codespace,omitempty"` }
type Proof struct { Ops []ProofOp `protobuf:"bytes,1,rep,name=ops" json:"ops"` }
func (*NSBApplication) QueryIndex ¶
func (nsb *NSBApplication) QueryIndex(req *types.RequestQuery) string
func (*NSBApplication) Revert ¶
func (nsb *NSBApplication) Revert() error
func (*NSBApplication) SetLogger ¶
func (nsb *NSBApplication) SetLogger(l log.Logger)
func (*NSBApplication) Stop ¶
func (nsb *NSBApplication) Stop() (err1 error, err2 error)
func (*NSBApplication) TokenRigisteredMethod ¶
func (nsb *NSBApplication) TokenRigisteredMethod( env *cmn.TransactionHeader, frInfo *AccountInfo, toInfo *AccountInfo, funcName string, args []byte, ) *types.ResponseDeliverTx
func (*NSBApplication) Validators ¶
func (nsb *NSBApplication) Validators() (validators []types.ValidatorUpdate)
type NSBState ¶
type SimpleMerkleProof ¶ added in v0.7.1
type SimpleMerkleProof struct {
HashChain [][]byte `json:"h"`
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.