contract: fix header bytes sent to smart contract
@@ -156,15 +156,15 @@ func (c *ContractExecutor) Run(amount, gasLimit uint64, entry string, params ...
vm.Memory = mem
}
- c.header = make([]byte, 8+common.SizeTransactionID+8+common.SizeAccountID+8)
+ c.header = make([]byte, 4+common.SizeTransactionID+4+common.SizeAccountID+8)
- binary.LittleEndian.PutUint64(c.header[0:8], uint64(len(tx.ID)))
- copy(c.header[8:8+common.SizeTransactionID], tx.ID[:])
+ binary.LittleEndian.PutUint32(c.header[0:4], uint32(len(tx.ID)))
+ copy(c.header[4:4+common.SizeTransactionID], tx.ID[:])
- binary.LittleEndian.PutUint64(c.header[8+common.SizeTransactionID:16+common.SizeTransactionID], uint64(len(tx.CreatorSignature)))
- copy(c.header[16+common.SizeTransactionID:16+common.SizeTransactionID+common.SizeAccountID], tx.Creator[:])
+ binary.LittleEndian.PutUint32(c.header[4+common.SizeTransactionID:8+common.SizeTransactionID], uint32(len(tx.Creator)))
+ copy(c.header[8+common.SizeTransactionID:8+common.SizeTransactionID+common.SizeAccountID], tx.Creator[:])
- binary.LittleEndian.PutUint64(c.header[16+common.SizeTransactionID+common.SizeAccountID:24+common.SizeTransactionID+common.SizeAccountID], amount)
+ binary.LittleEndian.PutUint64(c.header[8+common.SizeTransactionID+common.SizeAccountID:16+common.SizeTransactionID+common.SizeAccountID], amount)
entry = "_contract_" + entry
