當前位置: 首頁>>代碼示例>>Golang>>正文


Golang account.PubKey類代碼示例

本文整理匯總了Golang中github.com/eris-ltd/mint-client/Godeps/_workspace/src/github.com/tendermint/tendermint/account.PubKey的典型用法代碼示例。如果您正苦於以下問題:Golang PubKey類的具體用法?Golang PubKey怎麽用?Golang PubKey使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了PubKey類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: AddInput

func (tx *SendTx) AddInput(st AccountGetter, pubkey acm.PubKey, amt int64) error {
	addr := pubkey.Address()
	acc := st.GetAccount(addr)
	if acc == nil {
		return fmt.Errorf("Invalid address %X from pubkey %X", addr, pubkey)
	}
	return tx.AddInputWithNonce(pubkey, amt, acc.Sequence+1)
}
開發者ID:alist,項目名稱:mint-client,代碼行數:8,代碼來源:tx_utils.go

示例2: NewCallTx

func NewCallTx(st AccountGetter, from acm.PubKey, to, data []byte, amt, gasLimit, fee int64) (*CallTx, error) {
	addr := from.Address()
	acc := st.GetAccount(addr)
	if acc == nil {
		return nil, fmt.Errorf("Invalid address %X from pubkey %X", addr, from)
	}

	nonce := acc.Sequence + 1
	return NewCallTxWithNonce(from, to, data, amt, gasLimit, fee, nonce), nil
}
開發者ID:alist,項目名稱:mint-client,代碼行數:10,代碼來源:tx_utils.go

示例3: NewPermissionsTx

func NewPermissionsTx(st AccountGetter, from acm.PubKey, args ptypes.PermArgs) (*PermissionsTx, error) {
	addr := from.Address()
	acc := st.GetAccount(addr)
	if acc == nil {
		return nil, fmt.Errorf("Invalid address %X from pubkey %X", addr, from)
	}

	nonce := acc.Sequence + 1
	return NewPermissionsTxWithNonce(from, args, nonce), nil
}
開發者ID:alist,項目名稱:mint-client,代碼行數:10,代碼來源:tx_utils.go

示例4: NewNameTx

func NewNameTx(st AccountGetter, from acm.PubKey, name, data string, amt, fee int64) (*NameTx, error) {
	addr := from.Address()
	acc := st.GetAccount(addr)
	if acc == nil {
		return nil, fmt.Errorf("Invalid address %X from pubkey %X", addr, from)
	}

	nonce := acc.Sequence + 1
	return NewNameTxWithNonce(from, name, data, amt, fee, nonce), nil
}
開發者ID:alist,項目名稱:mint-client,代碼行數:10,代碼來源:tx_utils.go

示例5: AddInputWithNonce

func (tx *SendTx) AddInputWithNonce(pubkey acm.PubKey, amt int64, nonce int) error {
	addr := pubkey.Address()
	tx.Inputs = append(tx.Inputs, &TxInput{
		Address:   addr,
		Amount:    amt,
		Sequence:  nonce,
		Signature: acm.SignatureEd25519{},
		PubKey:    pubkey,
	})
	return nil
}
開發者ID:alist,項目名稱:mint-client,代碼行數:11,代碼來源:tx_utils.go

示例6: NewPermissionsTxWithNonce

func NewPermissionsTxWithNonce(from acm.PubKey, args ptypes.PermArgs, nonce int) *PermissionsTx {
	addr := from.Address()
	input := &TxInput{
		Address:   addr,
		Amount:    1, // NOTE: amounts can't be 0 ...
		Sequence:  nonce,
		Signature: acm.SignatureEd25519{},
		PubKey:    from,
	}

	return &PermissionsTx{
		Input:    input,
		PermArgs: args,
	}
}
開發者ID:alist,項目名稱:mint-client,代碼行數:15,代碼來源:tx_utils.go

示例7: NewNameTxWithNonce

func NewNameTxWithNonce(from acm.PubKey, name, data string, amt, fee int64, nonce int) *NameTx {
	addr := from.Address()
	input := &TxInput{
		Address:   addr,
		Amount:    amt,
		Sequence:  nonce,
		Signature: acm.SignatureEd25519{},
		PubKey:    from,
	}

	return &NameTx{
		Input: input,
		Name:  name,
		Data:  data,
		Fee:   fee,
	}
}
開發者ID:alist,項目名稱:mint-client,代碼行數:17,代碼來源:tx_utils.go

示例8: NewCallTxWithNonce

func NewCallTxWithNonce(from acm.PubKey, to, data []byte, amt, gasLimit, fee int64, nonce int) *CallTx {
	addr := from.Address()
	input := &TxInput{
		Address:   addr,
		Amount:    amt,
		Sequence:  nonce,
		Signature: acm.SignatureEd25519{},
		PubKey:    from,
	}

	return &CallTx{
		Input:    input,
		Address:  to,
		GasLimit: gasLimit,
		Fee:      fee,
		Data:     data,
	}
}
開發者ID:alist,項目名稱:mint-client,代碼行數:18,代碼來源:tx_utils.go


注:本文中的github.com/eris-ltd/mint-client/Godeps/_workspace/src/github.com/tendermint/tendermint/account.PubKey類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。