| 349 | } |
| 350 | |
| 351 | func (buf *Buffer) Encode4Bytes(bytes []byte) []byte { |
| 352 | // If Bytes4Indexes has this value, then we can just use the index |
| 353 | index := buf.Refs.Indexes.Bytes4Indexes[string(bytes)] |
| 354 | if index != 0 { |
| 355 | return []byte{byte(index)} |
| 356 | } |
| 357 | |
| 358 | // If don't then we need to provide it as-is, but it has to be prefixed with 0x00 |
| 359 | return append([]byte{0x00}, bytes...) |
| 360 | } |
| 361 | |
| 362 | func (buf *Buffer) WriteSequenceNonce(nonce *big.Int, randomNonce bool) (EncodeType, error) { |
| 363 | paddedNonce := make([]byte, 32) |