本文整理匯總了Golang中github.com/FactomProject/factoid.Transaction.SetMilliTimestamp方法的典型用法代碼示例。如果您正苦於以下問題:Golang Transaction.SetMilliTimestamp方法的具體用法?Golang Transaction.SetMilliTimestamp怎麽用?Golang Transaction.SetMilliTimestamp使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/FactomProject/factoid.Transaction
的用法示例。
在下文中一共展示了Transaction.SetMilliTimestamp方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: GetCoinbase
// This routine generates the Coinbase. This is a fixed amount to be
// paid to the federated servers.
//
// Currently we are paying just a few fixed addresses.
//
func GetCoinbase(ftime uint64) fct.ITransaction {
if false && adrs == nil {
var w wallet.ISCWallet
w = new(wallet.SCWallet)
w.Init()
adrs = make([]fct.IAddress, addressCnt)
for i := 0; i < addressCnt; i++ {
adr, _ := w.GenerateFctAddress([]byte("adr"+string(i)), 1, 1)
adrs[i] = adr
}
}
coinbase := new(fct.Transaction)
coinbase.SetMilliTimestamp(ftime)
for _, adr := range adrs {
coinbase.AddOutput(adr, amount) // add specified amount
}
return coinbase
}
示例2: CreateTransaction
func (w *SCWallet) CreateTransaction(time uint64) fct.ITransaction {
t := new(fct.Transaction)
t.SetMilliTimestamp(time)
return t
}