MCPcopy
hub / github.com/canopy-network/canopy / GetSignBytes

Method GetSignBytes

lib/tx.go:150–163  ·  view source on GitHub ↗

GetSignBytes() returns the canonical byte representation of the Transaction for signing and signature verification

()

Source from the content-addressed store, hash-verified

148
149// GetSignBytes() returns the canonical byte representation of the Transaction for signing and signature verification
150func (x *Transaction) GetSignBytes() ([]byte, ErrorI) {
151 // exit with proto bytes but omit the signature
152 return Marshal(&Transaction{
153 MessageType: x.MessageType,
154 Msg: x.Msg,
155 Signature: nil,
156 Time: x.Time,
157 CreatedHeight: x.CreatedHeight,
158 Fee: x.Fee,
159 Memo: x.Memo,
160 NetworkId: x.NetworkId,
161 ChainId: x.ChainId,
162 })
163}
164
165// Sign() executes a digital signature on the transaction
166func (x *Transaction) Sign(pk crypto.PrivateKeyI) (err ErrorI) {

Callers 3

SignMethod · 0.95
TestGetSignBytesFunction · 0.95
TestSignFunction · 0.95

Calls 1

MarshalFunction · 0.70

Tested by 2

TestGetSignBytesFunction · 0.76
TestSignFunction · 0.76