Fetch the repository succeeded.
package itest
import (
"gitee.com/aiou-official/go-aiou/common"
"gitee.com/aiou-official/go-aiou/core/tx"
"gitee.com/aiou-official/go-aiou/rpc/pb"
)
// Receipt is the transaction receipt object
type Receipt struct {
*tx.TxReceipt
}
// Success will return whether the receipt is successful
func (r *Receipt) Success() bool {
return r.Status.Code == tx.Success
}
// NewReceiptFromPb returns a new Receipt instance from protobuffer struct.
func NewReceiptFromPb(tr *rpcpb.TxReceipt) *Receipt {
ret := &tx.TxReceipt{
TxHash: common.Base58Decode(tr.TxHash),
GasUsage: int64(tr.GasUsage * 100),
RAMUsage: tr.RamUsage,
Status: &tx.Status{
Message: tr.Message,
Code: tx.StatusCode(tr.StatusCode),
},
Returns: tr.Returns,
}
for _, r := range tr.Receipts {
ret.Receipts = append(ret.Receipts, &tx.Receipt{
FuncName: r.FuncName,
Content: r.Content,
})
}
return &Receipt{ret}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。