Skip to content

Commit

Permalink
feat: add cheque cell args generation function
Browse files Browse the repository at this point in the history
  • Loading branch information
shaojunda committed Dec 10, 2020
1 parent dbc4fc6 commit a4d6f63
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions utils/cheque_cell.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package utils

import "github.com/nervosnetwork/ckb-sdk-go/types"

func ChequeCellArgs(senderLock, receiverLock *types.Script) ([]byte, error) {
senderLockHash, err := senderLock.Hash()
if err != nil {
return []byte{}, err
}
return append(receiverLock.Args, senderLockHash.Bytes()[0:20]...), nil
}

0 comments on commit a4d6f63

Please sign in to comment.