MCPcopy Create free account
hub / github.com/DNAProject/DNA / signTransaction

Function signTransaction

validator/stateless/stateless_validator_test.go:40–49  ·  view source on GitHub ↗
(signer *account.Account, tx *ctypes.MutableTransaction)

Source from the content-addressed store, hash-verified

38)
39
40func signTransaction(signer *account.Account, tx *ctypes.MutableTransaction) error {
41 hash := tx.Hash()
42 sign, _ := signature.Sign(signer, hash[:])
43 tx.Sigs = append(tx.Sigs, ctypes.Sig{
44 PubKeys: []keypair.PublicKey{signer.PublicKey},
45 M: 1,
46 SigData: [][]byte{sign},
47 })
48 return nil
49}
50
51func TestStatelessValidator(t *testing.T) {
52 log.InitLog(log.InfoLog, log.Stdout)

Callers 1

TestStatelessValidatorFunction · 0.85

Calls 2

SignFunction · 0.92
HashMethod · 0.65

Tested by

no test coverage detected