You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
396 B

  1. package txselector
  2. import (
  3. "encoding/binary"
  4. ethCommon "github.com/ethereum/go-ethereum/common"
  5. )
  6. func getAccountID(addr ethCommon.Address, tokenID uint32) [36]byte {
  7. var tokenIDBytes [4]byte
  8. binary.LittleEndian.PutUint32(tokenIDBytes[:], tokenID)
  9. accountIDBytes := append(addr[:], tokenIDBytes[:]...)
  10. var accountID [36]byte
  11. copy(accountID[:], accountIDBytes[:36])
  12. return accountID
  13. }